curl --request POST \
--url https://api.cashful.africa/api/canary/payment-links \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"totalAmount": 123,
"currency": "<string>",
"mode": "payment",
"successUrl": "<string>",
"cancelUrl": "<string>",
"metadata": {
"orderId": "12345",
"customField": "value"
}
}
'{
"id": "plink_001",
"name": "Summer Sale Link",
"description": "Payment link for the summer sale campaign",
"merchantId": "merchant_456",
"url": "https://checkout.cashful.africa/plink_001",
"totalAmount": 15000,
"currency": "ZAR",
"mode": "payment",
"active": true,
"successUrl": "https://example.com/success",
"cancelUrl": "https://example.com/cancel",
"lineItems": [
{
"name": "Product A",
"amount": 15000,
"quantity": 1,
"currency": "ZAR"
}
],
"metadata": {
"campaign": "summer_sale"
},
"createdAt": "2025-01-15T10:30:00.000Z",
"updatedAt": "2025-01-15T10:30:00.000Z",
"deletedAt": null
}Creates a re-usable hosted payment link
curl --request POST \
--url https://api.cashful.africa/api/canary/payment-links \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"totalAmount": 123,
"currency": "<string>",
"mode": "payment",
"successUrl": "<string>",
"cancelUrl": "<string>",
"metadata": {
"orderId": "12345",
"customField": "value"
}
}
'{
"id": "plink_001",
"name": "Summer Sale Link",
"description": "Payment link for the summer sale campaign",
"merchantId": "merchant_456",
"url": "https://checkout.cashful.africa/plink_001",
"totalAmount": 15000,
"currency": "ZAR",
"mode": "payment",
"active": true,
"successUrl": "https://example.com/success",
"cancelUrl": "https://example.com/cancel",
"lineItems": [
{
"name": "Product A",
"amount": 15000,
"quantity": 1,
"currency": "ZAR"
}
],
"metadata": {
"campaign": "summer_sale"
},
"createdAt": "2025-01-15T10:30:00.000Z",
"updatedAt": "2025-01-15T10:30:00.000Z",
"deletedAt": null
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Payment link details
The total amount in the smallest currency unit
The three-letter ISO 4217 currency code
The payment mode (e.g., 'payment' or 'subscription')
payment, setup, subscription The URL to redirect to on successful payment
The URL to redirect to if customer cancels
Optional custom metadata
{
"orderId": "12345",
"customField": "value"
}The name of the payment link
A description of the payment link
The ID of the merchant whose balance is being requested. If omitted, defaults to the authenticated merchant.
Array of line items for the checkout
Show child attributes
The unique identifier of the customer
Configuration for the hosted checkout page
Show child attributes
Payment link created successfully
payment, setup, subscription { "customField": "value" }Show child attributes
Configuration for the hosted checkout page
Show child attributes