Skip to main content
POST
/
v1
/
payments
{
  "amount": 25.00,
  "currency": "USD",
  "description": "Order #1234 - Premium Plan",
  "customerEmail": "customer@example.com",
  "metadata": {
    "orderId": "order_1234",
    "plan": "premium"
  },
  "redirectUrl": "https://yoursite.com/order/1234/complete"
}
{
  "id": "pay_abc123def456",
  "status": "initiated",
  "amount": 25.00,
  "currency": "USD",
  "cryptoAmount": "25.032500",
  "cryptoAddress": "0x1a2b3c4d5e6f7890abcdef1234567890abcdef12",
  "qrCodeUrl": "https://olp-api.nipuntheekshana.com/qr/pay_abc123def456.png",
  "checkoutUrl": "https://olp-checkout.nipuntheekshana.com/pay/pay_abc123def456",
  "expiresAt": "2026-03-26T15:30:00Z"
}

Authentication

This endpoint requires a Bearer token in the Authorization header.
Authorization: Bearer <your_jwt_token>

Body Parameters

amount
number
required
The payment amount in the specified fiat currency. Must be greater than zero.
currency
string
required
The fiat currency for the payment. Supported values: USD, LKR.
description
string
required
A human-readable description of what the payment is for. Displayed to the customer during checkout.
customerEmail
string
The customer’s email address. If provided, a payment receipt will be sent upon completion.
metadata
object
An arbitrary key-value object to attach to the payment. Useful for storing your internal order ID or reference codes.
redirectUrl
string
The URL to redirect the customer to after the payment is completed or cancelled.

Response

id
string
Unique identifier for the payment.
status
string
Current payment status. One of: initiated, pending, confirming, paid, failed, expired.
amount
number
The fiat amount of the payment.
currency
string
The fiat currency (USD or LKR).
cryptoAmount
string
The equivalent amount in cryptocurrency (USDT) that the customer needs to send.
cryptoAddress
string
The blockchain wallet address the customer should send funds to.
qrCodeUrl
string
URL to a QR code image encoding the crypto address and amount for easy scanning.
checkoutUrl
string
A hosted checkout page URL where the customer can complete the payment.
expiresAt
string
ISO 8601 timestamp indicating when the payment will expire if not completed.

Payment Statuses

StatusDescription
initiatedPayment created, awaiting customer action
pendingCustomer has initiated the crypto transfer
confirmingTransaction detected on-chain, waiting for confirmations
paidPayment confirmed and settled
failedPayment failed due to underpayment or transaction error
expiredPayment window expired before receiving funds
{
  "amount": 25.00,
  "currency": "USD",
  "description": "Order #1234 - Premium Plan",
  "customerEmail": "customer@example.com",
  "metadata": {
    "orderId": "order_1234",
    "plan": "premium"
  },
  "redirectUrl": "https://yoursite.com/order/1234/complete"
}
{
  "id": "pay_abc123def456",
  "status": "initiated",
  "amount": 25.00,
  "currency": "USD",
  "cryptoAmount": "25.032500",
  "cryptoAddress": "0x1a2b3c4d5e6f7890abcdef1234567890abcdef12",
  "qrCodeUrl": "https://olp-api.nipuntheekshana.com/qr/pay_abc123def456.png",
  "checkoutUrl": "https://olp-checkout.nipuntheekshana.com/pay/pay_abc123def456",
  "expiresAt": "2026-03-26T15:30:00Z"
}