Guides and reports

Effortless API Testing with the Adyen Postman collections

By Beppe Catanese, Developer Advocate, Adyen

June 23rd, 2023
 ·  5 minutes

As a global leading technology-driven company, at Adyen we recognise the importance of equipping developers with tools and resources that reduce time to value and make the integration with our platform faster and better.

That's why we have launched theAdyen Postman space. Leveraging the robust capabilities of Postman—a very popular tool in the API ecosystem - the developers, who work with the Adyen platform, can quickly discover, explore and test the Adyen APIs.

In this article..

…click, fork, play! Explore the benefits of using the Adyen Postman collections for discovering, exploring and testing the Adyen APIs. Checkout the step-by-step guide to getting started.


Adyen Postman Collections

Adyen Postman collections consist of preconfigured API requests that enable developers to effortlessly invoke Adyen's APIs. The collections are automatically generated from theOpenAPI specifications, ensuring all API endpoints and the JSON payloads are accurate and always up-to-date.

We provide a single workspace for all Adyen APIs. In the workspace there is a collection for each of the Adyen services, from Checkout to Recurring, Point of Sale and Platforms.

Adyen Developers Postman banner

Streamlined integration

The primary advantage of adopting the Adyen Postman collections is the streamlined integration process we are able to offer. Following few simple steps the developers can perform API calls easily:

  • Fork the environment and define your own credentials
  • Fork the collection
  • Run the HTTP requests
  • Stay up to date

Fork the environment

By forking thepreconfigured environment, developers obtain a template to configure essential settings such as the API key and other configuration options. It is important to keep the forked environment private to protect sensitive information.

Adyen API Postman environment

The configuration can be defined at different levels: the preferred approach is using the Postman environment as it can be shared across collections. It is however possible to set the values in the Global scope (always available throughout the entire workspace) or in the Collection directly.

Fork the collection

To begin using the Adyen Postman collections, developers can fork a specific collection. By doing so, they can leverage the prebuilt requests, including parameters and payloads, saving valuable time and effort.

The collections are designed withflexibilityin mind: they define variables that can be managed in one place and re-used across all requests (think of merchant and company accounts, platform code and other parameters).

Once the collection is forked it becomes available in the developer’s private workspace. The requests can be customized (when needed) and executed.

Adyen API Postman Checkout API collection

Developers using the Adyen Postman collections can invoke all API's endpoints using their own API key and access rights, validate the responses and verify the outcome.

The collections simplify the work of developers and testers providing many pre-defined scenarios:

  • make a payment using various payment methods
  • execute Adyen for Platforms Onboarding scenarios
  • issuing of physical and virtual cards
  • create different transaction rules
  • etc..

Stay Informed

The Adyen Postman space provides a convenient way tostay updated on changes and new releases. By watching a collection, users receive an email notification when there is a modification or something new in the collection.

New API releases might bring new features, corrections, or sometimes better documentation and examples. Any of those changes is pushed to the developers watching the collection allowing them to inspect the differences and pull the changes.

This proactive approach keeps developers informed about new versions and, ultimately, it is a great way to discover new features and upgrade their integration.

Postman notification

Payment subscriptions with Postman

Let’s see the Postman collections in action. We are going to look at the Payment Subscriptions (Tokenization) use case where the shopper authorizes a recurring payment for a subscription.

Set the API Key and Merchant Account

You start with forking the environment called “Adyen APIs”. In your own local fork, configure the `X-API-Key` (API Key from the API credential) and the `Merchant Account`. Keep the environment private as it contains sensitive information.

Postman environment configuration

Fork the Checkout API collection

Next fork the Checkout API collection, then browse to the “Payments” folder and take a look at the “Tokenize card details for a subscription” request.

Postman request execution

The request payload is pre-configured with variables like the merchantAccount (defined in the environment above), dynamic variables (i.e. auto generated reference) and some data (like the amount) that can be changed.

Language: json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
    {
 "amount": {
  "currency": "USD",
  "value": 1000
 },
 "reference": "{{$guid}}",
 "paymentMethod": {
  "type": "scheme",
  "number": "4111111111111111",
  "expiryMonth": "03",
  "expiryYear": "2030",
  "holderName": "John Smith",
  "cvc": "737"
 },
 "shopperReference": "SHOPPER_REF_1",
 "storePaymentMethod": true,
 "shopperInteraction": "Ecommerce",
 "recurringProcessingModel": "Subscription",
 "returnUrl": "https: //your-company.com/...",
 "merchantAccount": "{{YOUR_MERCHANT_ACCOUNT}}"
}


  

You only need to enable the environment, in the top-right corner, and execute the request. The response body will include the resultCode (‘Authorized`) and the generated token (in the `additionalData.recurring.recurringDetailReference` field).

Language: json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
    {
 "additionalData": {
  "recurring.recurringDetailReference": "TOKEN_REF",
  "recurringProcessingModel": "Subscription",
  "paymentMethod": "visa",
  "recurring.shopperReference": "SHOPPER_REF_1"
 },
 "pspReference": "PSP00000001",
 "resultCode": "Authorised",
 "amount": {
  "currency": "USD",
  "value": 1000
 },
 "merchantReference": "111ab222-abcd-1234-aaaa-0f0f0f0f0fOf",
 "paymentMethod": {
  "brand": "visa",
  "type": "scheme"
 }
}

  

The last step is to make a subscription payment using the token.

Find the “Make a card payment with a token” request, set the token in the `storedPaymentMethodId` field and execute the payment.

Postman response example

Adyen Postman on Github

The Adyen Postman space provides the latest and greatest version of the Adyen APIs. However it is sometimes necessary to work with an older version. This is why we also store the Postman (JSON) files for all API releases on theadyen-postman GitHub repository.

Import the JSON file in Postman and run the requests against a previous API version: test URLs, endpoint paths and payloads are already configured accordingly.

Conclusion

Adyen Postman collections provide developers with a powerful toolset for the discovery, configuration and testing of the Adyen's APIs. Using automation we ensure the collections are always up-to-date and the information is consistent. Leveraging on Postman notifications and its Git-alike version control developers are informed as soon as a new version is available.

Save valuable time and effort by avoiding manual uploads of the OpenAPI files. Instead take advantage of a readily available collection for an effortless and effective utilization.

Get started with theAdyen Postman collections. Start by forking the environment, exploring the collections and invoking the endpoints. Reduce time to value and make your integration journey simpler and better.



Fresh insights, straight to your inbox

By submitting your information you confirm that you have read Adyen's Privacy Policy and agree to the use of your data in all Adyen communications.