> ## Documentation Index
> Fetch the complete documentation index at: https://highseat.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Change the reporting currency

> Converts new sales at once and starts a job that converts past sales, as the dashboard does. Answers 202 with the job, 200 with `job: null` for the current currency, and 409 CONFLICT while a conversion runs.



## OpenAPI

````yaml https://api.highseat.com/v1/openapi.json put /sites/{site}/reporting-currency
openapi: 3.1.1
info:
  title: Highseat Stats API
  version: 1.0.0
  description: >-
    The same figures the dashboard shows, and the changes an admin makes there.
    A read key answers every GET route; a write key also answers the routes that
    change data.


    Authentication, write keys, idempotency, limits and the shape of every
    response: https://highseat.com/docs/api.
  license:
    name: Proprietary
servers:
  - url: https://api.highseat.com/v1
security:
  - bearerAuth: []
paths:
  /sites/{site}/reporting-currency:
    put:
      tags:
        - Sites
      summary: Change the reporting currency
      description: >-
        Converts new sales at once and starts a job that converts past sales, as
        the dashboard does. Answers 202 with the job, 200 with `job: null` for
        the current currency, and 409 CONFLICT while a conversion runs.
      operationId: updateReportingCurrency
      parameters:
        - name: site
          in: path
          required: true
          schema:
            type: string
            description: 'The site: its domain as registered (example.com), or its site id.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                currency:
                  type: string
                  description: ISO 4217 code, such as EUR.
              required:
                - currency
      responses:
        '200':
          description: The site reports in that currency already.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      site:
                        type: object
                        properties:
                          id:
                            type: string
                          name:
                            type: string
                          domain:
                            type: string
                            description: >-
                              The site's hostname, which also names it in a
                              path.
                          timezone:
                            type: string
                            description: IANA timezone every day boundary falls in.
                          reportingCurrency:
                            type: string
                            description: >-
                              ISO 4217 code every amount is reported in. PUT
                              /sites/{site}/reporting-currency changes it.
                          revenueMode:
                            enum:
                              - traffic
                              - balanced
                              - revenue
                            type: string
                            description: >-
                              What the site's dashboard leads with: `traffic`,
                              `balanced` or `revenue`. Display only: nothing
                              stored and no figure of the API changes.
                          attributionModel:
                            enum:
                              - last
                              - first
                              - linear
                            type: string
                            description: >-
                              Which pageview before a sale takes its credit in
                              revenue split by page, source or campaign: the
                              last, the first, or every one equally (`linear`).
                              Applied when a report runs, so a change re-credits
                              every past sale.
                          attributionLookback:
                            type: integer
                            minimum: -9007199254740991
                            maximum: 9007199254740991
                            description: >-
                              Days before a sale a pageview may lie and still
                              earn credit: 7, 14, 30 or 90. Applied when a
                              report runs, so a change re-credits every past
                              sale.
                          thankYouPaths:
                            type: array
                            items:
                              type: string
                            description: >-
                              Paths attribution never credits as a touch, `*`
                              wildcards allowed: the page a checkout returns to.
                              Applied when a report runs, so a change re-credits
                              every past sale.
                          keptQueryParams:
                            type: array
                            items:
                              type: string
                            description: >-
                              Query parameter names ingest keeps on a page's
                              URL, stripping every other one. A change reaches
                              new events only.
                          excludedIps:
                            type: array
                            items:
                              type: string
                            description: >-
                              IP addresses and CIDR ranges whose events ingest
                              drops. Left out of a read key's answer, since an
                              address is personal data.
                          excludedPaths:
                            type: array
                            items:
                              type: string
                            description: >-
                              Paths whose events ingest drops, `*` wildcards
                              allowed. A change reaches new events only.
                          extraHostnames:
                            type: array
                            items:
                              type: string
                            description: >-
                              Hostnames ingest counts besides the domain and its
                              subdomains: an exact name, or `*.example.com` for
                              that domain and its subdomains. A change reaches
                              new events only.
                          proxyPath:
                            type: string
                            description: >-
                              The path the site's first-party proxy serves the
                              script and takes events on, such as /3f9a1c2b7e.
                          secretHint:
                            anyOf:
                              - type: string
                              - type: 'null'
                            description: >-
                              The last four characters of the site secret a
                              proxy or backend sends. Null while the site has
                              none: POST /sites/{site}/secret mints it.
                          firstEventAt:
                            anyOf:
                              - type: string
                                format: date-time
                                x-native-type: date
                              - type: 'null'
                            description: >-
                              ISO 8601 in UTC: the site's earliest event. Null
                              before the first one.
                          createdAt:
                            type: string
                            format: date-time
                            x-native-type: date
                            description: 'ISO 8601 in UTC: when the site was added.'
                        required:
                          - id
                          - name
                          - domain
                          - timezone
                          - reportingCurrency
                          - revenueMode
                          - attributionModel
                          - attributionLookback
                          - thankYouPaths
                          - keptQueryParams
                          - excludedPaths
                          - extraHostnames
                          - proxyPath
                          - secretHint
                          - firstEventAt
                          - createdAt
                      job:
                        type: 'null'
                    required:
                      - site
                      - job
                required:
                  - data
          headers:
            RateLimit-Limit:
              $ref: '#/components/headers/RateLimit-Limit'
            RateLimit-Remaining:
              $ref: '#/components/headers/RateLimit-Remaining'
            RateLimit-Reset:
              $ref: '#/components/headers/RateLimit-Reset'
            RateLimit-Policy:
              $ref: '#/components/headers/RateLimit-Policy'
            RateLimit:
              $ref: '#/components/headers/RateLimit'
        '202':
          description: A job converts the past sales.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      site:
                        type: object
                        properties:
                          id:
                            type: string
                          name:
                            type: string
                          domain:
                            type: string
                            description: >-
                              The site's hostname, which also names it in a
                              path.
                          timezone:
                            type: string
                            description: IANA timezone every day boundary falls in.
                          reportingCurrency:
                            type: string
                            description: >-
                              ISO 4217 code every amount is reported in. PUT
                              /sites/{site}/reporting-currency changes it.
                          revenueMode:
                            enum:
                              - traffic
                              - balanced
                              - revenue
                            type: string
                            description: >-
                              What the site's dashboard leads with: `traffic`,
                              `balanced` or `revenue`. Display only: nothing
                              stored and no figure of the API changes.
                          attributionModel:
                            enum:
                              - last
                              - first
                              - linear
                            type: string
                            description: >-
                              Which pageview before a sale takes its credit in
                              revenue split by page, source or campaign: the
                              last, the first, or every one equally (`linear`).
                              Applied when a report runs, so a change re-credits
                              every past sale.
                          attributionLookback:
                            type: integer
                            minimum: -9007199254740991
                            maximum: 9007199254740991
                            description: >-
                              Days before a sale a pageview may lie and still
                              earn credit: 7, 14, 30 or 90. Applied when a
                              report runs, so a change re-credits every past
                              sale.
                          thankYouPaths:
                            type: array
                            items:
                              type: string
                            description: >-
                              Paths attribution never credits as a touch, `*`
                              wildcards allowed: the page a checkout returns to.
                              Applied when a report runs, so a change re-credits
                              every past sale.
                          keptQueryParams:
                            type: array
                            items:
                              type: string
                            description: >-
                              Query parameter names ingest keeps on a page's
                              URL, stripping every other one. A change reaches
                              new events only.
                          excludedIps:
                            type: array
                            items:
                              type: string
                            description: >-
                              IP addresses and CIDR ranges whose events ingest
                              drops. Left out of a read key's answer, since an
                              address is personal data.
                          excludedPaths:
                            type: array
                            items:
                              type: string
                            description: >-
                              Paths whose events ingest drops, `*` wildcards
                              allowed. A change reaches new events only.
                          extraHostnames:
                            type: array
                            items:
                              type: string
                            description: >-
                              Hostnames ingest counts besides the domain and its
                              subdomains: an exact name, or `*.example.com` for
                              that domain and its subdomains. A change reaches
                              new events only.
                          proxyPath:
                            type: string
                            description: >-
                              The path the site's first-party proxy serves the
                              script and takes events on, such as /3f9a1c2b7e.
                          secretHint:
                            anyOf:
                              - type: string
                              - type: 'null'
                            description: >-
                              The last four characters of the site secret a
                              proxy or backend sends. Null while the site has
                              none: POST /sites/{site}/secret mints it.
                          firstEventAt:
                            anyOf:
                              - type: string
                                format: date-time
                                x-native-type: date
                              - type: 'null'
                            description: >-
                              ISO 8601 in UTC: the site's earliest event. Null
                              before the first one.
                          createdAt:
                            type: string
                            format: date-time
                            x-native-type: date
                            description: 'ISO 8601 in UTC: when the site was added.'
                        required:
                          - id
                          - name
                          - domain
                          - timezone
                          - reportingCurrency
                          - revenueMode
                          - attributionModel
                          - attributionLookback
                          - thankYouPaths
                          - keptQueryParams
                          - excludedPaths
                          - extraHostnames
                          - proxyPath
                          - secretHint
                          - firstEventAt
                          - createdAt
                      job:
                        type: object
                        properties:
                          id:
                            type: string
                          kind:
                            type: string
                          status:
                            type: string
                            description: >-
                              `pending` until a worker picks it up, then
                              `running`.
                          createdAt:
                            type: string
                            format: date-time
                            x-native-type: date
                        required:
                          - id
                          - kind
                          - status
                          - createdAt
                    required:
                      - site
                      - job
                required:
                  - data
          headers:
            RateLimit-Limit:
              $ref: '#/components/headers/RateLimit-Limit'
            RateLimit-Remaining:
              $ref: '#/components/headers/RateLimit-Remaining'
            RateLimit-Reset:
              $ref: '#/components/headers/RateLimit-Reset'
            RateLimit-Policy:
              $ref: '#/components/headers/RateLimit-Policy'
            RateLimit:
              $ref: '#/components/headers/RateLimit'
        '400':
          $ref: '#/components/responses/WriteError400'
        '401':
          $ref: '#/components/responses/Error401'
        '403':
          $ref: '#/components/responses/WriteError403'
        '404':
          $ref: '#/components/responses/Error404'
        '409':
          $ref: '#/components/responses/WriteError409'
        '413':
          $ref: '#/components/responses/WriteError413'
        '422':
          $ref: '#/components/responses/WriteError422'
        '429':
          $ref: '#/components/responses/Error429'
        '503':
          $ref: '#/components/responses/Error503'
