Cancel Lightning Payment
Cancel an unpaid Bitcoin Lightning Network invoice via the Cybrid API.
Availability
Production accessTo enable Lightning Network in production, contact the partner success team.
Overview
Invoices can only be cancelled while in state: "unpaid".
Once an invoice progresses to state: "settling" or
state: "paid", it can no longer be cancelled.
Cancel an invoice
For an invoice with state: "unpaid", cancel it via
DELETE /api/invoices/{invoice_guid}:
{
"created_at": "<created_at timestamp>",
"updated_at": "<updated_at timestamp>",
"guid": "<provided invoice GUID>",
"customer_guid": "<provided customer GUID>",
"account_guid": "<associated account GUID>",
"type": "lightning",
"asset": "USD",
"receive_amount": 100,
"deliver_amount": 100,
"fee": 0,
"state": "cancelling",
"labels": null
}The initial response shows state: "cancelling".
Poll GET /api/invoices/{invoice_guid} to confirm the invoice
reaches state: "cancelled":
{
"created_at": "<created_at timestamp>",
"updated_at": "<updated_at timestamp>",
"guid": "<provided invoice GUID>",
"customer_guid": "<provided customer GUID>",
"account_guid": "<associated account GUID>",
"type": "lightning",
"asset": "USD",
"receive_amount": 100,
"deliver_amount": 100,
"fee": 0,
"state": "cancelled",
"labels": null
}Once an invoice is state: "cancelled", payment instructions can
no longer be generated for it.
Updated 12 days ago
