Postman API flow
This Postman Collection demonstrates the API calls, and the steps that must be taken, for a number of common scenarios.
What is Postman?
Postman is a free application designed to help software teams easily explore and test APIs. It's a graphical HTTP client that saves groups of requests as 'collections'.
What is a Postman Collection?
One of the ways that Postman organises API requests is by using what they call a Collection. A Collection can contain one or more API requests, nested into groups if necessary, to provide easy access to endpoints.
The Hokodo Buy Now Pay Later Collection contains examples of all the API endpoints that you would need in order to successfully implement the Buy Now Pay Later product, as well as examples of common flows and potential pitfalls.
Getting Started
To use the collection:
- Install Postman
- Open it and select import from the file menu
- Import the
hokodo_bnpl_postman_collection.json
andhokodo_bnpl_postman_environment_variables.json
files
Environment Variables
The Collection makes use of a number of configurable variables (called Environment Variables). They provide sensible defaults to get you up and running.
Setting the API key
The Hokodo Buy Now Pay Later API is secured with a private token which is unique to your company. If you don't yet have a token, please contact Hokodo to request one. If you have been given a security token for Hokodo's Sandbox environment, then Locate the Hokodo API environment in Postman and update the your_api_token
variable to be your API token.
Manual Interventions
Some of the scenarios in the collection require manual intervention to create a Deferred Payment. These are labelled Manually Complete the Payment in your Browser. To do this, go to the preceding Create an Offer request, open one of the Payment URLs in your browser and complete the payment.
Once payment has been set up, you can return to Postman and continue the next request.
Viewing Tests
All of the requests have some basic tests against them which verify and demonstrate the expected response for each request. You can view or edit any of these tests by visiting the Tests Tab for each request.
These tests also set up the variables used in the request bodies of later requests.
Code Snippets
Postman's Code Snippets are generated code that makes the HTTP requests in the collection. This might help speed your integration coding effort. Many languages are supported including JavaScript, PHP, Go, Python and C/C#/objective-C.
Click on the code snippets icon in the Postman sidebar to use this feature.