API Reference

🔀 Redirect Flow

This section clearly explains the redirection process merchants should follow when integrating JamsrPay into their site.

Redirect Flow

  • The merchant calls the Create Payment API, including parameters such as:
    • amount
    • currency
    • successUrl (URL where customers should return after successful payment)
  • JamsrPay responds with a unique payment id.
    JamsrPay returns a JSON response:
    {
      "id": "e4cauyo37d978pvmy18xgfu9"
    }
    
  • Redirect Customer to JamsrPay using that id:
https://jamsrpay.com/payments/{id}

Example:

302 Redirect → https://jamsrpay.com/payments/e4cauyo37d978pvmy18xg
  • Customer completes the payment on JamsrPay.
  • Finally, JamsrPay redirects the customer back to the merchant’s predefined successUrl.


Create Invoice and Redirect

Merchants can create an invoice directly from their backend and then redirect the customer to the JamsrPay Checkout Page. This ensures a secure payment process while allowing the merchant to maintain full control of the flow.




Create Invoice (Backend Request)

Use the **Create Payment API **from your backend.

You’ll receive a paymentId in the response, which will be required for the redirect step.


Example Request:

POST /web/payments
{
  "paymentCurrency": "ADA",
  "paymentId": "{paymentId}"
}

Redirect Customer to JamsrPay Payment Page

Once you have the invoiceId, redirect the customer from your website or app:

window.location.href = "https://jamsrpay.com/invoices/{invoiceId}";

The customer will then complete the payment on JamsrPay’s secure checkout page.