Try out APIs

Set up your merchant account

  1. Sign up or sign in to Postman.

  2. Open our Postman collection and switch to the "Variables" tab. Update the value under the "current value" column for the baseUrl variable to have the hostname and port of the locally running server (http://localhost:8080 by default).

  3. While on the "Variables" tab, add the admin API key you configured in the application configuration under the "current value" column for the admin_api_key variable.

    1. If you're running Docker Compose, you can find the configuration file at config/docker_compose.toml, search for admin_api_key to find the admin API key.

    2. If you set up the dependencies locally, you can find the configuration file at config/development.toml, search for admin_api_key to find the admin API key

  4. Open the "Quick Start" folder in the collection.

  5. Open the "Merchant Account - Create" request, switch to the "Body" tab and update any request parameters as required.

    • If you want to use a different connector for making payments with than the provided default, update the data field present in the routing_algorithm field to your liking.

    Click on the "Send" button to create a merchant account (You may need to "create a fork" to fork this collection to your own workspace to send a request). You should obtain a response containing most of the data included in the request, along with some additional fields. Store the merchant ID and publishable key returned in the response.

Create an API key

  1. Open the "API Key - Create" request, switch to the "Body" tab and update any request parameters as required. Click on the "Send" button to create an API key. You should obtain a response containing the data included in the request, along with the plaintext API key. Store the API key returned in the response securely.

Set up a payment connector account

  1. Sign up on the payment connector's (say Stripe, Adyen, etc.) dashboard and store your connector API key (and any other necessary secrets) securely.

  2. Open the "Payment Connector - Create" request, switch to the "Body" tab and update any request parameters as required.

    • Pay special attention to the connector_name and connector_account_details fields and update them. You can find connector-specific details to be included in this spreadsheet.

    • Open the "Variables" tab in the Postman collection and set the connector_api_key variable to your connector's API key.

    Click on the "Send" button to create a payment connector account. You should obtain a response containing most of the data included in the request, along with some additional fields.

  3. Follow the above steps if you'd like to add more payment connector accounts.

Create a Payment

Ensure that you have set up your merchant account and set up at least one payment connector account before trying to create a payment.

  1. Open the "Payments - Create" request, switch to the "Body" tab and update any request parameters as required. Click on the "Send" button to create a payment. If all goes well and you had provided the correct connector credentials, the payment should be created successfully. You should see the status field of the response body having a value of succeeded in this case.

    • If the status of the payment created was requires_confirmation, set confirm to true in the request body and send the request again.

  2. Open the "Payments - Retrieve" request and click on the "Send" button (without modifying anything). This should return the payment object for the payment created in Step 2.

Create a Refund

  1. Open the "Refunds - Create" request in the "Quick Start" folder folder and switch to the "Body" tab. Update the amount to be refunded, if required, and click on the "Send" button. This should create a refund against the last payment made for the specified amount. Check the status field of the response body to verify that the refund hasn't failed.

  2. Open the "Refunds - Retrieve" request and switch to the "Params" tab. Set the id path variable in the "Path Variables" table to the refund_id value returned in the response during the previous step. This should return the refund object for the refund created in the previous step.

That's it! Hope you got a hang of our APIs. To explore more of our APIs, please check the remaining folders in the Postman collection.

Last updated

Was this helpful?