Create a charge.
const url = 'https://api.ridleypay.com/v1/charges';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"token":"f47ac10b-58cc-4372-a567-0e02b2c3d479","recurring_reference":"SUB-001","payment_reference":"ORDER-001","amount":45,"currency":"JMD","reference":"RIDE-0047","description":"Trip from Kingston to Montego Bay","metadata":{"driver_id":12,"trip_id":"T-0047"},"apply_tax":true,"customer_email":"jane@example.com","customer_name":"Jane Doe"}'};
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/charges \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "token": "f47ac10b-58cc-4372-a567-0e02b2c3d479", "recurring_reference": "SUB-001", "payment_reference": "ORDER-001", "amount": 45, "currency": "JMD", "reference": "RIDE-0047", "description": "Trip from Kingston to Montego Bay", "metadata": { "driver_id": 12, "trip_id": "T-0047" }, "apply_tax": true, "customer_email": "jane@example.com", "customer_name": "Jane Doe" }'Charges a saved payment method immediately without customer redirect.
Identify the card on file with recurring_reference (the schedule’s
current card) or payment_reference (a payment made with
save_payment_method: true). Ridley looks up the saved card, so your
system never handles card tokens. The legacy token parameter is still accepted.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
Legacy: a provider transaction token from a prior payment.
Example
f47ac10b-58cc-4372-a567-0e02b2c3d479Charge the card on file of this recurring schedule. The payment is linked to the schedule.
Example
SUB-001Charge the card saved by this payment.
Example
ORDER-001The charge amount.
Example
45The ISO 4217 currency code. Defaults to the source’s default currency.
Example
JMDA unique reference for this charge.
Example
RIDE-0047An optional description.
Example
Trip from Kingston to Montego BayOptional metadata to attach to the payment.
object
Example
{ "driver_id": 12, "trip_id": "T-0047"}Calculate tax from your team tax settings. Exclusive tax is added to amount; inclusive tax is extracted from it.
Example
trueCustomer email for the payment record.
Example
jane@example.comCustomer name for the payment record.
Example
Jane DoeResponses
Section titled “ Responses ”Charge succeeded
object
object
object
object
Example
{ "data": { "id": 1, "type": "charges", "attributes": { "reference": "RIDE-0047", "amount": "45.00", "currency": "JMD", "status": "PAID", "provider_transaction_id": "txn_new_123", "card_brand": null, "card_last": null, "metadata": { "driver_id": 12 }, "created_at": "2026-06-18T21:00:00+00:00" } }}Validation error
object
object
Charge declined
object
object
object
Gateway not supported
object
object
Example
{ "errors": [ { "status": "422", "title": "Unprocessable Entity", "detail": "The token field is required." } ]}