Learn how to authenticate to our APIs.
Clik2pay APIs and endpoints are only accessible through OAuth 2.0 Bearer Token authentication. You will
need a bearer access token and an API Key to call our APIs.
Required Credentials
Type | Application | Source |
---|---|---|
Basic {Auth Credentials} | A Base64 encoded username and password to create a bearer token | provided by Clik2pay |
Bearer {Access Token} | A unique bearer access token that’s used when calling our APIs | generated from calling the Auth API |
{API Key} | A key that’s used when calling our APIs | provided by Clik2pay |
2.1 Create your Basic Auth Credentials
{Auth Credentials}
= Base64 encoding of your username and password.
Use the format username:password
.
2.2 Generate your Bearer Access Token
Call our Auth API to generate your Bearer {Access Token}
● Under headers, enter Authorization:
+ Basic {Auth Credentials}
● In the request body, set the grant_type
and scope
fields
curl --location --request POST '{Resource URL}' \
--header 'Authorization: Basic {Auth Credentials}' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'grant_type=client_credentials' \
--data-urlencode 'scope=payment_request/all'
{
"access_token": "eyJraWRjOiJra3Q4a29jb3BEUHdraWdPMlwvYVlcL2hzRTliOXhLM …",
"expires_in": 3600,
"token_type": "Bearer"
}
Auth API - Resource URLs
Status | URL |
---|---|
Production | https://api-auth.clik2pay.com/oauth2/token |
Sandbox | https://api-auth.sandbox.clik2pay.com/oauth2/token |
2.3 Authenticate to our APIs
Authenticate to our Payments Requests API and Payments API by using your {API Key}
and Bearer
{Access Token}
.
● Under headers, enter x-api-key:
+ {API Key}
● Under headers, enter Authorization:
+ Bearer {Access Token}
curl --location -g --request GET '{Resource URL}' \
--header 'x-api-key: {API Key}' \
--header 'Authorization: Bearer {Access Token}'