The API Simulator allows the user to formulate an API request, and "try it" to see how the Clearpay API will respond. Each of the API endpoints in this reference document are accompanied by an API Simulator.

For example, the following screenshot demonstrates that the Simulator is capable of correctly constructing an Authorization header, using the Merchant ID and Secret Key.



Please note that this Simulator with the example code is provided as a guide only. It may not always represent best practice, or Clearpay's recommendations. Please refer to your frameworks documentation or Clearpay technical contact if you are unsure of the best way to integrate with Clearpay.

When using the Simulator, please keep in mind the following considerations.

JavaScript Code Samples


JavaScript code samples are provided for convenience only

JavaScript or any client side libraries must never be used to communicate with an Clearpay API in a Production environment.

Like all client-side scripting languages, they run in the end-user's browser. Using your Clearpay Online API credentials from the front-end will expose them to the public.

Ruby Code Samples

In each of these samples, the code that is automatically generated suggests disabling SSL Peer Verification. This is an important component of any secure connection and should therefore never be disabled.