Getnet DocsGetnet Docs

Obter token de acesso

POST/authentication/oauth2/-core/access_token

Obtains an OAuth 2.0 access token via the Client Credentials flow. The returned token must be included as Authorization: Bearer {token} in all subsequent requests.

URLs do Token por ambiente:

AmbienteURL
SBXhttps://api-sbx.pre.globalgetnet.com/authentication/oauth2/-core/access_token
UAThttps://api.pre.globalgetnet.com/authentication/oauth2/-core/access_token
PRODhttps://api.globalgetnet.com/authentication/oauth2/-core/access_token

Escopo: digital-plataform:gateway-api — Acesso completo (leitura/escrita) à Payment Link API.

Body application/x-www-form-urlencoded

grant_type"client_credentials"required

OAuth 2.0 grant type

client_idstringrequired

Client identifier

client_secretstringrequired

Client secret

scopestringrequired

API access scope

Response

Token obtained successfully

access_tokenstring

JWT access token

token_typestring

Token type

expires_ininteger

Expiration time in seconds

scopestring

Granted scope

Invalid request

error_codestring
messagestring
status_codeinteger

Invalid credentials

error_codestring
messagestring
status_codeinteger
Request
curl -X POST "https://api-sbx.pre.globalgetnet.com/dpy/payment-link/v1/authentication/oauth2/-core/access_token" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d '{
  "grant_type": "client_credentials",
  "client_id": "seu-client-id",
  "client_secret": "seu-client-secret",
  "scope": "digital-plataform:gateway-api"
}'
Response
{
  "access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...",
  "token_type": "Bearer",
  "expires_in": 3600,
  "scope": "digital-plataform:gateway-api"
}