API · Invoices

Cancel invoice

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

Description

Cancels an active invoice.

v4 signature payload: {invoice_id}{client_ip}

XML 2.9 description

Cancels an active invoice. XML request type: <CancelInvoiceRequest>.

Cancellation of the invoice issued by the merchant.

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}/cancelPRODUCTION
Request
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"  }}

JSON v3 request fields

Invoices_Cancel
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

cancelInvoice
Request fieldsTypeReq.Description
CancelInvoiceRequestobject & 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

200
Invoice cancelledexample
400
401
403
500
503

Full error codes are in Error codes.