Skip to main content
POST
/
api
/
canary
/
payment-intents
Server-to-server API to charge a saved card. Used for subscriptions or recurring billing (a core gateway feature).

Request Body

customerId
string
required
The unique identifier of the customer to charge
paymentMethodId
string
required
The unique identifier of the saved payment method (card) to use
amount
number
required
The amount to charge in the smallest currency unit
currency
string
required
The currency code (e.g., “ZAR”)
description
string
A description of the charge (e.g., “Subscription payment”)
metadata
object
Custom metadata to attach to the payment intent (e.g., subscription ID)

Response

Payment Intent Created
id
string
Unique identifier for the payment intent
merchantId
string
The merchant’s unique identifier
customerId
string
The customer’s unique identifier
paymentMethodId
string
The payment method’s unique identifier
amount
number
The charge amount
currency
string
The currency code
description
string
Description of the charge
status
string
Payment status (processing, succeeded, failed)
metadata
object
Custom metadata attached to the payment intent
createdAt
string
ISO 8601 timestamp when the intent was created
updatedAt
string
ISO 8601 timestamp when the intent was last updated

Example Request

{
  "customerId": "customer_789",
  "paymentMethodId": "pm_001",
  "amount": 5000,
  "currency": "ZAR",
  "description": "Subscription payment",
  "metadata": {
    "subscriptionId": "sub_123"
  }
}

Example Response

{
  "id": "pi_001",
  "merchantId": "merchant_456",
  "customerId": "customer_789",
  "paymentMethodId": "pm_001",
  "amount": 5000,
  "currency": "ZAR",
  "description": "Subscription payment",
  "status": "processing",
  "metadata": {
    "subscriptionId": "sub_123"
  },
  "createdAt": "2025-01-15T10:30:00.000Z",
  "updatedAt": "2025-01-15T10:30:00.000Z"
}

Error Responses

Bad Request
Invalid request body
Unauthorized
Invalid or missing authentication token
Payment Required
Payment declined
Not Found
Customer or payment method not found
Internal Server Error
An unexpected error occurred on the server

Authentication

This endpoint requires Bearer token authentication.