One-time payments · After payment
Cancel an invoice
Protocol: JSON v3 · XML 2.9OpenAPI
Cancel an unpaid invoice before it expires.
An invoice can be cancelled while it is unpaid. Cancellation releases the hold and moves the invoice to Cancelled.
Cancel the invoice
curl -X POST "https://pay-api.digitalspb.com/api/v3/projects/YOUR_PROJECT_ID/invoices/{invoiceId}/cancel" \ -H "Content-Type: application/json" \ -H "X-Login: YOUR_LOGIN" \ -H "X-Timestamp: YOUR_TIMESTAMP" \ -H "X-Signature-Version: 3" \ -H "X-Signature: YOUR_SIGNATURE" \ -d '{ "client_ip": "10.20.30.40"}'Read-only example. Runnable examples are available in the Sandbox section.
200
{ "success": true, "data": { "invoice_id": "1624505c-0031-00cf-7d54-4cf1ce08cb30", "status": "cancelled" }}The cancellation result arrives as a payment.updated event with status: "Cancelled" and payment_status: "NOT_PAID". Do not cancel a paid invoice — use a refund instead.