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

# Refresh Access Token

Access tokens are valid for 60 minutes. Use this endpoint with a valid refresh token to get a new access token without sending your credentials again.

> **Refresh token expiration**
>
> Refresh tokens expire after 120 minutes. After this period, request a new token with [Get Access Token](https://docs.localpayment.com/reference/get-token.md) using your username and password.

> **Token rotation**
>
> Each successful refresh returns a new `access` and `refresh` pair, and the refresh token you sent stops working. Store both new tokens and use the new refresh token next time.
>
> A new request to [Get Access Token](https://docs.localpayment.com/reference/get-token.md) also invalidates the refresh tokens issued before it for the same user and integration (same `User-Agent`).

> **401 Invalid or expired token**
>
> This response means the refresh token expired or was already invalidated. Don't retry the same refresh token. Request a new token with [Get Access Token](https://docs.localpayment.com/reference/get-token.md).


## OpenAPI

````yaml openapi/localpayment.json POST /api/token/refresh/
openapi: 3.1.0
info:
  version: '1.0'
  title: Localpayment
  contact:
    name: Support
    url: mailto:support@localpayment.com
servers:
  - url: https://api.stage.localpayment.com
    description: Stage
security:
  - token: []
paths:
  /api/token/refresh/:
    post:
      summary: Refresh Access Token
      operationId: refresh-token
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                refresh:
                  type: string
                  description: >-
                    Refresh token obtained from the `refresh` property in the
                    response of the [Get Access Token](/reference/get-token) or
                    [Refresh Access Token](/reference/refresh-token) endpoints.
              required:
                - refresh
              x-examples:
                Example 1:
                  refresh: '{{refresh}}'
            examples:
              200 - Refresh token:
                value:
                  refresh: >-
                    eyJ0eXAiOiJKV1QiLCJhbGccM5kYO7o4iOiJIU18jaiJ9.eyJ0b2tlbl90eXBlIjoicmVmcmVzaCIsImV4cCI6MTczNTMxOTkyOSwianRpIjoiZWUxMDE3MTUwY2JhNGM1NTg0MjYyZmRkZTdiOThiNGQiLCJ1c2VyX2lkIjoxMDAwLCJzdXBlcnVzZXIiOnRydWUsImlzX3N0YWZmIjp0cnVlLCJybaCIsImV4cCI62xlcyI6WyJBTEwiXSwiY291bnRyaWVzIjpbIkFMTCJdLCJjb21wYW55IjoiQUxMIiwiY2xpZW50X2NvZGUiOiJBNzaW9uTEwiLCJwZXJtaXcyI6W119.6siymomkQ72yMvHGU9sMCO4h-cxpNgQXor
              '':
                value:
                  refresh: string
              500 - Server error.:
                value: {}
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  refresh:
                    type: string
                    description: Refresh token used to obtain a new access token.
                  access:
                    type: string
                    description: >-
                      Access token used to authenticate requests to Localpayment
                      services. 
                required:
                  - refresh
                  - access
                x-examples:
                  Example 1:
                    refresh: >-
                      eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoicmVmcmVzaCIsImV4cCI6MTczNTMyMTI5NSwianRpIjoiOGZhNmE4MTQyYmQ0NGNjNDhkNTFkOTJjY2I3NTVhZDgiLCJ1c2VyX2lkIjoxMDAwLCJzdXBlcnVzZXIiOnRydWUsImlzX3N0YWZmIjp0cnVlLCJvdHAiOjExMTExMSwicm9sZXMiOlsiQUxMIl0sImNvdW50cmllcyI6WyJBTEwiXSwiY29tcGFueSI6IkFMTCIsImNsaWVudF9jb2RlIjoiQUxMIiwicGVybWlzc2lvbnMiOltdfQ.hMDLZYfR7aMYrFOz3y3LyHnoNldTd38VY-jsqqvsv70
                    access: >-
                      eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNzM1MjM1MTk1LCJqdGkiOiI3MzBiYTdiMzMyMGU0NWU2ODk4ZGRjNWVlODY1YzEyNSIsInVzZXJfaWQiOjEwMDAsInN1cGVydXNlciI6dHJ1ZSwiaXNfc3RhZmYiOnRydWUsIm90cCI6MTExMTExLCJyb2xlcyI6WyJBTEwiXSwiY291bnRyaWVzIjpbIkFMTCJdLCJjb21wYW55IjoiQUxMIiwiY2xpZW50X2NvZGUiOiJBTEwiLCJwZXJtaXNzaW9ucyI6W119.peiX9q9Vw7Qm4Gq962gsST2UKs8LCE3C3VSq2vm4Bn0
              examples:
                200 - Refresh token:
                  value:
                    refresh: >-
                      eyJ0eXAiOiJKV1QiLCJhbGccM5kYO7o4iOiJIU18jaiJ9.eyJ0b2tlbl90eXBlIjoicmVmcmVzaCIsImV4cCI6MTczNTMxOTkyOSwianRpIjoiZWUxMDE3MTUwY2JhNGM1NTg0MjYyZmRkZTdiOThiNGQiLCJ1c2VyX2lkIjoxMDAwLCJzdXBlcnVzZXIiOnRydWUsImlzX3N0YWZmIjp0cnVlLCJybaCIsImV4cCI62xlcyI6WyJBTEwiXSwiY291bnRyaWVzIjpbIkFMTCJdLCJjb21wYW55IjoiQUxMIiwiY2xpZW50X2NvZGUiOiJBNzaW9uTEwiLCJwZXJtaXcyI6W119.6siymomkQ72yMvHGU9sMCO4h-cxpNgQXor
                    access: >-
                      eyJ0eXAiOiJKV1QiLCJhbeyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiGciOiJIUzI1NiJ9.ZXhwIjoxNzM1MjM1MTk1LCJqdGkiOiI3MzBiYTdiMzMyMGU0NWU2ODk4ZGRjNWVlODY1YzEyNSIsInVzZXJfaWQiOjEwMDAsdXNlciI6dHJ1ZSwiaXNfc3RInN1cGVyhZmYiOnRydWUsIm90cCI6MTExMTExLCJyb2xlcyI6WyJBTEwiXSwiY291bnRyaWVzIjpbIkGUiOiJBTEwiLCJwZXJtaXNzaW9ucMTCJdLCJjb21wYW55IjoiQUxMIiwiY2xpZW50X2NvZyI6W119.peiX9q9Vw72UKs8LCE3C3VSq2vaQm4Gq962gsSTm4Bn0
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    description: Additional response details.
                required:
                  - detail
                x-examples:
                  Example 1:
                    detail: Invalid or expired token
              examples:
                401 - Invalid or expired token:
                  value:
                    detail: Invalid or expired token
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    description: Additional response details.
                required:
                  - detail
                x-examples:
                  Example 1:
                    detail: Request was throttled. Expected available in 30 seconds.
              examples:
                429 - Too many requests.:
                  value:
                    detail: Request was throttled. Expected available in 30 seconds.
                429 - Request was throttled.:
                  value:
                    detail: Request was throttled.
        '500':
          description: Internal Server Error
          content:
            text/html:
              schema:
                type: object
              examples:
                500 - Server error.:
                  value: |-
                    <!doctype html>
                    <html lang="en">

                    <head>
                    <title>Server Error (500)</title>
                    </head>

                    <body>
                    <h1>Server Error (500)</h1>
                    <p></p>
                    </body>

                    </html>
      security: []
      servers:
        - url: https://api.stage.localpayment.com
          description: Stage
components:
  securitySchemes:
    token:
      type: http
      scheme: bearer

````

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