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

# List orders

> List order history, paginated. `from`/`to` are **full ISO 8601
datetimes** here (unlike Invoices' date-only filters) — a bare date
parses to UTC midnight, so `from == to` collapses the range to a single
instant; set `to` to end-of-day explicitly.




## OpenAPI

````yaml /openapi.yaml get /api/v1.1/orders
openapi: 3.1.0
info:
  title: Spenza Partner API
  version: 3.0.0
  summary: >-
    Partner API for SIMs, eSIMs, plans, billing, users, groups and numbers —
    v1.1 surface.
  description: >
    The **Spenza Partner API** lets you manage SIMs, eSIMs, plans,
    subscriptions,

    billing, users, phone numbers, teams and device/SIM/user groups
    programmatically.


    All endpoints follow one consistent standard:


    - **Auth** — exchange your API `key` + `secret` for a bearer token, then
    send
      `Authorization: Bearer <token>` on every request.
    - **Envelopes** — success responses are `{ success, data, meta? }`; errors
    are
      `{ success: false, error: { code, message, details? } }`.
    - **Pagination** — list endpoints accept `page` (1-indexed) and `pageSize`
      (max 100); totals are returned in `meta`.
    - **Idempotency** — many write endpoints honor an optional `Idempotency-Key`
      request header so a retried call replays the original result instead of
      repeating the side effect.
    - **Async operations** — a handful of endpoints (eSIM provisioning, port-in,
      the `/api/v3/...` purchase variants, top-up) return `202` (`201` for
      top-up) with a `transactionId` + `statusEndpoint` instead of the finished
      resource. Poll
      `GET /api/v3/transactions/{transactionId}` (no auth required) until the
      transaction reaches a terminal status.

    One resource — **port-in submission** — is a documented exception: it lives
    at

    `POST /api/v3/port-in`, requires an Admin-tier account role rather than just
    a

    valid bearer token, and is **not** on the standard envelope (see that
    operation's

    description for its exact response shape).
  contact:
    name: Spenza API Support
    email: support@spenza.com
    url: https://spenza.com
  license:
    name: Proprietary
    url: https://spenza.com/terms
  x-logo:
    url: https://spenza.com/logo.png
    altText: Spenza
servers:
  - url: https://api.spenza.com
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Authentication
    description: Exchange API credentials for a bearer token.
  - name: SIMs
    description: List, inspect, assign and manage SIMs.
  - name: Subscriptions
    description: Plan subscriptions attached to SIMs.
  - name: Plans & Catalog
    description: Purchasable plans and SIM products.
  - name: eSIM
    description: Provision eSIMs and fetch activation QR / install status.
  - name: Billing
    description: Invoices, credit balance and top-ups.
  - name: Users
    description: End users (employees) on your account that SIMs/devices are assigned to.
  - name: Orders & Transactions
    description: Order history and financial transactions.
  - name: Numbers & Port-in
    description: Check port-in eligibility and port existing numbers into Spenza.
  - name: Messaging
    description: Send outbound SMS from a provisioned number.
  - name: Webhooks
    description: Register endpoints for operator SMS/voice events and inspect deliveries.
  - name: Notifications
    description: In-account notifications and delivery preferences.
  - name: Device Groups
    description: Organize devices into named groups with spend/data limits.
  - name: SIM Groups
    description: Organize SIMs into named groups with spend/data limits.
  - name: User Groups
    description: Organize users (departments) into named groups with spend/data limits.
  - name: Devices
    description: The device catalog (phones/tablets) and their assignment to users.
  - name: Team Members
    description: Admins who manage your Spenza account (distinct from Users/end-users).
  - name: Async Status
    description: Universal status poll for any asynchronous (v3) operation.
paths:
  /api/v1.1/orders:
    get:
      tags:
        - Orders & Transactions
      summary: List orders
      description: |
        List order history, paginated. `from`/`to` are **full ISO 8601
        datetimes** here (unlike Invoices' date-only filters) — a bare date
        parses to UTC midnight, so `from == to` collapses the range to a single
        instant; set `to` to end-of-day explicitly.
      operationId: listOrders
      parameters:
        - $ref: '#/components/parameters/Page'
        - $ref: '#/components/parameters/PageSize'
        - name: from
          in: query
          schema:
            type: string
            format: date-time
            example: '2026-07-01T00:00:00Z'
        - name: to
          in: query
          schema:
            type: string
            format: date-time
            example: '2026-07-31T23:59:59Z'
        - name: type
          in: query
          schema:
            type: string
            enum:
              - PLAN_PURCHASE
              - SIM_PURCHASE
              - SAAS_PURCHASE
              - OTHER
        - name: status
          in: query
          schema:
            type: string
            enum:
              - PENDING
              - COMPLETED
              - SHIPPED
              - DELIVERED
              - FAILED
      responses:
        '200':
          description: A page of orders.
          content:
            application/json:
              example:
                success: true
                data:
                  - id: ord_1698765432100
                    type: PLAN_PURCHASE
                    status: COMPLETED
                    amount: 49.99
                    currency: usd
                    iccid: '8901260853182965429'
                    createdAt: '2026-07-01T10:00:00.000Z'
                meta:
                  page: 1
                  pageSize: 25
                  total: 30
                  totalPages: 2
        '400':
          description: >-
            Query validation failed, or an unexpected database error occurred
            while listing orders (the latter is surfaced as a 400
            VALIDATION_ERROR too, with the raw internal error message passed
            through unmodified rather than genericized).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
              examples:
                validation:
                  value:
                    success: false
                    error:
                      code: VALIDATION_ERROR
                      message: from must be a valid ISO 8601 date
                      details:
                        validationErrors:
                          - from must be a valid ISO 8601 date
                databaseError:
                  value:
                    success: false
                    error:
                      code: VALIDATION_ERROR
                      message: >-
                        <raw underlying database error message, passed through
                        unmodified>
components:
  parameters:
    Page:
      name: page
      in: query
      description: 1-indexed page number.
      required: false
      schema:
        type: integer
        minimum: 1
        default: 1
    PageSize:
      name: pageSize
      in: query
      description: Items per page.
      required: false
      schema:
        type: integer
        minimum: 1
        maximum: 100
        default: 25
  schemas:
    ErrorEnvelope:
      type: object
      required:
        - success
        - error
      properties:
        success:
          type: boolean
          example: false
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              example: SIM_NOT_FOUND
            message:
              type: string
              example: We couldn't find a SIM with that ICCID on your account.
            details:
              description: >-
                Present on some 4xx errors (for example a list of missing
                fields). Always absent on 5xx.
              type: object
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Bearer token obtained from `POST /api/v1.1/auth/token`.

````