Simple Integration

This is the simplest way to integrate PayRam into your website or server. Your backend calls the PayRam server API directly with the required details.

API endpoint

Use this endpoint if SSL is not enabled.

http://yourpayramserver.com:8080/api/v1/payment

Use this endpoint if SSL is enabled.

https://yourpayramserver.com:8443/api/v1/payment

Request headers (required)

Header
Value
Description

api-key

API_KEY

Your platform’s secret API key

content-type

application/json

Ensure JSON payload is used

Example request

Include these required details in the request body when generating a payment link.

{
    "customerEmail": "[email protected]",
    "customerId": "79473632",
    "amountInUSD": 12
}
Field
Type
Required
Description

customerID

String

✅ Yes

A unique ID you assign to the user (e.g., UUID or numeric ID)

customerEmail

String

✅ Yes

User’s email (for internal record / fraud checks)

amountInUSD

Number

✅ Yes

The dollar equivalent to be paid by the user

Example response

This is the response you receive from the API request when it is successful.

{
  "host": "http://yourpayramserver.com:8080",
  "reference_id": "c80f5363-0397-4761-aa1a-3155c3a21470",
  "url": "http://yourpayramserver.com/payments?reference_id=c80f5363-0397-4761-aa1a-3155c3a21470&host=http://yourpayramserver.com:8080"
}
  • reference_id — Use this to track status, fetch payment results, or verify webhook events. This field is critical.

  • url — The payment link to show to the user (for example, QR page or wallet selector). The URL expires after 15 minutes.

  • host — Returned for internal routing purposes.

cURL request example

Replace api_key with the API key you received earlier.

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

Workflow

  1. Your backend calls the PayRam API with the required customer and payment details.

  2. The API responds with a reference_id and a payment URL.

  3. Redirect the user to the payment URL to complete the transaction.

Last updated