Fetch OIDC access token
POST
/v2/connect/token
curl --request POST \ --url https://oidc.sandbox.ztlpay-test.io/v2/connect/token \ --header 'content-type: application/x-www-form-urlencoded' \ --data-urlencode 'client_id=YOUR_CLIENT_ID' \ --data-urlencode 'client_secret=YOUR_CLIENT_SECRET' \ --data-urlencode 'grant_type=client_credentials' \ --data-urlencode 'scope=api://ac0d1aea-5e3a-463f-9dd1-194898ee5820/.default'curl --request POST \ --url https://oidc.ztlpay.io/v2/connect/token \ --header 'content-type: application/x-www-form-urlencoded' \ --data-urlencode 'client_id=YOUR_CLIENT_ID' \ --data-urlencode 'client_secret=YOUR_CLIENT_SECRET' \ --data-urlencode 'grant_type=client_credentials' \ --data-urlencode 'scope=api://1f115cad-5576-4db9-a7f9-8921c47a86e4/.default'Use this endpoint for sandbox and production.
Request Body
Section titled “Request Body”Media typeapplication/x-www-form-urlencoded
object
client_id
required
Client ID provided by ZTL.
string
client_secret
required
Client secret provided by ZTL.
string
grant_type
required
Must be client_credentials.
string
scope
required
Use the scope for the target environment:
- Sandbox:
api://ac0d1aea-5e3a-463f-9dd1-194898ee5820/.default - Production:
api://1f115cad-5576-4db9-a7f9-8921c47a86e4/.default
string
Examplegenerated
client_id=example&client_secret=example&grant_type=example&scope=exampleResponses
Section titled “Responses”Access token
Media typeapplication/json
object
token_type
Token type.
string
expires_in
Lifetime in seconds of the access token.
integer
ext_expires_in
Extended lifetime in seconds of the access token.
integer
access_token
Access token.
string
Example
{ "token_type": "Bearer", "expires_in": 3599, "ext_expires_in": 3599, "access_token": "jwt"}Client authentication failed.
Media typeapplication/json
object
Examplegenerated
{}