Generate API Access Token
POST
/api/auth/v1/tokenGenerate an API access token using client credentials. This token is required in the Authorization header for all other API calls. This API is authenticated using the client secret provided in the request body.
Header Parameters
| Field | Details |
|---|---|
Request-Timestampstringdate-time | ISO 8601 UTC timestamp of the request. Used for idempotency and audit. |
Request-IDstring | Use a global unique identifier [GUID] for the request. Constraints Minimum length: 1 characterMaximum length: 50 characters |
Request Bodyrequired
| Field | Details |
|---|---|
client_idstringrequired | Unique client identifier provided during merchant onboarding. |
client_secretstringrequired | Client secret key provided during merchant onboarding. |
grant_typestringrequired | OAuth2 grant type. |
Response
| Field | Details |
|---|---|
access_tokenstring | The access token generated by the system. Use in Authorization headers. Constraints Minimum length: 1 characterMaximum length: 8192 characters |
expires_atstringdate-time | Access token expiration timestamp in ISO 8601 format. |
Status Codes
200 | Token generated successfully. |
405 | Method not allowed. |
422 | Unprocessable entity. |
500 | An unexpected error occurred on the server. |
Request
curl --request POST \
--url https://pluraluat.v2.pinepg.in/api/auth/v1/token \
--header 'Content-Type: application/json' \
--header 'Request-ID: a1b2c3d4-e5f6-7890-abcd-ef1234567890' \
--header 'Request-Timestamp: 2024-10-01T10:30:00Z' \
--data '{
"client_id": "a17ce30e-f88e-4f81-ada1-c3b4909ed232",
"client_secret": "abcdefgwei7egyhuggwp39w8rh",
"grant_type": "client_credentials"
}'{
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",
"expires_at": "2024-06-28T13:26:06.909140Z"
}