# Get a customer token

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /v1/programs/{programId}/customers/token:
    get:
      summary: Get a customer token
      deprecated: false
      description: >-
        Generate a temporary JWT token for a customer. The token type determines
        its purpose and permissions.


        ## Token Types


        | Type | Purpose | Default Expiration | Requirements |

        |------|---------|-------------------|--------------|

        | `auth` | Customer App session and API calls as the customer | 7 days |
        Customer must have at least one pass |

        | `download` | Wallet pass download link (Apple Wallet / Google Wallet)
        | Validated against OneTimeLink | Customer must have a generated
        OneTimeLink |


        You can customize the expiration with the `expires_in` parameter.


        ## Building URLs with the Token


        Encode the returned `accessToken` in Base64 to build customer-facing
        URLs:


        | Link Type | URL Format |

        |-----------|-----------|

        | Download | `https://jeri.link/{slug}/download?token={base64Token}` |

        | Session | `https://jeri.link/{slug}/{base64Token}?redirectTo={path}` |


        ### Available `redirectTo` paths for session URLs


        | Path | Section |

        |------|---------|

        | `profile` | Customer profile |

        | `loyalty/rewards` | Available rewards |

        | `loyalty/earning-flows` | Ways to earn points |

        | `referrals` | Referral program |

        | `coupons` | Customer coupons |

        | `transactions` | Transaction history |


        ## Using the auth token as API session


        The `auth` token can be used as a Bearer token to make API calls on
        behalf of the customer:

        ```

        Authorization: Bearer {accessToken}

        ```


        > **Note:** Download URLs are automatically synced to Shopify metafields
        (`jericommerce.download-wallet-pass-url`) and Klaviyo profiles
        (`jericommerce_download_wallet_pass_url`).


        For a step-by-step guide, see [Customer Tokens: Wallet Pass Downloads &
        App Session
        Links](https://www.jericommerce.com/guides/api-download-wallet-pass-links).
      operationId: CustomerActionsController_getCustomerToken_v1
      tags:
        - Customers
        - Customer Actions
      parameters:
        - name: programId
          in: path
          description: ''
          required: true
          example: '{{slug-or-program-id}}'
          schema:
            type: string
        - name: email
          in: query
          description: ''
          required: true
          schema:
            type: string
        - name: token_type
          in: query
          description: ''
          required: true
          schema:
            enum:
              - auth
              - download
              - pass
              - verify
            type: string
        - name: expires_in
          in: query
          description: >-
            expressed in seconds or a string describing a time span zeit/ms. Eg:
            60, '2 days', '10h', '7d'
          required: false
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccessToken'
          headers: {}
          x-apidog-name: ''
      security:
        - api-key: []
          x-apidog:
            schemeGroups:
              - id: AGB5ELW6L11_7R2ieeV7_
                schemeIds:
                  - api-key
            required: true
            use:
              id: AGB5ELW6L11_7R2ieeV7_
            scopes:
              AGB5ELW6L11_7R2ieeV7_:
                api-key: []
      x-apidog-folder: Customers
      x-apidog-status: released
      x-run-in-apidog: https://app.apidog.com/web/project/1139723/apis/api-27470721-run
components:
  schemas:
    AccessToken:
      type: object
      properties:
        accessToken:
          type: string
      required:
        - accessToken
      x-apidog-orders:
        - accessToken
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
  securitySchemes:
    bearer:
      scheme: bearer
      bearerFormat: JWT
      type: jwt
    api-key:
      type: apikey
      in: header
      name: api-key
servers:
  - url: https://api.jericommerce.com
    description: Entorno producción
  - url: ''
    description: Mock Nube
security: []

```
