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

# List Promotion Codes

> This endpoint lists all promotion codes.

## Base URL `https://api.tolt.com`

<br />

### Query Parameters

<ParamField body="program_id*" type="string">
  The program ID from where you want to list the partners.
</ParamField>

<ParamField body="partner_id" type="string - optional">
  Only return promotion codes from this partner
</ParamField>

<ParamField body="search" type="string - optional">
  Search promotion codes by code value.
</ParamField>

<ParamField body="order" type="asc | desc - optional">
  The order of the promotion codes to return by created\_at. Default is desc
</ParamField>

<ParamField body="expand" type="array - optional">
  Specify which related objects to include in the response. Valid values are
  **'partner'** and **'program'**. Use **expand\[]=partner** or
  **expand\[]=program** to include the related objects.
</ParamField>

<ParamField body="created_gte" type="string - optional">
  Only return promotion codes created after this date
</ParamField>

<ParamField body="created_lte" type="string - optional">
  Only return promotion codes created before this date
</ParamField>

<ParamField body="limit" type="string - optional">
  A limit on the number of promotion codes to return. Default is 10, max is 100
</ParamField>

<ParamField body="starting_after" type="string - optional">
  A cursor for use in pagination. starting\_after is an object ID that defines
  your place in the list
</ParamField>

<ParamField body="ending_before" type="string - optional">
  A cursor for use in pagination. ending\_before is an object ID that defines
  your place in the list
</ParamField>

### Response

<ResponseField name="success" type="boolean">
  Whether the request was successful
</ResponseField>

<ResponseField name="has_more" type="boolean">
  Whether there are more pages of results available
</ResponseField>

<ResponseField name="total_count" type="integer">
  Total number of promotion codes matching the query
</ResponseField>

<ResponseField name="data" type="array[Object]">
  <Expandable title="properties" defaultOpen={false}>
    <ResponseField name="id" type="string">
      Unique identifier for the promotion code
    </ResponseField>

    <ResponseField name="code" type="string">
      The promotion code value
    </ResponseField>

    <ResponseField name="type" type="string">
      The type of discount
    </ResponseField>

    <ResponseField name="value" type="number">
      The discount value
    </ResponseField>

    <ResponseField name="partner_id" type="string">
      ID of the partner who owns the code
    </ResponseField>

    <ResponseField name="created_at" type="string">
      ISO 8601 timestamp of creation
    </ResponseField>

    <ResponseField name="updated_at" type="string">
      ISO 8601 timestamp of last update
    </ResponseField>

    <ResponseField name="program_id" type="string">
      Program ID the promotion code belongs to
    </ResponseField>

    <ResponseField name="organization_id" type="string">
      Organization ID
    </ResponseField>
  </Expandable>
</ResponseField>

<RequestExample>
  ```bash cURL theme={"system"}
  curl -X GET 'https://api.tolt.com/v1/promotion-codes' \
  -H 'Authorization: Bearer <API_KEY>'
  ```

  ```bash With Expand theme={"system"}
  curl -X GET 'https://api.tolt.com/v1/promotion-codes?expand[]=partner&expand[]=program' \
  -H 'Authorization: Bearer <API_KEY>'
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={"system"}
  {
    "success": true,
    "has_more": true,
    "total_count": 45,
    "data": [
      {
        "id": "prc_dK9bzRGn46BhVgNFHD6fDgXW",
        "code": "SUMMER2024",
        "type": "percentage",
        "value": 20,
        "partner_id": "part_s7mbzRGn46BhVgNFHD6fDgXW",
        "created_at": "2025-01-15T14:30:00.000Z",
        "updated_at": "2025-01-15T14:30:00.000Z",
        "program_id": "prg_YRsbPDAKhWfdqJbFACheh",
        "organization_id": "org_JE3mfYNL9ci7sFaJazAv2"
      }
    ]
  }
  ```

  ```json Expand Response theme={"system"}
  {
    "success": true,
    "has_more": true,
    "total_count": 45,
    "data": [
      {
        "id": "prc_dK9bzRGn46BhVgNFHD6fDgXW",
        "code": "SUMMER2024",
        "type": "percentage",
        "value": 20,
        "partner_id": "part_s7mbzRGn46BhVgNFHD6fDgXW",
        "created_at": "2025-01-15T14:30:00.000Z",
        "updated_at": "2025-01-15T14:30:00.000Z",
        "program_id": "prg_YRsbPDAKhWfdqJbFACheh",
        "organization_id": "org_JE3mfYNL9ci7sFaJazAv2",
        "partner": {
          "id": "part_s7mbzRGn46BhVgNFHD6fDgXW",
          "first_name": "Michael",
          "last_name": "Scott",
          "email": "michael.scott@dundermifflin.com",
          "company_name": "Dunder Mifflin",
          "status": "active",
          "created_at": "2025-01-13T10:06:11.251Z"
        },
        "program": {
          "id": "prg_YRsbPDAKhWfdqJbFACheh",
          "status": "active",
          "name": "Tolt's Partnership Program",
          "product_name": "Tolt",
          "subdomain": "affiliates",
          "type": "public",
          "currency_code": "USD",
          "created_at": "2024-03-05T10:28:08.984+00:00"
        }
      }
    ]
  }
  ```
</ResponseExample>
