cURL
The following cURL request can be used to test the API PUT endpoint on the demo environment.
You will need the following variables obtained from PaySuite.
- {{API_KEY}}
- {{MERCHANT_ID}}
- {{PAYMENT_LINK_ID}} - The UUID of the payment link to record the offline payment against
Record Full Offline Payment
curl --location --request PUT 'https://group.pay.accessacloud.com/paylinks-payment-demo/api/v1/paymentLinks/{{PAYMENT_LINK_ID}}/offline-payment' \
--header 'Content-Type: application/json' \
--header 'x-api-key: {{API_KEY}}' \
--header 'merchantId: {{MERCHANT_ID}}' \
--data '{
"amount": 125000,
"externalPaymentReference": "BACS-20241016-001"
}'
Record Partial Offline Payment (Without Reference)
curl --location --request PUT 'https://group.pay.accessacloud.com/paylinks-payment-demo/api/v1/paymentLinks/{{PAYMENT_LINK_ID}}/offline-payment' \
--header 'Content-Type: application/json' \
--header 'x-api-key: {{API_KEY}}' \
--header 'merchantId: {{MERCHANT_ID}}' \
--data '{
"amount": 50000
}'
Record Offline Payment Allocated to Line Items
The sum of the item amount values must equal the top-level amount.
curl --location --request PUT 'https://group.pay.accessacloud.com/paylinks-payment-demo/api/v1/paymentLinks/{{PAYMENT_LINK_ID}}/offline-payment' \
--header 'Content-Type: application/json' \
--header 'x-api-key: {{API_KEY}}' \
--header 'merchantId: {{MERCHANT_ID}}' \
--data '{
"amount": 120000,
"externalPaymentReference": "BACS-20241016-002",
"items": [
{
"id": "9b2e7c14-4f1a-4d3b-8a21-6c0f5e2d1a77",
"amount": 80000
},
{
"id": "2f5a8d90-7c33-49e2-b1d4-3e6a9c0b2f18",
"amount": 40000
}
]
}'