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
Key | Value | Description | Optional |
---|---|---|---|
amount | Numeric value | This field described the amount which needs to be collected on behalf of the merchant | N |
currency | ISO 4217 standard currency Code. (AED, USD, SAR) | Currency against which the crypto payment should be accepted | N |
reference_id | Reference 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 sessions | N |
success_redirect_url | URL in string datatype where the ZAMP SDK will redirect the session to in case of success payment initiation | N/A | N |
failure_redirect_url | URL in string datatype where the ZAMP SDK will redirect the session to in case of failed payment initiation | N/A | N |
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
Key | Value | Description |
---|---|---|
id | merchant_xSbCCPqGtXWCDX2pmQLbKF_08_03 | This is the UUID with which merchant can uniquely identify a payment session on Zamp systems |
token | JWT Token | JWT 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.