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

# List your orders across all your brands

> Lists your orders across all the brands your API key owns — the queryable backing read that makes your webhook stream reconcilable, so a missed, delayed, or replayed delivery always has an authoritative source to reconcile against. The results are scoped to the brands your key owns; you never supply a caller id, body, or query to widen that scope. Results are returned in a stable total order (updated_at ascending, then order_ref ascending): record the greatest updated_at you have processed, pass it as updated_since to fetch everything that changed after that watermark, and walk the opaque, scope-bound cursor to the end — so a caller who dropped a week of deliveries can reconcile completely from this endpoint alone. An optional brand_id narrows the results to one of your brands; a brand your key does not own is treated as not found (404, never 403, so existence is never revealed). Each row includes only the order reference, brand, offering, status, exact amount in minor units, currency, and timestamps — never patient identity or medical information. It reports your orders; it never moves money.



## OpenAPI

````yaml /openapi/public-openapi.json get /v1/account/orders
openapi: 3.1.0
info:
  title: Purple API
  version: 0.0.0
servers:
  - url: https://api.dev.purplelabelmd.com
security: []
tags:
  - description: Sign a patient in and out and manage the browser session.
    name: Sessions & authentication
  - description: Run the server-driven intake questionnaire question by question.
    name: Intake
  - description: Address autocomplete for the intake flow.
    name: Addresses
  - description: Read the public status of a patient's enrollment.
    name: Enrollment
  - description: Track a client's onboarding progress.
    name: Onboarding
  - description: Read back the platform configuration stored for your brand.
    name: Brand configuration
  - description: Enable offerings for your brand and set their display copy.
    name: Offering configuration
  - description: Start and track payments for an order.
    name: Payments
  - description: Subscribe to platform events and manage delivery endpoints.
    name: Webhooks
paths:
  /v1/account/orders:
    get:
      tags:
        - Payments
      summary: List your orders across all your brands
      description: >-
        Lists your orders across all the brands your API key owns — the
        queryable backing read that makes your webhook stream reconcilable, so a
        missed, delayed, or replayed delivery always has an authoritative source
        to reconcile against. The results are scoped to the brands your key
        owns; you never supply a caller id, body, or query to widen that scope.
        Results are returned in a stable total order (updated_at ascending, then
        order_ref ascending): record the greatest updated_at you have processed,
        pass it as updated_since to fetch everything that changed after that
        watermark, and walk the opaque, scope-bound cursor to the end — so a
        caller who dropped a week of deliveries can reconcile completely from
        this endpoint alone. An optional brand_id narrows the results to one of
        your brands; a brand your key does not own is treated as not found (404,
        never 403, so existence is never revealed). Each row includes only the
        order reference, brand, offering, status, exact amount in minor units,
        currency, and timestamps — never patient identity or medical
        information. It reports your orders; it never moves money.
      operationId: listCommerceAccountOrders
      parameters:
        - description: >-
            narrow to ONE of the client's own brands (brd_…); omitted ⇒ all the
            client's brands. A brand the client does not own is a foreign brand
            → 404 (never 403).
          in: query
          name: brand_id
          required: false
          schema:
            pattern: ^brd_[A-Za-z0-9][A-Za-z0-9_-]*$
            type: string
        - description: filter to one order state
          in: query
          name: status
          required: false
          schema:
            enum:
              - created
              - payment_authorized
              - paid
              - payment_failed
              - partially_refunded
              - refunded
              - disputed
              - cancelled
            type: string
        - description: >-
            RECONCILIATION filter (ISO 8601 date-time, inclusive): return only
            orders whose updated_at ≥ this. Record the greatest updated_at you
            have processed and re-query with it to catch up on everything that
            changed after a missed/dropped webhook window.
          in: query
          name: updated_since
          required: false
          schema:
            format: date-time
            type: string
        - description: page size (default 50, max 200)
          in: query
          name: limit
          required: false
          schema:
            default: 50
            maximum: 200
            minimum: 1
            type: integer
        - description: >-
            opaque, scope+filter-bound keyset cursor (api-style-guide §2). Bound
            to BOTH the tenant scope and the active filters — a cursor from
            another scope or a changed filter set is rejected (400), never
            silently re-scoped.
          in: query
          name: cursor
          required: false
          schema:
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CommerceAccountOrderList'
          description: >-
            a page of the client's orders (non-PHI projection) + an optional
            next_cursor
        '400':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/CommerceProblem'
          description: malformed filter/cursor — RFC 7807
        '401':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/CommerceProblem'
          description: >-
            Unauthenticated — an unknown or revoked API key resolves nothing and
            returns a single opaque error body, with no way to probe whether a
            key is valid — RFC 7807
        '404':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/CommerceProblem'
          description: >-
            a brand the client does not own (foreign brand) — 404, never 403 —
            RFC 7807
      security:
        - apiKey: []
components:
  schemas:
    CommerceAccountOrderList:
      description: >-
        A page of your orders: a list of non-PHI order rows plus an optional
        next_cursor for keyset pagination. The cursor is opaque and bound to
        both your scope and the active filters. When next_cursor is absent, you
        have reached the last page. Walk the cursor to the end, together with
        updated_since, to reconcile completely.
      properties:
        data:
          items:
            $ref: '#/components/schemas/CommerceAccountOrderRow'
          type: array
        next_cursor:
          description: >-
            opaque keyset cursor for the next page; bound to BOTH the tenant
            scope and the active filters (changing either invalidates it — a
            stale/foreign cursor 400s, never re-scopes).
          type: string
      required:
        - data
      type: object
    CommerceProblem:
      description: RFC 7807 problem document (api-style-guide)
      properties:
        detail:
          type: string
        status:
          type: integer
        title:
          type: string
        type:
          type: string
      required:
        - type
        - title
        - status
      type: object
    CommerceAccountOrderRow:
      additionalProperties: false
      description: >-
        The non-PHI view of one of your orders — a closed, minimum-necessary
        set: order reference, brand, offering, status, exact amount in minor
        units, currency, and timestamps. It never includes patient identity
        (name, email, phone, address), medical information, card data, a payment
        reference, or any secret. It reports the order; it does not move money.
      properties:
        brand_id:
          description: >-
            the client's brand this order belongs to — the account table's
            grouping/filter key
          type: string
        created_at:
          description: order creation timestamp
          format: date-time
          type: string
        currency:
          pattern: ^[A-Z]{3}$
          type: string
        offering_ref:
          description: the offering (SKU-family) this order was placed against
          type: string
        order_ref:
          type: string
        state:
          enum:
            - created
            - payment_authorized
            - paid
            - payment_failed
            - partially_refunded
            - refunded
            - disputed
            - cancelled
          type: string
        total_minor:
          description: >-
            order total, integer minor units (never a float) — money-SHAPED, not
            moved
          type: integer
        updated_at:
          description: >-
            last-modification timestamp — advances on every state change. The
            RECONCILIATION watermark: sort key + the updated_since filter
            target, so a client can catch up after a missed webhook window.
          format: date-time
          type: string
      required:
        - order_ref
        - brand_id
        - offering_ref
        - state
        - total_minor
        - currency
        - created_at
        - updated_at
      type: object
  securitySchemes:
    apiKey:
      description: 'Per-client API key (M2M). Presented as `Authorization: Bearer <key>`.'
      scheme: bearer
      type: http

````