Postman
Postman, which is a API platform, allows you to explore the Checkout REST APIs so you can perform API testing. This guide outline on how to use and test the Checkout Postman API collection.
Before you start
Before you start, you need:
- A Postman account so you can test and fork the collection from here.
- Also, this guide assumes that you already have an Checkout Portal account.
- Have an integrated Checkout on your website.
- Find your integration keys for the authorization.
Checkout Postman collection
Getting started with Postman
Overview
You can configure and tests the HTTP requests and receive responses for the following APIs:
You can read more overall about the Checkout APIs from here.
Getting started
In order to get started with Postman, you will need to:
- Fork the collection
- Find your integration key(s) so you can make the correct authorization via the API key
- Start to send your first request to see responses
You can get started testing with Checkout Postman by for example sending a request to retrieve a list of payouts, a request to create a new payment or a request to cancel a pending refund.
Forking the collection
You can fork the collection which means that you will create a new instance of the collection locally in your own workspace. In this way, you can test and make changes with your own keys that does not affect the base collection.
- Sign into your Postman account.
- Go to the Checkout API collection from here.
- Select the Run in Postman button.
- Select the Fork collection button.
- Name your work and select a workspace.
Authorization
Find your key
You can find your integration keys inside of your Portal account by following this guide here.
Checkout & Recurring
For the authorization for the Checkout and Recurring folders, the API key must be authorized following these steps:
In the authorization type, you can choose API Key from the drop-down menu.
You will need to input your secret API key from the TEST environment inside value field that gets added to the header.
- The key is named Authorization
- The value field must be the secret key
Make sure to not include "test-secret-key-" when copying and pasting the secret key into the value field.
Onboarding
For the authorization for the Boarding folders, the API key must be authorized following these steps:
In the authorization type, you can choose API Key from the drop-down menu.
You will need to input your secret API key from the LIVE environment inside value field that gets added to the header.
Please note that it is possible to use the secret API key from the TEST and LIVE environment. However, we recommend to only test with the key from the LIVE environment.
- The key is named Authorization
- The value field must be the secret key
Make sure to not include "test-secret-key-" when copying and pasting the secret key into the value field.
Reporting
For the authorization for the Reporting folder, the API key must be authorized following these steps:
In the authorization type, you can choose API Key from the drop-down menu.
You will need to input your secret API key from the TEST environment inside value field that gets added to the header.
For the Reporting API, it is possible to utilize both the TEST and LIVE keys for their respective environments. However, we recommend to use to the TEST key in the TEST environment.
- The key is named Authorization
- The value field must be the secret key
Make sure to not include "test-secret-key-" when copying and pasting the secret key into the value field.
When the authorization has been completed, you can call any API in the collection to start with the requests.
Testing
As an example, the following steps of this request will outline how to create a new payment.
It will use the Payment API to create an order containing a pair of sneakers which will then be captured using your integration keys.
Send a request - Creating the order
- From the right-hand side bar, open up the Payment folder.
- Click into the Checkout folder.
- Next, choose Create payment.
- By default, the method is set to POST.
- Click on the Send button for the request.
- Finally, you will be able to see the response of the request.
- This newly created payment will also be visible inside your Portal under the Payments section.
From this, you will be able to see the following response of the request below: