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

# Get order settings

> Return the account's order settings — count flags for pending / voided
orders, refund-date attribution, and the list of exclusion filters that
drop matching orders from every analytics query.

Defaults are applied when the account has no stored `orderSettings`
(`countPendingOrders=false`, `countVoidedOrders=false`,
`refundDateAttribution=refund_date`, `exclusionFilters=[]`) so the
response shape is always complete.

**Required scope:** `account:read`.




## OpenAPI

````yaml /api-reference/openapi.yaml get /accounts/api/account/settings/order
openapi: 3.1.0
info:
  title: Upstack Data API
  version: '1.0'
  description: >
    Programmatic access to your Upstack Data pixel — analytics queries, the

    measures/dimensions catalog, and dashboard view management.


    All requests authenticate with two headers:


    - `x-api-key`: your Upstack API key (mint one at **Settings → API Keys** in
    the dashboard).

    - `x-pixel-id`: the pixel id the request targets. One key is scoped to one
    pixel.
servers:
  - url: https://api.upstackdata.com
    description: Production
security:
  - apiKey: []
    pixelId: []
tags:
  - name: Analytics
    description: Query events, attribution, and cohort analyses.
  - name: Catalog
    description: List the measures available to your pixel.
  - name: Dashboards
    description: >-
      Manage dashboard views — create, update, copy, delete, and the high-level
      preset builder.
  - name: Account
    description: >-
      Read and update the account that owns this API key — display name, active
      owners and admins, and subscription summary.
  - name: Costs
    description: >-
      Read and update every cost surface — global product overrides, shipping
      method, per-variant handling fees and COGS history, and per-type cost
      lines (order / gateway / shipping profile / variable / fixed). Mutations
      trigger the same per-order COGS recalculation as web-UI changes.
  - name: Products
    description: Browse products + variants in the configured catalog.
  - name: Events
    description: Send server-side tracking events directly from your backend.
paths:
  /accounts/api/account/settings/order:
    get:
      tags:
        - Account
      summary: Get order settings
      description: |
        Return the account's order settings — count flags for pending / voided
        orders, refund-date attribution, and the list of exclusion filters that
        drop matching orders from every analytics query.

        Defaults are applied when the account has no stored `orderSettings`
        (`countPendingOrders=false`, `countVoidedOrders=false`,
        `refundDateAttribution=refund_date`, `exclusionFilters=[]`) so the
        response shape is always complete.

        **Required scope:** `account:read`.
      operationId: getOrderSettings
      responses:
        '200':
          description: The current order settings.
          content:
            application/json:
              schema:
                type: object
                required:
                  - orderSettings
                properties:
                  orderSettings:
                    $ref: '#/components/schemas/AccountOrderSettings'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  schemas:
    AccountOrderSettings:
      type: object
      required:
        - countPendingOrders
        - countVoidedOrders
        - refundDateAttribution
        - exclusionFilters
      description: >
        Account-wide order analytics config. Drives every revenue, attribution,

        and cohort number across the dashboard and the public query API.
        Defaults

        when unset: `countPendingOrders=false`, `countVoidedOrders=false`,

        `refundDateAttribution=refund_date`, `exclusionFilters=[]`.


        PUT semantics are whole-object replace — any existing filter not present

        in the PUT body is deleted. Max 50 filters per account.
      properties:
        countPendingOrders:
          type: boolean
          description: Include pending orders in revenue / attribution metrics.
        countVoidedOrders:
          type: boolean
          description: Include voided orders in revenue / attribution metrics.
        refundDateAttribution:
          $ref: '#/components/schemas/RefundDateAttribution'
        exclusionFilters:
          type: array
          maxItems: 50
          items:
            $ref: '#/components/schemas/OrderExclusionFilter'
    RefundDateAttribution:
      type: string
      enum:
        - refund_date
        - order_date
      description: |
        How refunds are dated for revenue attribution.
        - `refund_date` — matches Shopify, defaults to this.
        - `order_date` — attribute the refund to the original order date.
    OrderExclusionFilter:
      type: object
      required:
        - name
        - enabled
        - conditionGroups
      description: |
        A single exclusion filter. Orders matching ANY enabled filter are
        dropped from analytics queries (revenue, attribution, cohort, etc.).
        `id`, `createdAt`, `updatedAt` are server-assigned. Max 20 condition
        groups per filter.
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
          minLength: 1
          maxLength: 100
          example: Exclude POS
          description: |
            Display name. Control / zero-width / bidi characters rejected;
            unicode letters, marks, digits, punctuation, and emoji accepted.
        enabled:
          type: boolean
        conditionGroups:
          type: array
          minItems: 1
          maxItems: 20
          items:
            $ref: '#/components/schemas/ConditionGroup'
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    Error:
      type: object
      required:
        - message
      properties:
        message:
          type: string
          description: Human-readable error message.
        errors:
          type: array
          description: Per-field validation errors (present on 400 responses).
          items:
            type: object
            properties:
              message:
                type: string
              key:
                type: string
              path:
                type: array
                items:
                  type: string
    ConditionGroup:
      type: object
      required:
        - logic
        - conditions
      description: |
        Group of conditions joined by `logic`. Within a filter, groups
        are OR'd; within a group, conditions are joined by the group's
        `logic`. Max 20 conditions per group.
      properties:
        id:
          type: string
          format: uuid
        logic:
          $ref: '#/components/schemas/ConditionLogic'
        conditions:
          type: array
          minItems: 1
          maxItems: 20
          items:
            $ref: '#/components/schemas/Condition'
    ConditionLogic:
      type: string
      enum:
        - and
        - or
    Condition:
      type: object
      required:
        - field
        - operator
      description: |
        Single condition inside a group. `id` is server-assigned on create
        (uuid v4); supply it on subsequent PUTs to preserve the entry's
        identity. `value` is required for every operator except `exists` /
        `not_exists`.
      properties:
        id:
          type: string
          format: uuid
        field:
          $ref: '#/components/schemas/OrderExclusionField'
        operator:
          $ref: '#/components/schemas/ConditionOperator'
        value:
          oneOf:
            - type: string
            - type: number
            - type: boolean
            - type: array
              items:
                type: string
    OrderExclusionField:
      type: string
      enum:
        - sourceName
        - tags
        - value
        - paymentGateway
      description: |
        Order field a condition is evaluated against. Each field has its own
        set of supported operators — see `ORDER_EXCLUSION_FIELD_CATALOG` in
        `@adtrackify/at-tracking-event-types` for the authoritative mapping.
    ConditionOperator:
      type: string
      enum:
        - equals
        - not_equals
        - in
        - not_in
        - contains
        - not_contains
        - starts_with
        - ends_with
        - greater_than
        - less_than
        - greater_than_or_equals
        - less_than_or_equals
        - exists
        - not_exists
        - array_includes
        - array_includes_all
        - array_includes_any
      description: >
        Comparison operator. Must be supported by the field's type

        (string / array / number) per `ORDER_EXCLUSION_FIELD_CATALOG`.
        Submitting

        a numeric operator on a string field (e.g. `greater_than` on
        `sourceName`)

        is rejected with 400.
  responses:
    Unauthorized:
      description: >-
        Missing or invalid `x-api-key` / `x-pixel-id`, or key is
        revoked/expired.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: >-
        API key does not carry the required scope for this endpoint, or body
        `pixelId` does not match the `x-pixel-id` header.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: The addressed resource does not exist (or belongs to a different pixel).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: Your Upstack API key. Starts with `upstack_`.
    pixelId:
      type: apiKey
      in: header
      name: x-pixel-id
      description: The pixel id the request targets.

````