Skip to content
Pay
Esc
↑↓navigate↵open⌘Jpreview

Cancel an invoice

Withdraw an open invoice. Needs the collect permission.

DELETE/invoices/{reference}

Cancels a pending invoice at the provider, and you get invoice.cancelled. RazPay checks it first: one that was paid a moment ago is recorded as paid, and the cancel is refused.

referencepathstringrequired

The invoice’s external_reference.

Response

The invoice, now cancelled.

Request
curl -X DELETE 'https://api.razpay.razonetix.com/v1/invoices/fees-term2-0042' \
  -H 'Authorization: Bearer YOUR_TOKEN'
{
  "success": true,
  "message": "invoice cancelled",
  "data": {
    "external_reference": "fees-term2-0042",
    "provider_id": "momo",
    "provider_ref": "5d1e7a2b-9c3f-4e6a-8b0d-2f4c6e8a0b1d",
    "amount": 1500,
    "currency": "SZL",
    "payer_phone": "26876123456",
    "description": "Term 2 school fees",
    "validity_seconds": 1209600,
    "status": "cancelled",
    "expires_at": 1761984000,
    "metadata": {},
    "created_at": 1760774400,
    "updated_at": 1760860800
  }
}
{ "success": false, "message": "only open invoices can be cancelled; this one is paid", "data": null }

Was this page helpful?