Generating a Payment Link

Merchant's Backend - Payment Session Creation

  1. Include a form on the client side (app, dapp, or webpage) to gather and send the order details to the merchant's backend. Add a custom "Pay with Payram" button for the payment option.

  2. On the merchant's server side, implement the logic to process the form data and send a POST request to your Payram backend server to create a payment session.

  3. To obtain a payment link, the merchant's backend needs to send a request with the customer's email, Customer ID, and the payment amount. Sample Request and Response for payment session creation

Get_Payment_Link
curl --location 'https://yourdomain.com/api/v1/payment' \
--header 'API-Key: api_key' \
--header 'Content-Type: application/json' \
--data '{
    "customerEmail": "[email protected]",
    "customerId": "abc12456",
    "amountInUSD": 24.334
}'

  1. When the response is received, extract the reference_id and store it in your database to track payments.

  2. Then, retrieve the payment URL and redirect the user to that link.

Last updated