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

# Get Auth Token

> Use this API to authenticate with the Cashfree system and obtain the authorization bearer token.

Based on who you are, consider the below values in the API requests

<Note>
  | Cashfree Merchant | Cashfree Partner     |
  | :---------------- | :------------------- |
  | x-client-id       | x-partner-api-key    |
  | x-client-secret   | x-partner-merchantid |
</Note>


## OpenAPI

````yaml post /gc/authorize
openapi: 3.0.3
info:
  title: Global Collections - Partners
  version: '4'
servers:
  - url: https://sandbox.cashfree.com/
    description: Sandbox server
  - url: https://api.cashfree.com/
    description: Production server
security: []
paths:
  /gc/authorize:
    post:
      summary: Get Token
      description: >-
        Use this API to authenticate with the Cashfree system and obtain the
        authorization bearer token.
      operationId: global-collections-get-token
      parameters:
        - $ref: '#/components/parameters/PartnerApiKey'
        - $ref: '#/components/parameters/PartnerMerchantId'
        - $ref: '#/components/parameters/ApiVersion'
      responses:
        '200':
          description: Success response for generating token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TokenResponse'
        '403':
          description: Authentication failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  parameters:
    PartnerApiKey:
      name: x-partner-api-key
      in: header
      description: Enter partner API keygit
      required: true
      schema:
        type: string
    PartnerMerchantId:
      name: x-partner-merchantid
      in: header
      description: >-
        Enter the merchant reference id used while creating merchant during
        onboarding
      required: true
      schema:
        type: string
    ApiVersion:
      name: x-api-version
      in: header
      description: API version
      required: true
      schema:
        type: string
  schemas:
    TokenResponse:
      allOf:
        - $ref: '#/components/schemas/SuccessResponse'
        - type: object
          properties:
            data:
              type: object
              properties:
                token:
                  type: string
                  example: eyJhbGciOiJIUzM4NCIsInR5cCI6IkpXVCJ9...
                expiry:
                  type: integer
                  example: 1697611541
    ErrorResponse:
      type: object
      properties:
        type:
          type: string
          example: authentication_error
        message:
          type: string
          example: failed to authenticate
        code:
          type: string
          example: authentication_failed
    SuccessResponse:
      type: object
      properties:
        status:
          type: string
          example: SUCCESS
        subCode:
          type: string
          example: '200'
        message:
          type: string
          example: success_message

````