components:
  headers:
    RateLimit-Limit:
      description: Calls the key may make in the window.
      schema:
        type: integer
    RateLimit-Remaining:
      description: Calls left in the current window.
      schema:
        type: integer
    RateLimit-Reset:
      description: Seconds until the window reopens.
      schema:
        type: integer
    RateLimit-Policy:
      description: >-
        The quota and window, as the IETF draft writes it:
        "hourly";q=600;w=3600.
      schema:
        type: string
    RateLimit:
      description: >-
        The remaining budget, as the IETF draft writes it:
        "hourly";r=599;t=3540.
      schema:
        type: string
    Retry-After:
      description: Seconds to wait before the next call.
      schema:
        type: integer
  responses:
    WriteError400:
      description: >-
        The request is malformed, or its Idempotency-Key is not 1 to 255
        characters: BAD_REQUEST.
      headers:
        RateLimit-Limit:
          $ref: '#/components/headers/RateLimit-Limit'
        RateLimit-Remaining:
          $ref: '#/components/headers/RateLimit-Remaining'
        RateLimit-Reset:
          $ref: '#/components/headers/RateLimit-Reset'
        RateLimit-Policy:
          $ref: '#/components/headers/RateLimit-Policy'
        RateLimit:
          $ref: '#/components/headers/RateLimit'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Error401:
      description: 'No API key, or one that is not valid: UNAUTHORIZED.'
      headers:
        RateLimit-Limit:
          $ref: '#/components/headers/RateLimit-Limit'
        RateLimit-Remaining:
          $ref: '#/components/headers/RateLimit-Remaining'
        RateLimit-Reset:
          $ref: '#/components/headers/RateLimit-Reset'
        RateLimit-Policy:
          $ref: '#/components/headers/RateLimit-Policy'
        RateLimit:
          $ref: '#/components/headers/RateLimit'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    WriteError403:
      description: >-
        The key can only read (KEY_READ_ONLY), or the workspace is closed until
        it pays and takes no changes (FORBIDDEN).
      headers:
        RateLimit-Limit:
          $ref: '#/components/headers/RateLimit-Limit'
        RateLimit-Remaining:
          $ref: '#/components/headers/RateLimit-Remaining'
        RateLimit-Reset:
          $ref: '#/components/headers/RateLimit-Reset'
        RateLimit-Policy:
          $ref: '#/components/headers/RateLimit-Policy'
        RateLimit:
          $ref: '#/components/headers/RateLimit'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Error404:
      description: 'The site, the row the path names or the route does not exist: NOT_FOUND.'
      headers:
        RateLimit-Limit:
          $ref: '#/components/headers/RateLimit-Limit'
        RateLimit-Remaining:
          $ref: '#/components/headers/RateLimit-Remaining'
        RateLimit-Reset:
          $ref: '#/components/headers/RateLimit-Reset'
        RateLimit-Policy:
          $ref: '#/components/headers/RateLimit-Policy'
        RateLimit:
          $ref: '#/components/headers/RateLimit'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    WriteError409:
      description: >-
        The change conflicts with a row that exists (CONFLICT, or the write's
        own code, which carries the row's `id`), or a request with the same
        Idempotency-Key still runs (IDEMPOTENCY_KEY_IN_USE).
      headers:
        RateLimit-Limit:
          $ref: '#/components/headers/RateLimit-Limit'
        RateLimit-Remaining:
          $ref: '#/components/headers/RateLimit-Remaining'
        RateLimit-Reset:
          $ref: '#/components/headers/RateLimit-Reset'
        RateLimit-Policy:
          $ref: '#/components/headers/RateLimit-Policy'
        RateLimit:
          $ref: '#/components/headers/RateLimit'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    WriteError413:
      description: 'The body is over 1 MB: PAYLOAD_TOO_LARGE.'
      headers:
        RateLimit-Limit:
          $ref: '#/components/headers/RateLimit-Limit'
        RateLimit-Remaining:
          $ref: '#/components/headers/RateLimit-Remaining'
        RateLimit-Reset:
          $ref: '#/components/headers/RateLimit-Reset'
        RateLimit-Policy:
          $ref: '#/components/headers/RateLimit-Policy'
        RateLimit:
          $ref: '#/components/headers/RateLimit'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    WriteError422:
      description: >-
        The Idempotency-Key was sent with another request in the last 24 hours
        (IDEMPOTENCY_KEY_REUSED), or the site already has as many rows of this
        kind as it may save (the write's own code, such as GOAL_LIMIT_REACHED).
      headers:
        RateLimit-Limit:
          $ref: '#/components/headers/RateLimit-Limit'
        RateLimit-Remaining:
          $ref: '#/components/headers/RateLimit-Remaining'
        RateLimit-Reset:
          $ref: '#/components/headers/RateLimit-Reset'
        RateLimit-Policy:
          $ref: '#/components/headers/RateLimit-Policy'
        RateLimit:
          $ref: '#/components/headers/RateLimit'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Error429:
      description: >-
        The key has used its hourly budget (RATE_LIMITED), or its workspace
        already runs as many calls at once as it may
        (TOO_MANY_CONCURRENT_REQUESTS).
      headers:
        RateLimit-Limit:
          $ref: '#/components/headers/RateLimit-Limit'
        RateLimit-Remaining:
          $ref: '#/components/headers/RateLimit-Remaining'
        RateLimit-Reset:
          $ref: '#/components/headers/RateLimit-Reset'
        RateLimit-Policy:
          $ref: '#/components/headers/RateLimit-Policy'
        RateLimit:
          $ref: '#/components/headers/RateLimit'
        Retry-After:
          $ref: '#/components/headers/Retry-After'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Error503:
      description: 'The server is busy; retry in a moment: SERVICE_UNAVAILABLE.'
      headers:
        RateLimit-Limit:
          $ref: '#/components/headers/RateLimit-Limit'
        RateLimit-Remaining:
          $ref: '#/components/headers/RateLimit-Remaining'
        RateLimit-Reset:
          $ref: '#/components/headers/RateLimit-Reset'
        RateLimit-Policy:
          $ref: '#/components/headers/RateLimit-Policy'
        RateLimit:
          $ref: '#/components/headers/RateLimit'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  schemas:
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              description: >-
                Stable and machine-readable: BAD_REQUEST, INVALID_FILTER,
                INVALID_CURSOR, UNAUTHORIZED, FORBIDDEN, KEY_READ_ONLY,
                NOT_FOUND, METHOD_NOT_ALLOWED, CONFLICT, IDEMPOTENCY_KEY_IN_USE,
                PAYLOAD_TOO_LARGE, IDEMPOTENCY_KEY_REUSED, QUERY_TIMEOUT,
                RATE_LIMITED, TOO_MANY_CONCURRENT_REQUESTS, SERVICE_UNAVAILABLE
                or INTERNAL_SERVER_ERROR. A write may answer a code of its own:
                a conflict (GOAL_EXISTS, DOMAIN_TAKEN, SECRET_EXISTS) or a limit
                (GOAL_LIMIT_REACHED, FUNNEL_LIMIT_REACHED). Codes are added,
                never renamed.
            message:
              type: string
              description: What went wrong, written for a person.
            id:
              type: string
              description: >-
                On a conflict, the existing row's id, so a client can update it
                instead.
            issues:
              type: array
              items:
                type: object
                properties:
                  path:
                    type: array
                    items:
                      anyOf:
                        - type: string
                        - type: number
                    description: >-
                      The parameter at fault, e.g. ['filter', 1] for the second
                      filter.
                  message:
                    type: string
                required:
                  - path
                  - message
              description: One entry per invalid parameter.
          required:
            - code
            - message
      required:
        - error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.