API Reference
Log in to see full request history

This API used to obtain a User Access Token, which uses the authorization code obtained as a query parameter in the redirect URL, after the purchase flow is completed successfully which is started using the Prepare Purchase API. This operation is a server-to-server API call, it is expected that the client call this operation from their backend.

How to use:

1- Go to the Params tab,
2- Fill in client_id and client_secret and code (Replace with Authorization Code obtained as a redirect URL query parameter that starts with letter A) and redirect_uri should be set to a thank you page URL.
3- Grab the access_token from the response of this request to be used later in any of the APIs in the Subscription Management section.

Token Validity Period

The generated User Access Token will be valid for 12 hours with unlimited usage. The partner/merchant/client is expected to use the same User Access Token for the whole duration of its validity.

Query Params
string
Defaults to authorization_code

The grant type. The only allowed value here is 'authorization_code'.

string
Defaults to 0b7b4e47-b321-404c-afe0-d59fd8cda46

Unique ID provided to the client. Clients may use the HTTP Basic authentication scheme to send the client ID and client secret. Contact your assigned MondiaPay account manager to get this.

string
Defaults to 672e2411-b20f-419c-b8f9-0f491dc2ba71

The client secret provided. Contact your assigned MondiaPay account manager to get this.

string
Defaults to A1234abcde-1234-abcd-1234-abcd1234abcd

This unique, one-time use, value is obtained upon successful subscription and returned as a query parameter in the redirect URL as "?code=A1234abcde-1234-abcd-1234-abcd1234abcd"

string
Defaults to http://www.myserviceURL.com/

Mandatory field and should be set to a thank you page URL.

Headers
string
Defaults to application/json

!DO NOT CHANGE OR REMOVE!

string
Defaults to application/x-www-form-urlencoded

!DO NOT CHANGE OR REMOVE!

Responses

Language
URL
Click Try It! to start a request and see the response here! Or choose an example:
application/json