Skip to main content

cURL

The following cURL requests can be used to test the batch API endpoint on the demo environment.

You will need the following variables obtained from PaySuite.

  • {{API_KEY}}
  • {{MERCHANT_ID}}

Full Example​

curl --location 'https://group.pay.accessacloud.com/paylinks-payment-demo/api/v1/paymentLinks/batch' \
--header 'Content-Type: application/json' \
--header 'x-api-key: {{API_KEY}}' \
--data '{
"merchants": [
{
"merchantId": "{{MERCHANT_ID}}",
"paymentLinks": [
{
"customer": {
"name": "John Smith",
"email": "[email protected]"
},
"description": "Invoice #INV-2024-101",
"externalReference": "INV-2024-101",
"amounts": {
"currency": "GBP",
"total": 125000
},
"dates": {
"requestedDate": "2024-10-16T00:00:00Z"
},
"items": [
{
"description": "Consulting Services",
"quantity": 1,
"unitPrice": 125000,
"amount": 125000
}
]
},
{
"customer": {
"name": "Jane Wilson",
"email": "[email protected]"
},
"description": "Invoice #INV-2024-102",
"externalReference": "INV-2024-102",
"amounts": {
"currency": "GBP",
"total": 75000
},
"dates": {
"requestedDate": "2024-10-16T00:00:00Z"
},
"items": [
{
"description": "Web Development Services",
"quantity": 1,
"unitPrice": 75000,
"amount": 75000
}
]
}
]
}
]
}'

Idempotent Request (Safe to Retry)​

Supply an Idempotency-Key header with a unique value per logical batch. Retrying the exact same request with the same key returns the stored response without creating the links again.

curl --location 'https://group.pay.accessacloud.com/paylinks-payment-demo/api/v1/paymentLinks/batch' \
--header 'Content-Type: application/json' \
--header 'x-api-key: {{API_KEY}}' \
--header 'Idempotency-Key: 6f9619ff-8b86-d011-b42d-00cf4fc964ff' \
--data '{
"merchants": [
{
"merchantId": "{{MERCHANT_ID}}",
"paymentLinks": [
{
"customer": {
"name": "John Smith",
"email": "[email protected]"
},
"description": "Invoice #INV-2024-101",
"externalReference": "INV-2024-101",
"amounts": {
"currency": "GBP",
"total": 125000
},
"dates": {
"requestedDate": "2024-10-16T00:00:00Z"
},
"items": [
{
"description": "Consulting Services",
"quantity": 1,
"unitPrice": 125000,
"amount": 125000
}
]
}
]
}
]
}'