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

# List a customer's redemptions

> The coupons a customer redeemed, and where each one is.

Lists every coupon the customer redeemed, newest first: through the API, on attach, or typed in Checkout. `status` is `pending`, `queued`, `active`, `ended` (with `endedReason`: `duration`, `subscription_ended` or `removed`) or `void` (never applied, such as an abandoned Checkout, whose use was given back). [Get a customer](https://docs.integrateledger.com/api-reference/customers/get.md) lists the live ones as `discounts`. Needs the **Customers** permission at Read.


## OpenAPI

````yaml openapi.json GET /v1/customers/redemptions
openapi: 3.1.0
info:
  title: Ledger API
  version: 0.1.0
servers:
  - url: https://api.integrateledger.com
    description: Hosted Ledger API
security: []
paths:
  /v1/customers/redemptions:
    get:
      tags:
        - Customers
      summary: List a customer's redemptions
      operationId: listRedemptions
      parameters:
        - schema:
            type: string
            minLength: 1
            maxLength: 255
            description: Your ID for the customer.
          required: true
          description: Your ID for the customer.
          name: customerId
          in: query
      responses:
        '200':
          description: The customer's redemptions, newest first.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RedemptionList'
        '401':
          description: Invalid Ledger API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RewardError'
        '403':
          $ref: '#/components/responses/InsufficientPermissions'
        '404':
          description: No such customer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RewardError'
        '429':
          $ref: '#/components/responses/RateLimited'
      security:
        - ApiKey: []
      x-codeSamples:
        - lang: python
          label: Python SDK
          source: |-
            import os
            from integrateledger import ledger

            client = ledger(api_key=os.environ["LEDGER_API_KEY"])
            client.list_redemptions(customer_id="user_123")
        - lang: bash
          label: cURL
          source: >-
            curl --request GET
            'https://api.integrateledger.com/v1/customers/redemptions?customerId=user_123'
            \
              -H "Authorization: Bearer $LEDGER_API_KEY"
        - lang: typescript
          label: TypeScript SDK
          source: >-
            import ledger from "integrateledger";


            const client = new ledger({ apiKey: process.env.LEDGER_API_KEY ?? ""
            });

            await client.listRedemptions({ customerId: "user_123" });
components:
  schemas:
    RedemptionList:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/Redemption'
      required:
        - items
    RewardError:
      type: object
      properties:
        error:
          type: string
        message:
          type: string
          description: >-
            What went wrong and what to do about it, for a person or an agent to
            read. Every Ledger error has one. The wording can change: branch on
            `error`, not on this text.
          example: >-
            No customer "user_123" exists in this environment. Create it with
            POST /v1/customers, or check that the API key is for the right
            environment.
        issues:
          type: array
          items:
            type: object
            properties:
              path:
                type: string
              message:
                type: string
            required:
              - path
              - message
          description: >-
            With `invalid_request`: each field that failed validation and why.
            `path` is empty for the body itself, such as an unknown field.
      required:
        - error
    Redemption:
      type: object
      properties:
        redemptionId:
          type: integer
        rewardId:
          type: string
        kind:
          type: string
          enum:
            - coupon
            - grant
        code:
          type:
            - string
            - 'null'
        status:
          type: string
          enum:
            - pending
            - queued
            - active
            - ended
            - void
          description: >-
            pending: waiting for a bill (the customer's next attach of a covered
            plan, or Ledger putting it on their current one). queued: their bill
            already has a Ledger discount; it starts when that one ends. active:
            on the bill, or a grant's credits and units granted. ended: used up,
            or the bill ended. void: never applied, such as an abandoned
            Checkout; its use was given back.
        appliesFrom:
          type:
            - string
            - 'null'
          enum:
            - next_invoice
            - next_attach
            - null
          description: >-
            While pending or queued: the customer's next invoice on their
            current plan, or their next attach of a plan the coupon covers.
        subscriptionId:
          type:
            - integer
            - 'null'
        discount:
          type:
            - object
            - 'null'
          properties:
            percentOff:
              type:
                - number
                - 'null'
            amountOffCents:
              type:
                - integer
                - 'null'
            currency:
              type:
                - string
                - 'null'
            duration:
              type: string
              enum:
                - once
                - repeating
                - forever
            durationMonths:
              type:
                - integer
                - 'null'
          required:
            - percentOff
            - amountOffCents
            - currency
            - duration
            - durationMonths
          description: A coupon's terms. Null for a grant.
        grants:
          type:
            - array
            - 'null'
          items:
            $ref: '#/components/schemas/RedemptionGrant'
          description: >-
            What a grant gave the customer, each with when it expires. Null for
            a coupon.
        endsAt:
          type:
            - string
            - 'null'
        endedReason:
          type:
            - string
            - 'null'
          enum:
            - duration
            - subscription_ended
            - removed
            - null
        createdAt:
          type: string
      required:
        - redemptionId
        - rewardId
        - kind
        - code
        - status
        - appliesFrom
        - subscriptionId
        - discount
        - grants
        - endsAt
        - endedReason
        - createdAt
    InsufficientPermissionsError:
      type: object
      properties:
        error:
          type: string
          example: insufficient_permissions
        message:
          type: string
          description: >-
            What went wrong and what to do about it, for a person or an agent to
            read. Every Ledger error has one. The wording can change: branch on
            `error`, not on this text.
          example: >-
            No customer "user_123" exists in this environment. Create it with
            POST /v1/customers, or check that the API key is for the right
            environment.
        requiredScope:
          type: string
          example: customers:read
      required:
        - error
        - requiredScope
    RateLimitError:
      type: object
      properties:
        error:
          type: string
          example: rate_limited
        message:
          type: string
          description: >-
            What went wrong and what to do about it, for a person or an agent to
            read. Every Ledger error has one. The wording can change: branch on
            `error`, not on this text.
          example: >-
            No customer "user_123" exists in this environment. Create it with
            POST /v1/customers, or check that the API key is for the right
            environment.
      required:
        - error
    RedemptionGrant:
      type: object
      properties:
        featureId:
          type: string
          description: '`credits` for the credit pool, or the metered feature''s ID.'
        amount:
          type: integer
        expiresAt:
          type:
            - string
            - 'null'
      required:
        - featureId
        - amount
        - expiresAt
  responses:
    InsufficientPermissions:
      description: >-
        The API key works but lacks the permission this endpoint needs, named in
        requiredScope. See the API keys guide.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/InsufficientPermissionsError'
    RateLimited:
      description: >-
        Too many requests. Wait Retry-After seconds, then retry. See the rate
        limits guide.
      headers:
        Retry-After:
          description: Seconds until a request is allowed again
          schema:
            type: integer
        RateLimit-Limit:
          description: 'The burst: requests allowed at once'
          schema:
            type: integer
        RateLimit-Remaining:
          description: Requests left right now
          schema:
            type: integer
        RateLimit-Reset:
          description: Seconds until the full burst is back
          schema:
            type: integer
        RateLimit-Policy:
          description: >-
            The sustained rate per second and the burst, such as
            200;w=1;burst=1000
          schema:
            type: string
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/RateLimitError'
  securitySchemes:
    ApiKey:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.