Authorization
Getting Started
In order to make any type of transaction with TendoPay, the merchant needs to be authenticated. The first step of getting authenticated is by logging in to the merchant portal and heading over to the Managed Apps Page, you can create a new V2 application and generate a new Client ID and Client Password.
You should be able to easily request an access token, by sending your request url to https://sandbox.tendopay.ph/oauth/token
.
graph LR
creds[Client ID
Client Secret] AT[Access Token] creds --> AT AT --> RA[Resource API]
Client Secret] AT[Access Token] creds --> AT AT --> RA[Resource API]
Parameters
Parameter | DataType | Required | Description | Example |
---|---|---|---|---|
grant_type | String | Yes | TendoPay Merchant portal Grant Type | 'client_credentials' |
client_id | String | Yes | Merchant Client ID | '123456' |
client_secret | String | Yes | Merchant Client Secret | 'abcdegf' |
Example
CURL Request
curl -XPOST 'https://sandbox.tendopay.ph/oauth/token' \
-H 'Accept: application/json' \
-F 'grant_type=client_credentials' \
-F 'client_id=91617300-49bd-46d4-8e9c-cc476a2d30c5' \
-F 'client_secret=JOHUJeVJ3KIn'
Response
{
"token_type": "Bearer",
"expires_in": 604799,
"access_token": "eyJ0eXAiOiJKhbGciOiJSUz...JKV1QiLCJhbGciOiJSU"
}
Fetching Other Resource APIs
After you have received your bearer token, requesting any other resource API path will require a bearer token in order to get a successful response.
Resource URL
https://sandbox.tendopay.ph/EXAMPLE_RESOURCE_API_ROUTE
Sample Code (Example)
CURL
curl -XGET 'https://sandbox.tendopay.ph/EXAMPLE_RESOURCE_API_ROUTE' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer eyJ0eXAiOiJKhbGciOiJSUz...JKV1QiLCJhbGciOiJSU'