Payment Links
5 min
A payment link is the simplest way to request payment from a customer. Here's how it works:
- Create a payment link by supplying a transaction amount (the amount you wish to request).
- Provide your submerchant ID. For operators, you can supply the submerchant ID of the account who should receive the transaction, for example a driver who has been allocated to a booking.
- Choose for us to send the payment link directly to your customer by SMS, or if you prefer you can send the URL to your customer via another channel.
- The customer can open the link using any web browser, on any device, and make payment by entering their payment details.
- You can view the status of a payment link by polling the API, or alternatively use our Webhooks feature to be notified programatically when a payment link is completed.
API Operations
Create a Payment Link
Use this endpoint to create a payment link. You can optionally send it to your customer.
The only required parameters are: saleAmount and submerchantId. Note that transaction amounts should always be specified in currency minor units (for example pence).
POST
https://api.cabcard.services/v1/intents
Body Parameters
- saleAmountIntegerrequiredDescription
- submerchantIdStringrequiredDescription
- currencystringDescription
- customerNamestringDescription
- customerPhoneNumberstringDescription
- descriptionstringDescription
- referencestringDescription
- sendCustomerSmsBooleanDescription
nodejs
const fetch = require('node-fetch');
const url = 'https://api.cabcard.services/v1/intents';
const body = {
"saleAmount": 1259,
"currency": "gbp",
"submerchantId": "sub_2t4dp89kja9fnf79",
"description": "Payment request for taxi journey",
"reference": "EXMPL-01",
"customerName": "John Smith",
"brandIdentifier": "sub_2t4dp89kja9fnf79",
"customerPhoneNumber": "+447763306128",
"sendCustomerSms": true,
"expiryNaturalLanguage": "7 days"
};
const options = {
method: 'POST',
headers: {
Accept: 'application/json',
},
body: JSON.stringify(body),
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error('error:' + err));201
{
"statusIsFinal":false,
"clientAccessUrl":"https://pay.cabcard.services/?p=int_l3bj84mc&t=c7e4a40c552e4cc6a9c872fc54198c91",
"clientAccessQrCode":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAOEAAADhCAAAAAAb2I2mAAACrElEQVR42u3bwXLqMAwF0P7/T7+37xD3XhuInTlZlQESHS9UWxI//55+/RASEhISEhISEhISEhISEhKeK/z5+/r14cuX45u+euPV1/qoCAkJzxBeJ6cXpF9xXAb4nltVMRMSEm4vvMx96TODoNM7p1EREhI+UHi5k3v1uTEz3R4SEhISXiTUKsmOt32EhITPElbPrOpF6V3uPQETEhJ+WPieKN/915er+oSEhJ8Txi3yq3pR8ODggLnBpAIhIeHnhEH+Cvpn43Z9eiCsYiEkJDxNOI43zXhV8boqTMUHR0JCwj2FQSZLC+R95Sjo8ne5mZCQcHdhf1ib3NgF65lu9ggJCc8Qzt5r7icZaZe//60GISHhQcJgBDFIe9XAT/DGes2bkJDwVuG4xJzWi6r9W7oIfT+OkJBwU+FK7blfhJXa+FJVn5CQ8FZhH/Q43mrCsa9Ozf63ICQkvFXYjxpXIVQBrr9LSEi4sbDaW6WZsT9Cjl8mJXpCQsI9heMbpvuyNAtWXf6+GE5ISLipcLJtHiTUKmWmaXSpf0hISHirMOinT04QdgM/f68nISHhkcJqI9aPPY9DDUrg3aISEhLuKUwbYUHBKWjerYwJEBISPkEYnPbSnPae/eDEIwkJCTcWpqmwn/+Z6JDVlW5CQsKDhH1XPk1x/dqlkwSEhIRHCpOEFfbY0w1gCk5mBQgJCc8RLo8zB5pgDGliNpuQkHBP4WTJeqV7H4DTbRohIeEZwip1VT+/6BtrVWuPkJDwNGHVIUu/Vg0BVUmWkJDwXOHk2FBft+7Ph2/KpYSEhE8RVs2xyaY/ISHh84XpDSbXqe/3ExISHiScLBUFlemgQ/aVXEpISHircGWIebnmPR4M+l5Vn5CQ8HPCR12EhISEhISEhISEhISEhISEZ1z/AUNjh4Bw0sgFAAAAAElFTkSuQmCC",
"receiptUrl":null,
"id":"int_l3bj84mc",
"customerSmsSent":true,
"customerEmailSent":false,
"saleAmount":1259,
"currency":"gbp",
"submerchantId":"sub_2t4dp89kja9fnf79",
"description":"Payment request for taxi journey",
"reference":"EXMPL-01",
"customerName":"John Smith",
"brandIdentifier":"sub_2t4dp89kja9fnf79",
"customerPhoneNumber":"+447763306128",
"gratuityAmount":0,
"gratuityEnabled":true,
"createdBy":"usr_4fsacblknri74u8",
"expiresAt":"2022-05-25T12:00:12.770Z",
"paymentFacilitatorId":"pfc_3q12hkjyo6478c",
"brand":{
"payeeName":"John Smith",
"smsSenderName":"Taxi Fleet",
"payeeAvatarUrl":"https://pay.cabcard.services/default-avatar.png",
"processorName":"CabCard Services (UK) Ltd",
"receiptContactInfo":"[email protected]",
"receiptsBaseUrl":"https://receipts.cabcard.services"
},
"logs":[
"[2022-05-18T12:00:12.900Z] Created by: usr_4fsacblknri74u8",
"[2022-05-18T12:00:14.184Z] Customer SMS sent to: +447763306128"
],
"updatedAt":"2022-05-18T12:00:14.184Z",
"createdAt":"2022-05-18T12:00:12.901Z",
"clientAccessToken":"c7e4a40c552e4cc6a9c872fc54198c91",
"status":"created",
"amount":1259,
"statusExplanation":null,
"customerIpAddress":null,
"customerIpInfo":null,
"customerDeviceInfo":null,
"customerEmailAddress":null,
"threeDSecureToken":null,
"cardToken":null,
"cardTokenType":null,
"transactionDetails":null,
"saleId":null,
"succeededAt":null
}400
{
"name":"ValidationError",
"message":"Validation Failed",
"statusCode":400,
"error":"Bad Request",
"details":[
{
"saleAmount":"\"saleAmount\" is required"
}
]
}403
{
"message": "Insufficient privileges."
}401
{
"message": "Permisssion denied"
}Once created, you may wish to send the payment link directly to your customer (for example by embedding it within a message, email or invoice).
Use the clientAccessUrl property for this. Alternatively, you can use the convenient clientAccessQrCode property, which is a QR code representation of the clientAccessUrl.
Retrieve a payment link
Get a payment link by its ID
GET
https://api.cabcard.services/v1/intents/:id
Path Parameters
- idstringrequiredDescription
nodejs
const fetch = require('node-fetch');
let url = 'https://api.cabcard.services/v1/intents/int_l3bj87hv';
let options = {
method: 'GET',
headers: {
Accept: 'application/json',
}
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error('error:' + err));200
{
"statusIsFinal":false,
"clientAccessUrl":"https://pay.cabcard.services/?p=int_l3bj84mc&t=c7e4a40c552e4cc6a9c872fc54198c91",
"clientAccessQrCode":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAOEAAADhCAAAAAAb2I2mAAACrElEQVR42u3bwXLqMAwF0P7/T7+37xD3XhuInTlZlQESHS9UWxI//55+/RASEhISEhISEhISEhISEhKeK/z5+/r14cuX45u+euPV1/qoCAkJzxBeJ6cXpF9xXAb4nltVMRMSEm4vvMx96TODoNM7p1EREhI+UHi5k3v1uTEz3R4SEhISXiTUKsmOt32EhITPElbPrOpF6V3uPQETEhJ+WPieKN/915er+oSEhJ8Txi3yq3pR8ODggLnBpAIhIeHnhEH+Cvpn43Z9eiCsYiEkJDxNOI43zXhV8boqTMUHR0JCwj2FQSZLC+R95Sjo8ne5mZCQcHdhf1ib3NgF65lu9ggJCc8Qzt5r7icZaZe//60GISHhQcJgBDFIe9XAT/DGes2bkJDwVuG4xJzWi6r9W7oIfT+OkJBwU+FK7blfhJXa+FJVn5CQ8FZhH/Q43mrCsa9Ozf63ICQkvFXYjxpXIVQBrr9LSEi4sbDaW6WZsT9Cjl8mJXpCQsI9heMbpvuyNAtWXf6+GE5ISLipcLJtHiTUKmWmaXSpf0hISHirMOinT04QdgM/f68nISHhkcJqI9aPPY9DDUrg3aISEhLuKUwbYUHBKWjerYwJEBISPkEYnPbSnPae/eDEIwkJCTcWpqmwn/+Z6JDVlW5CQsKDhH1XPk1x/dqlkwSEhIRHCpOEFfbY0w1gCk5mBQgJCc8RLo8zB5pgDGliNpuQkHBP4WTJeqV7H4DTbRohIeEZwip1VT+/6BtrVWuPkJDwNGHVIUu/Vg0BVUmWkJDwXOHk2FBft+7Ph2/KpYSEhE8RVs2xyaY/ISHh84XpDSbXqe/3ExISHiScLBUFlemgQ/aVXEpISHircGWIebnmPR4M+l5Vn5CQ8HPCR12EhISEhISEhISEhISEhISEZ1z/AUNjh4Bw0sgFAAAAAElFTkSuQmCC",
"receiptUrl":null,
"id":"int_l3bj84mc",
"customerSmsSent":true,
"customerEmailSent":false,
"saleAmount":1259,
"currency":"gbp",
"submerchantId":"sub_2t4dp89kja9fnf79",
"description":"Payment request for taxi journey",
"reference":"EXMPL-01",
"customerName":"John Smith",
"brandIdentifier":"sub_2t4dp89kja9fnf79",
"customerPhoneNumber":"+447763306128",
"gratuityAmount":0,
"gratuityEnabled":true,
"createdBy":"usr_4fsacblknri74u8",
"expiresAt":"2022-05-25T12:00:12.770Z",
"paymentFacilitatorId":"pfc_3q12hkjyo6478c",
"brand":{
"payeeName":"John Smith",
"smsSenderName":"Taxi Fleet",
"payeeAvatarUrl":"https://pay.cabcard.services/default-avatar.png",
"processorName":"CabCard Services (UK) Ltd",
"receiptContactInfo":"[email protected]",
"receiptsBaseUrl":"https://receipts.cabcard.services"
},
"logs":[
"[2022-05-18T12:00:12.900Z] Created by: usr_4fsacblknri74u8",
"[2022-05-18T12:00:14.184Z] Customer SMS sent to: +447763306128"
],
"updatedAt":"2022-05-18T12:00:14.184Z",
"createdAt":"2022-05-18T12:00:12.901Z",
"clientAccessToken":"c7e4a40c552e4cc6a9c872fc54198c91",
"status":"created",
"amount":1259,
"statusExplanation":null,
"customerIpAddress":null,
"customerIpInfo":null,
"customerDeviceInfo":null,
"customerEmailAddress":null,
"threeDSecureToken":null,
"cardToken":null,
"cardTokenType":null,
"transactionDetails":null,
"saleId":null,
"succeededAt":null
}404
{
"message": "Payment Intent not found"
}List Payment Links
List all payment links, optionally filtering the list
GET
https://api.cabcard.services/v1/intents/
Query Parameters
- limitNumberDescription
- offsetNumberDescription
- submerchantIdstringDescription
- statusstringDescription
- amountNumberDescription
- referencestringDescription
javascript
fetch("https://api.cabcard.services/v1/intents", {
"method": "GET",
"headers": {
"Accept": "application/json"
}
})
.then(response => {
console.log(response);
})
.catch(err => {
console.error(err);
});200
[
{
"statusIsFinal":false,
"clientAccessUrl":"https://pay.cabcard.services/?p=int_l3bj84mc&t=c7e4a40c552e4cc6a9c872fc54198c91",
"clientAccessQrCode":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAOEAAADhCAAAAAAb2I2mAAACrElEQVR42u3bwXLqMAwF0P7/T7+37xD3XhuInTlZlQESHS9UWxI//55+/RASEhISEhISEhISEhISEhKeK/z5+/r14cuX45u+euPV1/qoCAkJzxBeJ6cXpF9xXAb4nltVMRMSEm4vvMx96TODoNM7p1EREhI+UHi5k3v1uTEz3R4SEhISXiTUKsmOt32EhITPElbPrOpF6V3uPQETEhJ+WPieKN/915er+oSEhJ8Txi3yq3pR8ODggLnBpAIhIeHnhEH+Cvpn43Z9eiCsYiEkJDxNOI43zXhV8boqTMUHR0JCwj2FQSZLC+R95Sjo8ne5mZCQcHdhf1ib3NgF65lu9ggJCc8Qzt5r7icZaZe//60GISHhQcJgBDFIe9XAT/DGes2bkJDwVuG4xJzWi6r9W7oIfT+OkJBwU+FK7blfhJXa+FJVn5CQ8FZhH/Q43mrCsa9Ozf63ICQkvFXYjxpXIVQBrr9LSEi4sbDaW6WZsT9Cjl8mJXpCQsI9heMbpvuyNAtWXf6+GE5ISLipcLJtHiTUKmWmaXSpf0hISHirMOinT04QdgM/f68nISHhkcJqI9aPPY9DDUrg3aISEhLuKUwbYUHBKWjerYwJEBISPkEYnPbSnPae/eDEIwkJCTcWpqmwn/+Z6JDVlW5CQsKDhH1XPk1x/dqlkwSEhIRHCpOEFfbY0w1gCk5mBQgJCc8RLo8zB5pgDGliNpuQkHBP4WTJeqV7H4DTbRohIeEZwip1VT+/6BtrVWuPkJDwNGHVIUu/Vg0BVUmWkJDwXOHk2FBft+7Ph2/KpYSEhE8RVs2xyaY/ISHh84XpDSbXqe/3ExISHiScLBUFlemgQ/aVXEpISHircGWIebnmPR4M+l5Vn5CQ8HPCR12EhISEhISEhISEhISEhISEZ1z/AUNjh4Bw0sgFAAAAAElFTkSuQmCC",
"receiptUrl":null,
"id":"int_l3bj84mc",
"customerSmsSent":true,
"customerEmailSent":false,
"saleAmount":1259,
"currency":"gbp",
"submerchantId":"sub_2t4dp89kja9fnf79",
"description":"Payment request for taxi journey",
"reference":"EXMPL-01",
"customerName":"John Smith",
"brandIdentifier":"sub_2t4dp89kja9fnf79",
"customerPhoneNumber":"+447763306128",
"gratuityAmount":0,
"gratuityEnabled":true,
"createdBy":"usr_4fsacblknri74u8",
"expiresAt":"2022-05-25T12:00:12.770Z",
"paymentFacilitatorId":"pfc_3q12hkjyo6478c",
"brand":{
"payeeName":"John Smith",
"smsSenderName":"Taxi Fleet",
"payeeAvatarUrl":"https://pay.cabcard.services/default-avatar.png",
"processorName":"CabCard Services (UK) Ltd",
"receiptContactInfo":"[email protected]",
"receiptsBaseUrl":"https://receipts.cabcard.services"
},
"logs":[
"[2022-05-18T12:00:12.900Z] Created by: usr_4fsacblknri74u8",
"[2022-05-18T12:00:14.184Z] Customer SMS sent to: +447763306128"
],
"updatedAt":"2022-05-18T12:00:14.184Z",
"createdAt":"2022-05-18T12:00:12.901Z",
"clientAccessToken":"c7e4a40c552e4cc6a9c872fc54198c91",
"status":"created",
"amount":1259,
"statusExplanation":null,
"customerIpAddress":null,
"customerIpInfo":null,
"customerDeviceInfo":null,
"customerEmailAddress":null,
"threeDSecureToken":null,
"cardToken":null,
"cardTokenType":null,
"transactionDetails":null,
"saleId":null,
"succeededAt":null
}
]Update a payment link
This operation can only be carried out while the payment link is in allowed statuses, usually the 'created'
PATCH
https://api.cabcard.services/v1/intents/:id
Path Parameters
- idstringrequiredDescription
Body Parameters
- saleAmountIntegerDescription
- customerNameStringDescription
- descriptionstringDescription
- referencestringDescription
- currencystringDescription
none
200
{
"name": "Cake's name",
}404
{
"message": "Payment Intent not found"
}Reset a payment link
Sometimes, a customer may get stuck when attempting a payment, for example due to 3DS problems. This function resets the authorization state of the payment link, allowing the customer to try agin.
PUT
https://api.cabcard.services/v1/intents/:id/reset
Path Parameters
- idstringrequiredDescription
curl
const fetch = require('node-fetch');
let url = 'https://api.cabcard.services/v1/intents/:id/reset';
let options = {
method: 'PUT',
headers: {
Accept: 'application/json',
}
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error('error:' + err));nodejs
fetch("https://api.cabcard.services/v1/intents/:id/reset", {
"method": "PUT",
"headers": {
"Accept": "application/json"
}
})
.then(response => {
console.log(response);
})
.catch(err => {
console.error(err);
});javascript
import requests
url = "https://api.cabcard.services/v1/intents/:id/reset"
headers = {"Accept": "application/json"}
response = requests.request("GET", url, headers=headers)
print(response.text)python
const fetch = require('node-fetch');
let url = 'https://api.cabcard.services/v1/intents/:id/reset';
let options = {method: 'PUT', headers: {Accept: 'application/json'}};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error('error:' + err));ruby
const fetch = require('node-fetch');
let url = 'https://api.cabcard.services/v1/intents/:id/reset';
let options = {method: 'PUT', headers: {Accept: 'application/json'}};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error('error:' + err));200
404
{
"message": "Payment Intent not found"
}Cancel a payment link
If you need to cancel a payment link (for example, if the price of a booking has changed and you wish to invalidate the payment request), use this operation. The customer will not be able to carry out a payment. This operation is only available if the payment link status is not final.
PUT
https://api.cabcard.services/v1/intents/:id/cancellation
Path Parameters
- idstringrequiredDescription
curl
curl --request PUT
--url https://api.cabcard.services/v1/intents/:id/cancellation
--header 'Accept: application/json'nodejs
const fetch = require('node-fetch');
let url = 'https://api.cabcard.services/v1/intents/:id/cancellation';
let options = {
method: 'PUT',
headers: {
Accept: 'application/json',
}
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error('error:' + err));javascript
fetch("https://api.cabcard.services/v1/intents/:id/cancellation", {
"method": "PUT",
"headers": {
"Accept": "application/json"
}
})
.then(response => {
console.log(response);
})
.catch(err => {
console.error(err);
});python
import requests
url = "https://api.cabcard.services/v1/intents/:id/cancellation"
headers = {"Accept": "application/json"}
response = requests.request("GET", url, headers=headers)
print(response.text)ruby
const fetch = require('node-fetch');
let url = 'https://api.cabcard.services/v1/intents/:id/cancellation';
let options = {method: 'PUT', headers: {Accept: 'application/json'}};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error('error:' + err));200
404
{
"message": "Payment Intent not found"
}Delete a payment link
If you need to delete a previously cancelled payment link, use this operation. This operation is only available if the payment link status is cancelled.
DELETE
https://api.cabcard.services/v1/intents/:id
Path Parameters
- idstringrequiredDescription
curl
curl --request PUT
--url https://api.cabcard.services/v1/intents/:id/cancellation
--header 'Accept: application/json'nodejs
const fetch = require('node-fetch');
let url = 'https://api.cabcard.services/v1/intents/:id/cancellation';
let options = {
method: 'PUT',
headers: {
Accept: 'application/json',
}
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error('error:' + err));javascript
fetch("https://api.cabcard.services/v1/intents/:id/cancellation", {
"method": "PUT",
"headers": {
"Accept": "application/json"
}
})
.then(response => {
console.log(response);
})
.catch(err => {
console.error(err);
});python
import requests
url = "https://api.cabcard.services/v1/intents/:id/cancellation"
headers = {"Accept": "application/json"}
response = requests.request("GET", url, headers=headers)
print(response.text)ruby
const fetch = require('node-fetch');
let url = 'https://api.cabcard.services/v1/intents/:id/cancellation';
let options = {method: 'PUT', headers: {Accept: 'application/json'}};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error('error:' + err));204
404
{
"message": "Payment Intent not found"
}Capture payment link authorization
Used for intents with manual capture mode
PUT
https://api.cabcard.services/v1/intents/:id/authorization/capture
Path Parameters
- idstringrequiredDescription
Body Parameters
- amountintegerDescription
curl
curl --location --globoff --request PUT 'https://api.cabcard.services/v1/intents/:id/authorization/capture/{id}' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json'nodejs
var request = require('request');
var options = {
'method': 'PUT',
'url': 'https://api.cabcard.services/v1/intents/:id/authorization/capture/{id}',
'headers': {
'Accept': 'application/json',
'Content-Type': 'application/json'
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
javascript
var myHeaders = new Headers();
myHeaders.append("Accept", "application/json");
myHeaders.append("Content-Type", "application/json");
var requestOptions = {
method: 'PUT',
headers: myHeaders,
redirect: 'follow'
};
fetch("https://api.cabcard.services/v1/intents/:id/authorization/capture/{id}", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));python
import requests
import json
url = "https://api.cabcard.services/v1/intents/:id/authorization/capture/{id}"
payload = {}
headers = {
'Accept': 'application/json',
'Content-Type': 'application/json'
}
response = requests.request("PUT", url, headers=headers, data=payload)
print(response.text)
ruby
require "uri"
require "json"
require "net/http"
url = URI("https://api.cabcard.services/v1/intents/:id/authorization/capture/{id}")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Accept"] = "application/json"
request["Content-Type"] = "application/json"
response = https.request(request)
puts response.read_body
200
400
{
"message": "Requested capture amount exceeds authorized amount"
}403
{
"message": "Not permitted to capture authorization for this payment intent"
}