Create a payment link.
const url = 'https://api.ridleypay.com/v1/payment-links';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"title":"Deposit for order 1042","description":"Balance due on delivery.","amount":2500,"currency":"JMD","success_url":"https://example.com/thanks","cancel_url":"https://example.com/cart","max_uses":1,"expires_at":"2026-12-31T23:59:59Z","taxable":true,"recurring":null,"metadata":{"order_id":"1042"},"products":null}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.ridleypay.com/v1/payment-links \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "title": "Deposit for order 1042", "description": "Balance due on delivery.", "amount": 2500, "currency": "JMD", "success_url": "https://example.com/thanks", "cancel_url": "https://example.com/cart", "max_uses": 1, "expires_at": "2026-12-31T23:59:59Z", "taxable": true, "recurring": null, "metadata": { "order_id": "1042" }, "products": null }'Pass either an amount or products. The response’s url is the link to send to your customer.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
Shown to the customer on the checkout page. Must not be greater than 255 characters.
Example
Deposit for order 1042More detail shown under the title. Must not be greater than 5000 characters.
Example
Balance due on delivery.The amount to charge. Required unless you pass products. This field is required when products is not present. Must be at least 0.01. Must not be greater than 999999.99.
Example
2500ISO 4217 code. Defaults to the website’s default currency. Must be 3 characters.
Example
JMDWhere to send the customer after paying. Must be a valid URL. Must not be greater than 2048 characters.
Example
https://example.com/thanksWhere to send the customer if they cancel. Must be a valid URL. Must not be greater than 2048 characters.
Example
https://example.com/cartTurn the link off after this many payments. Use 1 for a one-off link. Must be at least 1.
Example
1Turn the link off at this time (ISO 8601). Must be a valid date. Must be a date after now.
Example
2026-12-31T23:59:59ZAdd tax from your team’s tax settings on top of the amount. Defaults to false, so the customer pays exactly the amount.
Example
trueBill the customer on a schedule after the first payment.
object
Daily, weekly, monthly or yearly. This field is required when recurring is present.
Example
monthlyFor example 3 with monthly bills every 3 months. Must be at least 1. Must not be greater than 365.
Example
1Stop billing after this date. Must be a valid date. Must be a date after today.
Example
2027-06-30Example
nullUp to 50 keys of your own data. Copied onto every payment made with the link and included in its webhooks. Must not have more than 50 items.
object
Example
{ "order_id": "1042"}Charge for products from your Ridley catalogue instead of a fixed amount. Must have at least 1 items. Must not have more than 50 items.
object
Must match an existing stored value.
Example
16Must be at least 1. Must not be greater than 1000.
Example
22Example
nullResponses
Section titled “ Responses ”Created
object
object
object
object
object
Example
{ "data": { "id": "41", "type": "payment-links", "attributes": { "url": "https://checkout.ridleypay.com/pay/Xk2...", "title": "Deposit for order 1042", "description": null, "type": "custom", "amount": "2500.00", "currency": "JMD", "active": true, "usable": true, "uses_count": 0, "max_uses": 1, "expires_at": null, "taxable": false, "recurring": null, "products": [], "metadata": { "order_id": "1042" }, "success_url": null, "cancel_url": null, "test": false, "created_at": "2026-09-28T12:00:00.000000Z", "updated_at": "2026-09-28T12:00:00.000000Z" }, "links": { "self": "https://api.ridleypay.com/v1/payment-links/41", "pay": "https://checkout.ridleypay.com/pay/Xk2..." } }}Validation error
object
object
Example
{ "errors": [ { "status": "422", "title": "Unprocessable Entity", "detail": "The amount field is required when products is not present." } ]}