One-time payments · After payment
Refunds
Protocol: JSON v3 · XML 2.9OpenAPI
Refund a paid invoice: request, status and notification.
A refund is created for an invoice. The amount and reason are sent in the request; the result arrives as a refund.updated notification.
Create a refund
curl -X POST "https://pay-api.digitalspb.com/api/v3/projects/YOUR_PROJECT_ID/invoices/{invoiceId}/refund" \ -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.
202
{ "success": true, "data": { "invoice_id": "1624505c-0031-00cf-7d54-4cf1ce08cb30", "refund_status": "processing" }}HTTP 202 means the refund was accepted for processing, not that the money has already been returned. The final status is in refund_status or the refund.updated event.
Wait for the notification
Do not treat the refund as complete based on the request response. Wait for refund.updated or fetch the invoice by id.