1. Authenticate Requests

Generate an authentication token for all requests.

POST https://developer.tingg.africa/checkout/v2/custom/oauth/token

Every request made to the extra functions API is authorized using an access_token which is obtained by sending a client_secret and client_id to the authentication route.

πŸ“˜

Auth Token Expiry

For security reasons, the authentication token expires in 120 seconds.

It is advisable, you generate a token before each request.

Header: Content-Type: application/json

Request Parameters

Parameter NameTypeDescriptionDefault Value
grant_typestringThe grant expected by the OAuth server.client_credentials
client_idstringThe API Client IDN/A
client_secretstringThe API Client SecretN/A

Example

{
    "grant_type": "client_credentials",
    "client_id": "<CLIENT_KEY>",
    "client_secret": "<CLIENT_SECRET>"
}

Response Parameters

Parameter NameTypeDescription
token_typestringThe type of token returned.
expires_inintegerToken expiry time in seconds.
access_tokenstringToken used to authorize requests.

Example

Success Response

{
    "token_type": "Bearer",
    "expires_in": 120,
    "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjE3MDFlYWNjNzE5MDAwNWViYjUyZjU3YmZjN2IwMjFhYjUxYjEyMjU1NjU2MGEwOTJjYWRiOGJiMzRlNmVlYTVmMjIyYmZlOTMyMTE1OTc1In0.eyJhdWQiOiI0NTUiLCJqdGkiOiIxNzAxZWFjYzcxOTAwMDVlYmI1MmY1N2JmYzdiMDIxYWI1MWIxMjI1NTY1NjBhMDkyY2FkYjhiYjM0ZTZlZWE1ZjIyMmJmZTkzMjExNTk3NSIsImlhdCI6MTU5ODUxMzE4MiwibmJmIjoxNTk4NTEzMTgyLCJleHAiOjE1OTg1MTMzMDIsInN1YiI6IiIsInNjb3BlcyI6W119.s9EUECRnVtcw8kWPSVr93-LVu5EBcv4nPeGAp409hEzvLUufS1hdxS9epvhWKBznG2y-ys9iaacx8aUlkNgocP9Meghrw6yY2VL8g3Y7qLmOAj3vdTAt30DCLZxLhn8bh4ihsb-Kz9FIXt4ed6bW_eWRSwLNO1JJuVi_GZNzWYXITdEa5qOlu2DJe7eKoM0r1JBQPSIjUNG01_qN2dX8HbKNlWKg2Fr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