Skip to main content

Initiate Payment Session

In order to initiate a payment session, the merchant has to make an initiate call to Zamp. In return Zamp returns some key data points, which the merchant would need to store as well as pass on to their front end to initiate the Zamp SDK.

Endpoint : POST https://api.zamplabs.com/payments/v1/payment-sessions

Request Body

KeyValueDescriptionOptional
amountNumeric valueThis field described the amount which needs to be collected on behalf of the merchantN
currencyISO 4217 standard currency Code. (AED, USD, SAR)Currency against which the crypto payment should be acceptedN
reference_idReference of order id on merchant's system. This is accepted as a string value.This helps us cross reference orders of merchant's systems associated with payment sessionsN
success_redirect_urlURL in string datatype where the ZAMP SDK will redirect the session to in case of success payment initiationN/AN
failure_redirect_urlURL in string datatype where the ZAMP SDK will redirect the session to in case of failed payment initiationN/AN

Request JSON Representation

{
"amount": 10,
"currency": "USD",
"reference_id": "8Gtnpzyion6rbcvwb7eP5xid",
"success_redirect_url": "https://merchantWebsite.com/crypto_payment_initiated",
"failure_redirect_url": "https://merchantWebsite.com/crypto_payment_failed"
}

Response Body

KeyValueDescription
idmerchant_xSbCCPqGtXWCDX2pmQLbKF_08_03This is the UUID with which merchant can uniquely identify a payment session on Zamp systems
tokenJWT TokenJWT token which the merchant needs to pass to the front end to initiate the Zamp SDK

Response JSON Representation

{
"data": {
"id": "merchant_xSbCCPqGtXWCDX2pmQLbKF_08_03",
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzZXNzaW9uX2lkIjoicHJvYm9feFNiQ0NQcUd0WFdDRFgycG1RTGJLRl8wOF8wMyIsIm1lcmNoYW50X2lkIjoicHJvYm9fOUd0bnBoakI2cmJjdndiN2VQNXhpZF8wNV8yNyIsIk1lcmNoYW50Q29kZSI6InByb2JvIiwiZXhwIjoxNjU5NTE0NDc3fQ.D6Cl5lELPuoe5GSY6vEbhUb8NRuWUhRSmsRXbD7950U"
}
}

We request you to never store the JWT token. It is to be directly passed to your front end to initiate the JS SDK.

We request you to store the id. This will be further used to confirm the status of the payment session via polling as well as callbacks.