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

# ListOrders

> ListOrders returns a page of the reseller's orders, newest first. It is
 cursor-paginated: pass next_cursor from the previous page to fetch the next.
 A live key lists live orders and a test key lists its own sandbox orders.



## OpenAPI

````yaml /api-reference/sodacards.yaml get /v1/orders
openapi: 3.1.0
info:
  title: SODACARDS Developer API
  description: Sell gift cards and game top-ups from your own systems.
  version: 1.0.0
servers:
  - url: https://api.sodacards.com
security:
  - ApiKeyAuth: []
tags:
  - name: PublicAPIService
    description: >-
      PublicAPIService is the public developer API a reseller calls with an API
      key.
       It is served as REST (via HTTP transcoding) so developers use GET /v1/... and
       curl, and its OpenAPI 3.1 spec is generated from this one file. Every method is
       authenticated by the API-key gateway that fronts it.
paths:
  /v1/orders:
    get:
      summary: ListOrders
      description: |-
        ListOrders returns a page of the reseller's orders, newest first. It is
         cursor-paginated: pass next_cursor from the previous page to fetch the next.
         A live key lists live orders and a test key lists its own sandbox orders.
      operationId: listOrders
      parameters:
        - name: limit
          in: query
          description: >-
            limit is the maximum number of orders to return (1..100). Zero
            applies the
             default page size.
          schema:
            type: integer
            title: limit
            format: int32
        - name: cursor
          in: query
          description: >-
            cursor is the next_cursor of the previous page. Empty for the first
            page.
          schema:
            type: string
            title: cursor
        - name: reference
          in: query
          description: >-
            reference, when set, filters the list to the orders carrying that
            client
             reference. The cursor is ignored when a reference is given.
          schema:
            type: string
            title: reference
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/sodacards.devpublic.v1.ListOrdersResponse'
      x-codeSamples:
        - lang: python
          label: Python
          source: |
            import os, sodacards

            config = sodacards.Configuration(host="https://api.sodacards.com")
            config.api_key["ApiKeyAuth"] = os.environ["SODACARDS_API_KEY"]
            client = sodacards.DefaultApi(sodacards.ApiClient(config))

            orders = client.list_orders()
        - lang: typescript
          label: TypeScript
          source: >
            import { Sodacards } from "@sodacards/sdk";


            const sodacards = new Sodacards({ apiKeyAuth:
            process.env.SODACARDS_API_KEY });


            const orders = await sodacards.listOrders();
        - lang: go
          label: Go
          source: >
            client := sodacards.NewAPIClient(sodacards.NewConfiguration())

            auth := context.WithValue(context.Background(),
            sodacards.ContextAPIKeys,
                map[string]sodacards.APIKey{"ApiKeyAuth": {Key: os.Getenv("SODACARDS_API_KEY")}})

            orders, _, err := client.DefaultAPI.ListOrders(auth).Execute()
        - lang: php
          label: PHP
          source: >
            $config = Sodacards\Configuration::getDefaultConfiguration()
                ->setApiKey('X-API-Key', getenv('SODACARDS_API_KEY'));
            $client = new Sodacards\Api\DefaultApi(new GuzzleHttp\Client(),
            $config);


            $orders = $client->listOrders();
components:
  schemas:
    sodacards.devpublic.v1.ListOrdersResponse:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/sodacards.devpublic.v1.Order'
          title: data
          description: data is the page of orders, newest first.
        hasMore:
          type: boolean
          title: has_more
          description: has_more is true when another page follows this one.
        nextCursor:
          type: string
          title: next_cursor
          description: next_cursor fetches the next page. Empty on the last page.
      title: ListOrdersResponse
      additionalProperties: false
    sodacards.devpublic.v1.Order:
      type: object
      properties:
        id:
          type: string
          title: id
          description: id identifies the order.
        status:
          type: string
          title: status
          description: >-
            status is the order's current state: "pending", "processing",
            "completed",
             "failed" or "refunded".
        total:
          $ref: '#/components/schemas/sodacards.devpublic.v1.Money'
          title: total
          description: total is the amount charged for the order, in FCFA.
        createdAt:
          type: string
          title: created_at
          description: created_at is when the order was placed (RFC 3339).
        reference:
          type: string
          title: reference
          description: reference is the identifier you attached at creation, empty if none.
        lines:
          type: array
          items:
            $ref: '#/components/schemas/sodacards.devpublic.v1.OrderItem'
          title: lines
          description: lines are the ordered products.
      title: Order
      additionalProperties: false
      description: >-
        Order is a placed order with its lines and current status. It never
        carries the
         supplier cost.
    sodacards.devpublic.v1.Money:
      type: object
      properties:
        amount:
          type:
            - integer
            - string
          title: amount
          format: int64
          description: amount is the value in the currency's minor units.
        currency:
          type: string
          title: currency
          description: currency is the ISO-4217 code, e.g. "XOF".
      title: Money
      additionalProperties: false
      description: >-
        Money is an amount in the currency's minor units together with its
        ISO-4217
         code. XOF (the West-African CFA franc) has no minor unit, so for XOF amount is
         the whole franc value.
    sodacards.devpublic.v1.OrderItem:
      type: object
      properties:
        productId:
          type: string
          title: product_id
          description: product_id is the product ordered on this line.
        name:
          type: string
          title: name
          description: name is the product name at order time.
        unitPrice:
          $ref: '#/components/schemas/sodacards.devpublic.v1.Money'
          title: unit_price
          description: unit_price is the price of one unit, in FCFA.
        quantity:
          type: integer
          title: quantity
          format: int32
          description: quantity is how many units were ordered.
        lineTotal:
          $ref: '#/components/schemas/sodacards.devpublic.v1.Money'
          title: line_total
          description: line_total is unit_price times quantity, in FCFA.
        inputFields:
          type: object
          title: input_fields
          additionalProperties:
            type: string
            title: value
          description: input_fields are the purchase-form values submitted for this line.
      title: OrderItem
      additionalProperties: false
      description: OrderItem is one line of an order.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      description: Your API key, prefixed sc_live_ or sc_test_.
      name: X-API-Key
      in: header

````