API Docs
Payment Links
API ReferencePayment LinksCreate a Payment from a Link

Create a Payment from a Link

Create the payment for a single checkout against an existing payment link and get a client_secret to initialize the SDK.

POST /payment_link/{payment_link_id}/create-payment

Use this when folding payment links into your own checkout. One-time links return the link's payment; reusable links (recurring, donation, or any link with a usage_limit) mint a fresh payment on every checkout. If the link has expired or reached its usage limit, the response returns expired: true with no client_secret.

Path Parameters

ParameterTypeRequiredDescription
payment_link_idstringYesThe id of the payment link to create a payment for.

Body Parameters

ParameterTypeRequiredDescription
amountintegerNoAmount in the smallest currency unit. Required when the link has no fixed amount (variable or donation links); ignored when the link defines a fixed amount.
payment_idstringNoResume an existing payment for this link instead of creating a new one (retry).
customer_namestringNoCustomer name to attach to the payment.
customer_emailstringNoCustomer email to attach to the payment.
return_urlstringNoURL to redirect the customer to after they complete this payment. Sent per order; when omitted, the business profile return_url is used.
order_detailsarrayNoOrder or cart line items to attach to the payment.
metadataobjectNoStructured metadata to attach to the payment.
merchant_order_reference_idstringNoYour own order reference, stored on the payment for reconciliation.
billingobjectNoBilling details to attach to and retain on the payment.
shippingobjectNoShipping details to attach to the payment.

Request Example

curl -X POST 'https://api.rpayz.com/payment_link/plink_1234567890/create-payment' \  -H "Content-Type: application/json" \  -H "api-key: snd_YOUR_API_KEY" \  -d '{  "amount": 6540,  "return_url": "https://example.com/orders/1234/return",  "merchant_order_reference_id": "order_1234",  "customer_email": "customer@example.com",  "billing": {    "address": {      "first_name": "Jane",      "last_name": "Doe",      "line1": "1467 Harrison Street",      "city": "San Francisco",      "state": "CA",      "zip": "94122",      "country": "US"    }  },  "order_details": [    {      "product_name": "T-shirt",      "quantity": 1,      "amount": 6540    }  ]}'

Response

{
  "client_secret": "pay_1234567890_secret_abc123",
  "expired": false
}

Pass the client_secret to the SDK to render the payment form and complete the payment.

Next steps