Documentation V3
Ask or search…
K
Comment on page

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.
post
https://api.stage.localpayment.com
/api/token/
Accsess Token

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
post
https://api.stage.localpayment.com
/api/token/refresh
Refresh

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.