Skip to main content

Example API Flows (Postman)

This Postman Collection demonstrates the API calls, and the steps that must be taken, for a number of common scenarios.



A screen with HTTP request names in a sidebar on the left, and the request and response bodies in the central pane. The requests are for the Hokodo BNPL Happy Path and the request selected is for Organisation Create.

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:

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.

The Postman UI with the Environment Variables section open. It's the eye icon in the top right.

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.

The Postman UI with the Organisations request open. The 'tests' section is selected and there's some code checking the status and setting a variable to contain the Organisation ID.

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.

The Postman UI with the Organisations request open. The 'tests' section is selected and there's some code checking the status and setting a variable to contain the Organisation ID.