**Version: 202607**

# Get member discount codes

**GET** `/openapi/2026-07/loyalty/members/:member_id/discount-codes`

Return discount codes owned by a specific member

## Request

**Path Parameters**

- `member_id` string (required)

  Member ID from path

**Query Parameters**

- `cursor` string

  Pagination cursor
- `limit` int32

  Page size. Default 50, max 200

## Responses

**200**

OK

**application/json**

**Schema | Example**

**Schema**

- `code` string

  error code
- `message` string

  error message
- `data` object

  - `items` object[]

    Discount code assets

    *   Array \[

    - `discount_code` string

      Discount code string
    - `used_times` int64

      Used times. optional so 0 is always emitted
    - `available_times` int64

      Available times
    - `source_type` string

      Source type: points\_redeem, birthday\_reward, benefit\_package, or member\_active\_reward
    - `source_id` string

      Source ID. Campaign ID when source\_type is points\_redeem
    - `discount_code_activity` object

      Discount code activity payload

      - `name` string

        Campaign name
      - `discount_type` string

        Discount type: percentage / fixed\_amount / free\_shipping / bxgy
      - `discount_value` string

        Discount value; percentage carries a numeric string (e.g. "10"); fixed\_amount carries an amount string (e.g. "10.00"); free\_shipping / bxgy leave it empty
      - `prerequisite_type` string

        Prerequisite condition type: none / subtotal / quantity
      - `prerequisite_value` string

        Prerequisite condition value; amount string when subtotal, quantity when quantity
      - `max_free_shipping` string

        Max free-shipping amount (free-shipping only); -1 means unlimited. String preserves decimals
      - `applicable_rule` object

        Applicable resource rule

        - `applicable_type` string

          Applicable type: all / include\_products / include\_collections
        - `applicable_product_ids` string[]

          Product IDs when applicable\_type=include\_products
        - `applicable_variant_ids` string[]

          Variant IDs when applicable\_type=include\_products
        - `applicable_collection_ids` string[]

          Collection IDs when applicable\_type=include\_collections
      - `obtain_products` object

        Obtain products rule (BXGY only)

        - `applicable_rule` object

          Applicable rule for obtainable products

          - `applicable_type` string

            Applicable type: all / include\_products / include\_collections
          - `applicable_product_ids` string[]

            Product IDs when applicable\_type=include\_products
          - `applicable_variant_ids` string[]

            Variant IDs when applicable\_type=include\_products
          - `applicable_collection_ids` string[]

            Collection IDs when applicable\_type=include\_collections
        - `product_count` uint32

          Obtain product count
        - `obtain_type` string

          Obtain discount type: free / percentage / fixed\_amount
        - `obtain_value` string

          Obtain discount value; decimal string
      - `use_with_other` boolean

        Allow stacking with other discounts
      - `limit_user_discount` int32

        Per-member campaign usage cap; -1 means unlimited
      - `limit_code_user_discount` int32

        Per-member per-code usage cap; -1 means unlimited
      - `limit_order_discount` int32

        Per-order usage cap; -1 means unlimited
      - `limit_code_max_discount` int32

        Per-code total usage cap; -1 means unlimited
      - `started_at` string

        Campaign start time; ISO 8601 UTC
      - `ended_at` string

        Campaign end time; ISO 8601 UTC. Empty string means open-ended
    *   \]
  - `next_cursor` string

    Next-page cursor
  - `has_more` boolean

    Whether more pages exist
  - `limit` int32

    Returned page size

```json
{
  "code": "string",
  "message": "string",
  "data": {
    "items": [
      {
        "discount_code": "string",
        "used_times": 0,
        "available_times": 0,
        "source_type": "string",
        "source_id": "string",
        "discount_code_activity": {
          "name": "string",
          "discount_type": "string",
          "discount_value": "string",
          "prerequisite_type": "string",
          "prerequisite_value": "string",
          "max_free_shipping": "string",
          "applicable_rule": {
            "applicable_type": "string",
            "applicable_product_ids": [
              "string"
            ],
            "applicable_variant_ids": [
              "string"
            ],
            "applicable_collection_ids": [
              "string"
            ]
          },
          "obtain_products": {
            "applicable_rule": {
              "applicable_type": "string",
              "applicable_product_ids": [
                "string"
              ],
              "applicable_variant_ids": [
                "string"
              ],
              "applicable_collection_ids": [
                "string"
              ]
            },
            "product_count": 0,
            "obtain_type": "string",
            "obtain_value": "string"
          },
          "use_with_other": true,
          "limit_user_discount": 0,
          "limit_code_user_discount": 0,
          "limit_order_discount": 0,
          "limit_code_max_discount": 0,
          "started_at": "string",
          "ended_at": "string"
        }
      }
    ],
    "next_cursor": "string",
    "has_more": true,
    "limit": 0
  }
}
```
