API · Invoices

Refund payment

Protocol: JSON v3 · XML 2.9POST/api/v3/projects/YOUR_PROJECT_ID/invoices/{invoiceId}/refund
← All operations

Description

Initiates a refund for a paid invoice. The actual refund completes asynchronously and result is delivered via webhook.

v4 signature payload: {invoice_id}{client_ip}

XML 2.9 description

Initiates a refund for a paid invoice. XML request type: <RefundInvoiceRequest>.

This method is used by Merchant to return funds within the framework of merchant's invoice.

HTTP Headers:

  • Callisto-Protocol-Version: 2
  • SignatureVersion: 3

Request and response

Examples come from OpenAPI and are read-only here. Run requests in the Sandbox section.

POST/api/v3/projects/YOUR_PROJECT_ID/invoices/{invoiceId}/refundPRODUCTION
Request
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"  }}

JSON v3 request fields

Invoices_Refund
Request fieldsTypeReq.Description
client_ipstringoptional
additional_parametersobjectoptional

Arbitrary invoice parameters stored with the invoice, the JSON counterpart of the XML <AdditionalParameters>/<Parameter name= value=/> block. Parameter names are case-insensitive and must be unique. On cancel/refund/authorize the given values are merged into the ones already stored: names that match are overwritten, the rest are kept.

XML 2.9 request fields

refundInvoice
Request fieldsTypeReq.Description
RefundInvoiceRequestobject & objectrequired
ProjectIDinteger (int32)required

Project ID in the Platform system. Assigned during project setup.

ClientIPstringoptional

IP address from which the client makes the request. Mandatory by default (configurable in project settings).

InvoiceInfoobjectrequired+6
Headerobjectrequired

Request header with authentication. Included in every API request.

Authenticationobjectrequired

Request authentication data. All three fields are mandatory for every request.

+3
RequestAttemptinteger (int32)optional

Ordinal invoice request number (for idempotency). Starting from 0.

Gatewayobjectoptional+3

Parameters and headers

NameInRequiredDescription
projectIdpathyesProject ID assigned by the platform during onboarding.
invoiceIdpathyesInvoice UUID assigned by the platform.

Responses

202
Refund accepted for processingexample
400
401
403
500
503

Full error codes are in Error codes.