Access Token

Get a token for our APIs.

Getting Started

First of all you need to request a token to authenticate and use our services. You can execute the request below with your credentials to get the token.

Accsess Token

POST https://api.stage.localpayment.com/api/token/

This request allows you to obtain an authentication token.

Request Body

NameTypeDescription

username

string

Username Account provided by Localpayment.

password

string

Password Account provided by Localpayment.

{
    "refresh": "example refresh token",
    "access": "example access"
}

Example: Token request

curl --location --request POST 'https://api.stage.localpayment.com
/api/token/' \
--header 'x-version: LPV3' \
--header 'x-forwarded-for: 1' \
--header 'Content-Type: application/json' \
--data-raw '{
    "username": "USERNAME_PROVIDED_BY_LOCALPAYMENT",
    "password": "PASSWORD_PROVIDED_BY_LOCALPAYMENT"
}'

Example: Token response

{
    "refresh": "example refresh token",
    "access": "example access token"
}

Every AccessToken will have a 5 minutes duration.

How to use a Refresh Token

When the access token expires, you can use the following service to get a new access token

Refresh

POST https://api.stage.localpayment.com/api/token/refresh

This requests allows you to get a new access token.

Request Body

NameTypeDescription

refresh

string

A JWT refresh token which you got in the previous step.

{
    "refresh": "example refresh token",
    "access": "example access"
}

Example: Refresh Token request

curl --location --request POST 'https://api.stage.localpayment.com
/api/token/refresh/' \
--header 'x-version: LPV3' \
--header 'Content-Type: application/json' \
--data-raw '{
    "refresh": "REFRESH_TOKEN_OBTAINED_PREVIOUS_STEP"
}'

Every RefreshToken will have a 24 hours duration.

Last updated