Recurring Payments
Payment Request
Charge a customer using a saved tokenised card
Process a payment using a previously tokenised card. The request is queued for processing and status updates are delivered via webhooks.
Production: POST https://api.esenda.com/v2/partner/recurring-payment/{shortcode}/charge
Sandbox: POST https://api-demo.esenda.com/v2/partner/recurring-payment/{shortcode}/charge
Headers
Accept-Language: <LANGUAGE> (optional, default en-GB)
Authorization: Bearer <ACCESS_TOKEN>
Content-Type: application/jsonRequest Parameters
| Parameter | Type | Constraints | Required | Description | Example |
|---|---|---|---|---|---|
tokenised_card_id | String | max: 255 | Yes | The unique card identifier from the tokenisation response | c3e7f8a9-... |
idempotency_id | String | min: 1, max: 50, alphanumeric/underscore/hyphen | Yes | Unique idempotency identifier for this request | 8e87ef2a-9faf-... |
amount | Integer | min: 1500, max: 1000000 | Yes | Payment amount in pence (e.g. 1500 = £15.00) | 1500 |
send_confirmation_email | Boolean | — | No | Send email receipt on successful payment. Defaults to false | true |
description | String | max: 255 | No | Payment description for customer records | School fees payment |
reference | String | max: 255 | No | Your internal reference for this payment | INV-2024-001 |
notification_url | String | max: 512, valid URL | No | Webhook URL for payment status notifications | https://your-site.com/webhooks |
Payload Example
{
"tokenised_card_id": "c3e7f8a9-1234-5678-9012-3456789abcde",
"idempotency_id": "8e87ef2a-9faf-4627-9a54-8aca13890335",
"amount": 1500,
"send_confirmation_email": true,
"description": "School fees payment",
"reference": "INV-2024-001",
"notification_url": "https://your-site.com/webhooks"
}Responses
200 — Queued
The payment is queued. Watch for Payment Webhooks for status updates.
{
"idempotency_id": "8e87ef2a-9faf-4627-9a54-8aca13890335",
"tokenised_card_id": "c3e7f8a9-1234-5678-9012-3456789abcde",
"amount": 1500,
"status": "queued",
"reference": "INV-2024-001",
"created_at": "2024-01-23 14:42:19.999462"
}400 — Error
{
"error": "No active cards",
"message": "No active cards found for tokenised_card_id: c3e7f8a9-1234-5678-9012-3456789abcde"
}