Mangopay provides a regularly updated Postman collection for you to test the Mangopay API in the Sandbox environment.
Mangopay API Postman collection
Prerequisites
ClientId
and an API key – if you don’t have these, contact Sales to get access to the Mangopay DashboardClick Run with Postman to fork the collection into your workspace:
Run with Postman
Best practice – Watch the collection for updates
Watch the collection by clicking the eye icon on the parent folder to receive an email when new additions and changes are merged.
You can then pull the changes to bring your fork up to date.
Once the collection is forked, make sure you’ve selected the relevant environment and set up the key variables if they are not already defined:
ENV_URL
– Should be https://api.sandbox.mangopay.comAPI_KEY
– Your Sandbox API key, available in the Mangopay Dashboard.CLIENT_ID
– Your Client ID, available in the Mangopay Dashboard.We also recommend you set variables used for some specific calls:
CURRENCY
– Enter the default currency for your tests. Keep in mind that some payment methods don’t support all currencies, so you might need to update them manually at times.CULTURE
– Enter the default culture value. The Culture
parameter is mostly used in web payment methods, but keep in mind that payment methods don’t necessarily support the same values. We recommend you use EN
for a better experience.Note - Other variables populated automatically
Where relevant, calls in the collection contain post-request scripts (in the Scripts tab of the request) that populate other variables based on the response from the API.
For example, the Create a Natural User call populates a USER_NATURAL_PAYER
variable with the returned Id
; Create a Wallet populates a WALLET_ID
, and so on. Likewise, during the card registration process, the tests populate the tokenization data automatically, meaning you should be able to submit the calls one after another without having to copy and paste values manually.
The Mangopay API uses OAuth 2.0 to authenticate calls, which is supported by Postman.
In Postman, authentication for the collection is managed in the Authorization tab of the parent folder. Child folders and individual calls inherit this authentication.
In the Authorization tab, ensure:
ENV_URL
variable followed by /v2.01/oauth/token
to call the OAuth token endpoint.CLIENT_ID
variable.API_KEY
variable.Note – Postman auto-refreshes tokens
Postman can automatically refresh the OAuth token, but the first token needs to be generated manually.
You also need to generate a new token manually if you change from one collection to another, or from one set of API credentials (Client ID and API key) to another.
The Mangopay API Postman collection is built with variables and scripts to so that you can test a flow of actions more easily. In the Workflows and tutorials folder, you’ll find folders of groups of collections ordered for specific use cases. In the All API endpoints folder, you’ll find the API endpoints grouped by topic or object (approximately following the docs API reference navigation).
You’ll also find comments with specific guidance in the body of relevant requests.
The Mangopay API Postman collection is regularly updated by Mangopay teams.
Watch the collection to be notified of updates via email, and then pull the changes to bring your fork up to date.
Mangopay provides a regularly updated Postman collection for you to test the Mangopay API in the Sandbox environment.
Mangopay API Postman collection
Prerequisites
ClientId
and an API key – if you don’t have these, contact Sales to get access to the Mangopay DashboardClick Run with Postman to fork the collection into your workspace:
Run with Postman
Best practice – Watch the collection for updates
Watch the collection by clicking the eye icon on the parent folder to receive an email when new additions and changes are merged.
You can then pull the changes to bring your fork up to date.
Once the collection is forked, make sure you’ve selected the relevant environment and set up the key variables if they are not already defined:
ENV_URL
– Should be https://api.sandbox.mangopay.comAPI_KEY
– Your Sandbox API key, available in the Mangopay Dashboard.CLIENT_ID
– Your Client ID, available in the Mangopay Dashboard.We also recommend you set variables used for some specific calls:
CURRENCY
– Enter the default currency for your tests. Keep in mind that some payment methods don’t support all currencies, so you might need to update them manually at times.CULTURE
– Enter the default culture value. The Culture
parameter is mostly used in web payment methods, but keep in mind that payment methods don’t necessarily support the same values. We recommend you use EN
for a better experience.Note - Other variables populated automatically
Where relevant, calls in the collection contain post-request scripts (in the Scripts tab of the request) that populate other variables based on the response from the API.
For example, the Create a Natural User call populates a USER_NATURAL_PAYER
variable with the returned Id
; Create a Wallet populates a WALLET_ID
, and so on. Likewise, during the card registration process, the tests populate the tokenization data automatically, meaning you should be able to submit the calls one after another without having to copy and paste values manually.
The Mangopay API uses OAuth 2.0 to authenticate calls, which is supported by Postman.
In Postman, authentication for the collection is managed in the Authorization tab of the parent folder. Child folders and individual calls inherit this authentication.
In the Authorization tab, ensure:
ENV_URL
variable followed by /v2.01/oauth/token
to call the OAuth token endpoint.CLIENT_ID
variable.API_KEY
variable.Note – Postman auto-refreshes tokens
Postman can automatically refresh the OAuth token, but the first token needs to be generated manually.
You also need to generate a new token manually if you change from one collection to another, or from one set of API credentials (Client ID and API key) to another.
The Mangopay API Postman collection is built with variables and scripts to so that you can test a flow of actions more easily. In the Workflows and tutorials folder, you’ll find folders of groups of collections ordered for specific use cases. In the All API endpoints folder, you’ll find the API endpoints grouped by topic or object (approximately following the docs API reference navigation).
You’ll also find comments with specific guidance in the body of relevant requests.
The Mangopay API Postman collection is regularly updated by Mangopay teams.
Watch the collection to be notified of updates via email, and then pull the changes to bring your fork up to date.