Getnet DocsGetnet Docs

Authentication Token

POST/authentication/oauth2/access_token

__Authentication__<br><br>All transactions are authenticated using a Bearer token generated through the OAuth 2.0 protocol. To obtain a token, clients must send a request to the authentication endpoint using their `client_id` and `client_secret` (click <a href='https://docs.globalgetnet.com/es/articles/api-keys'>here</a> to see how to generate your credentials). To authenticate this request, you must pass the Base64-encoded string of `client_id:client_secret` in the `Authorization` header. The generated access token must be included in the `Authorization` header of each API request, ensuring secure and controlled access to the API.<br><br>__Usage__<br><br>Once the token is obtained, include it in the Authorization header of your API requests as follows:<br>`Authorization: Bearer {access_token}`<br><br>__Token Expiration & Renewal__<br>- The token is valid for the duration specified in `expires_in` (usually 3599 seconds or ~1 hour).<br>- When the token expires, you must request a new one using the same authentication process.<br><br>v20250823.0859

Header Parameters

Authorizationstringrequired

The Basic Auth header containing client_id:client_secret encoded in Base64.

Body application/x-www-form-urlencoded

grant_type"client_credentials"required

The OAuth 2.0 grant type.

Response

Access token generated successfully.

access_tokenstring

The Bearer Token to be used in the Authorization header.

scopestring

The granted scope(s) for the token.

token_typestring

Indicates the token type, which is always "Bearer".

expires_ininteger<int32>

The token's lifetime in seconds (e.g., 3599).

Invalid credentials

error_descriptionstring
errorstring
Request
curl -X POST "https://api.pre.globalgetnet.com/authentication/oauth2/access_token" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -H "Authorization: <Authorization>" \
  -d '{
  "grant_type": "client_credentials"
}'
Response
{
  "access_token": "ZmVhLTQwMjctNGQxNS1iNWQwLTFjOWYwMmIzMGE3ZC00MjQ0NSIsInN1Ym5hbWUiOiJzYnhfOWYzNDNlYzMtNzM2Mi00ZjZiLTk3ZTItMjNjYWIyMDUzYjc0IiwiaXNzIjoiaHR0cHM6Ly9hcGkucHJlLmdsb2JhbGdldG5ldC5jb20vb2F1dGgyL3NhbmRib3giLCJ0b2tlbk5hbWUiOiJhY2Nlc3NfdG9rZW4iLCJ0b2tlbl90eXBlIjoiQmVhcmVyIiwiYXV0aEdyYW50SWQ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