Skip to main content
POST
/
v1
/
auth
/
token
Obter token de acesso
curl --request POST \
  --url https://api-payment.safefypay.com.br/v1/auth/token \
  --header 'Content-Type: application/json' \
  --data '
{
  "publicKey": "pk_sandbox_abc123def456",
  "secretKey": "sk_sandbox_xyz789ghi012"
}
'
{
  "data": {
    "accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
    "tokenType": "Bearer",
    "expiresIn": 3600,
    "environment": "Sandbox"
  },
  "message": null,
  "error": null
}
Use this endpoint to obtain the JWT accessToken to authenticate all other requests.
This endpoint has a limit of 10 token generations per hour per credential. If exceeded, the API returns 429 with code auth_rate_limit_exceeded.
The returned environment (Sandbox or Production) is determined automatically by the credentials used.

Body

application/json
publicKey
string
required

Chave publica da credencial (pk_...)

Example:

"pk_sandbox_abc123def456"

secretKey
string
required

Chave secreta da credencial (sk_...)

Example:

"sk_sandbox_xyz789ghi012"

grantType
string
default:client_credentials

Tipo de autenticacao

Example:

"client_credentials"

Response

Token gerado com sucesso

data
object
message
string | null
error
object