Download OpenAPI specification:
Invoicing, payment capture, and refunds for B2B billing.
The Ledger API is a resource-oriented HTTP API for issuing invoices, capturing payments against them, and refunding captured funds.
date-time values in UTC with a
Z offset (for example, 2026-09-01T14:32:07Z).Money object
holding an integer amount in the currency's minor unit and an ISO 4217
currency code. See the Money schema for the zero-decimal and
three-decimal currency rules.inv_, pay_, ref_, cus_). Do not parse them, infer ordering from
them, or assume a fixed length beyond the documented maximum.The major version is pinned in the path (/v1). Backward-incompatible
changes ship as a new dated release, which an integration opts into with
the Ledger-Version header. Omitting the header pins the request to the
release that was current when the account's first API call was made, so an
unmaintained integration never breaks silently.
Adding an optional request field, a response field, an enum member to a response, or a new operation or webhook is not treated as breaking. Additive changes reach every pinned release on the day they ship. Clients must ignore unrecognized response fields and must tolerate unrecognized enum members rather than failing closed.
Errors use application/problem+json as defined in RFC 9457. A declined
payment is not an HTTP error; see the Payment schema.
An invoice is a request for payment. It moves through an explicit state
machine: draft -> open -> paid | void | uncollectible.
Only a draft invoice is mutable.
Sent when an invoice is finalized. Verify the signature before parsing
the body; see the WebhookEvent schema.
| id required | string Unique per event. Deduplicate on this. |
| object required | string Value: "event" |
| type required | string The event name, for example |
| created_at required | string <date-time> |
required | object The resource snapshot at the moment the event fired. |
{- "id": "evt_2WnF6yBk8R",
- "object": "event",
- "type": "invoice.paid",
- "created_at": "2019-08-24T14:15:22Z",
- "data": {
- "id": "inv_7TgH2ReQvA",
- "object": "invoice",
- "status": "draft",
- "invoice_number": "INV-2026-004182",
- "customer_id": "cus_9ZQx4Kp2Lm",
- "currency": "string",
- "total": {
- "amount": 4500000,
- "currency": "INR"
}, - "amount_paid": {
- "amount": 4500000,
- "currency": "INR"
}, - "amount_remaining": {
- "amount": 4500000,
- "currency": "INR"
}, - "line_items": [
- {
- "description": "string",
- "quantity": 1,
- "unit_amount": 0
}
], - "due_at": "2019-08-24T14:15:22Z",
- "created_at": "2019-08-24T14:15:22Z",
- "finalized_at": "2019-08-24T14:15:22Z",
- "voided_at": "2019-08-24T14:15:22Z",
- "void_reason": "duplicate",
- "amount_due": {
- "amount": 4500000,
- "currency": "INR"
}
}
}Sent when the sum of succeeded payments against an invoice reaches
its total. This event is the correct trigger for provisioning; do not
provision on createPayment returning processing.
| id required | string Unique per event. Deduplicate on this. |
| object required | string Value: "event" |
| type required | string The event name, for example |
| created_at required | string <date-time> |
required | object The resource snapshot at the moment the event fired. |
{- "id": "evt_2WnF6yBk8R",
- "object": "event",
- "type": "invoice.paid",
- "created_at": "2019-08-24T14:15:22Z",
- "data": {
- "id": "inv_7TgH2ReQvA",
- "object": "invoice",
- "status": "draft",
- "invoice_number": "INV-2026-004182",
- "customer_id": "cus_9ZQx4Kp2Lm",
- "currency": "string",
- "total": {
- "amount": 4500000,
- "currency": "INR"
}, - "amount_paid": {
- "amount": 4500000,
- "currency": "INR"
}, - "amount_remaining": {
- "amount": 4500000,
- "currency": "INR"
}, - "line_items": [
- {
- "description": "string",
- "quantity": 1,
- "unit_amount": 0
}
], - "due_at": "2019-08-24T14:15:22Z",
- "created_at": "2019-08-24T14:15:22Z",
- "finalized_at": "2019-08-24T14:15:22Z",
- "voided_at": "2019-08-24T14:15:22Z",
- "void_reason": "duplicate",
- "amount_due": {
- "amount": 4500000,
- "currency": "INR"
}
}
}Sent when an invoice moves from open to void. The invoice in
data carries void_reason.
| id required | string Unique per event. Deduplicate on this. |
| object required | string Value: "event" |
| type required | string The event name, for example |
| created_at required | string <date-time> |
required | object The resource snapshot at the moment the event fired. |
{- "id": "evt_2WnF6yBk8R",
- "object": "event",
- "type": "invoice.paid",
- "created_at": "2019-08-24T14:15:22Z",
- "data": {
- "id": "inv_7TgH2ReQvA",
- "object": "invoice",
- "status": "draft",
- "invoice_number": "INV-2026-004182",
- "customer_id": "cus_9ZQx4Kp2Lm",
- "currency": "string",
- "total": {
- "amount": 4500000,
- "currency": "INR"
}, - "amount_paid": {
- "amount": 4500000,
- "currency": "INR"
}, - "amount_remaining": {
- "amount": 4500000,
- "currency": "INR"
}, - "line_items": [
- {
- "description": "string",
- "quantity": 1,
- "unit_amount": 0
}
], - "due_at": "2019-08-24T14:15:22Z",
- "created_at": "2019-08-24T14:15:22Z",
- "finalized_at": "2019-08-24T14:15:22Z",
- "voided_at": "2019-08-24T14:15:22Z",
- "void_reason": "duplicate",
- "amount_due": {
- "amount": 4500000,
- "currency": "INR"
}
}
}Returns a page of invoices for the authenticated account, newest first
by created_at. Pagination is cursor based; see the cursor parameter.
| limit | integer <int32> [ 1 .. 100 ] Default: 20 Maximum number of records to return in one page. |
| cursor | string <= 512 characters An opaque cursor from the Cursor pagination is used instead of numeric offsets so that records created during a long walk neither shift results nor cause a record to be skipped. |
| status | string (InvoiceStatus) Enum: "draft" "open" "paid" "void" "uncollectible" Return only invoices in this state. Omit to return all states. |
| customer_id | string <= 64 characters ^cus_[A-Za-z0-9]{1,58}$ Return only invoices billed to this customer. |
| Ledger-Version | string <date> Example: 2026-09-01 Pins the request to a dated API release, for example |
{- "object": "list",
- "data": [
- {
- "id": "inv_7TgH2ReQvA",
- "object": "invoice",
- "status": "draft",
- "invoice_number": "INV-2026-004182",
- "customer_id": "cus_9ZQx4Kp2Lm",
- "currency": "string",
- "total": {
- "amount": 4500000,
- "currency": "INR"
}, - "amount_paid": {
- "amount": 4500000,
- "currency": "INR"
}, - "amount_remaining": {
- "amount": 4500000,
- "currency": "INR"
}, - "line_items": [
- {
- "description": "string",
- "quantity": 1,
- "unit_amount": 0
}
], - "due_at": "2019-08-24T14:15:22Z",
- "created_at": "2019-08-24T14:15:22Z",
- "finalized_at": "2019-08-24T14:15:22Z",
- "voided_at": "2019-08-24T14:15:22Z",
- "void_reason": "duplicate",
- "amount_due": {
- "amount": 4500000,
- "currency": "INR"
}
}
], - "has_more": true,
- "next_cursor": "string"
}Creates an invoice in the draft state. A draft invoice is not visible
to the customer, accrues no dunning, and can be edited with
updateInvoice or removed with deleteInvoice. Call
finalizeInvoice to issue it.
This operation is not idempotent by HTTP method, so an
Idempotency-Key header is required. See the header description
for replay and conflict semantics.
| Ledger-Version | string <date> Example: 2026-09-01 Pins the request to a dated API release, for example |
| Idempotency-Key required | string [ 16 .. 255 ] characters Example: 8f14e45f-ea1b-4c2d-9a35-7b1d6e0c3a92 A client-generated unique key that makes this Semantics:
The key is scoped to the account and the endpoint. The same key may be
used on |
| customer_id required | string^cus_[A-Za-z0-9]{1,58}$ The customer to bill. |
| currency required | string^[A-Z]{3}$ ISO 4217 code. Cannot be changed after creation. |
| due_at | string or null <date-time> When payment falls due. Must be in the future at finalization time, not at creation time; a draft may sit past its own due date. |
required | Array of objects (InvoiceLineItem) [ 1 .. 250 ] items |
{- "customer_id": "cus_9ZQx4Kp2Lm",
- "currency": "INR",
- "due_at": "2026-10-01T00:00:00Z",
- "line_items": [
- {
- "description": "Platform subscription, September 2026",
- "quantity": 1,
- "unit_amount": 4500000
}, - {
- "description": "Overage, 12 GB egress",
- "quantity": 12,
- "unit_amount": 85000
}
]
}{- "id": "inv_7TgH2ReQvA",
- "object": "invoice",
- "status": "draft",
- "invoice_number": "INV-2026-004182",
- "customer_id": "cus_9ZQx4Kp2Lm",
- "currency": "string",
- "total": {
- "amount": 4500000,
- "currency": "INR"
}, - "amount_paid": {
- "amount": 4500000,
- "currency": "INR"
}, - "amount_remaining": {
- "amount": 4500000,
- "currency": "INR"
}, - "line_items": [
- {
- "description": "string",
- "quantity": 1,
- "unit_amount": 0
}
], - "due_at": "2019-08-24T14:15:22Z",
- "created_at": "2019-08-24T14:15:22Z",
- "finalized_at": "2019-08-24T14:15:22Z",
- "voided_at": "2019-08-24T14:15:22Z",
- "void_reason": "duplicate",
- "amount_due": {
- "amount": 4500000,
- "currency": "INR"
}
}Returns a single invoice. The response carries an ETag, which you
must supply as If-Match when updating the invoice.
| invoice_id required | string <= 64 characters ^inv_[A-Za-z0-9]{1,58}$ The invoice identifier, for example |
| Ledger-Version | string <date> Example: 2026-09-01 Pins the request to a dated API release, for example |
{- "id": "inv_7TgH2ReQvA",
- "object": "invoice",
- "status": "draft",
- "invoice_number": "INV-2026-004182",
- "customer_id": "cus_9ZQx4Kp2Lm",
- "currency": "string",
- "total": {
- "amount": 4500000,
- "currency": "INR"
}, - "amount_paid": {
- "amount": 4500000,
- "currency": "INR"
}, - "amount_remaining": {
- "amount": 4500000,
- "currency": "INR"
}, - "line_items": [
- {
- "description": "string",
- "quantity": 1,
- "unit_amount": 0
}
], - "due_at": "2019-08-24T14:15:22Z",
- "created_at": "2019-08-24T14:15:22Z",
- "finalized_at": "2019-08-24T14:15:22Z",
- "voided_at": "2019-08-24T14:15:22Z",
- "void_reason": "duplicate",
- "amount_due": {
- "amount": 4500000,
- "currency": "INR"
}
}Applies a partial update to a draft invoice. Attempting to update an
invoice in any other state returns 422 with the
invoice_not_editable error code.
If-Match is required. Send the ETag from your most recent read
of the invoice. If the invoice has changed since that read, the request
is rejected with 412 and nothing is written. This makes concurrent
edits from two operators fail loudly instead of silently overwriting
one another.
| invoice_id required | string <= 64 characters ^inv_[A-Za-z0-9]{1,58}$ The invoice identifier, for example |
| Ledger-Version | string <date> Example: 2026-09-01 Pins the request to a dated API release, for example |
| If-Match required | string Example: "a7f3c1e9b2d4" The |
| due_at | string or null <date-time> |
Array of objects (InvoiceLineItem) [ 1 .. 250 ] items |
{- "due_at": "2026-10-15T00:00:00Z"
}{- "id": "inv_7TgH2ReQvA",
- "object": "invoice",
- "status": "draft",
- "invoice_number": "INV-2026-004182",
- "customer_id": "cus_9ZQx4Kp2Lm",
- "currency": "string",
- "total": {
- "amount": 4500000,
- "currency": "INR"
}, - "amount_paid": {
- "amount": 4500000,
- "currency": "INR"
}, - "amount_remaining": {
- "amount": 4500000,
- "currency": "INR"
}, - "line_items": [
- {
- "description": "string",
- "quantity": 1,
- "unit_amount": 0
}
], - "due_at": "2019-08-24T14:15:22Z",
- "created_at": "2019-08-24T14:15:22Z",
- "finalized_at": "2019-08-24T14:15:22Z",
- "voided_at": "2019-08-24T14:15:22Z",
- "void_reason": "duplicate",
- "amount_due": {
- "amount": 4500000,
- "currency": "INR"
}
}Permanently deletes a draft invoice. A draft has no
invoice_number, so deleting it leaves no gap in the sequence.
Only a draft can be deleted. An invoice in any other state returns
422 with invoice_not_editable; cancel an open invoice with
voidInvoice instead, which keeps it on record.
Deleting is idempotent by method. Repeating the call after a
successful delete returns 404, which a retry loop should treat as
confirmation rather than failure.
| invoice_id required | string <= 64 characters ^inv_[A-Za-z0-9]{1,58}$ The invoice identifier, for example |
| Ledger-Version | string <date> Example: 2026-09-01 Pins the request to a dated API release, for example |
{- "title": "Invalid API key",
- "status": 401,
- "code": "invalid_api_key",
- "detail": "The provided key is not valid for this environment.",
- "request_id": "req_8Kd2PqL4vN"
}Transitions an invoice from draft to open, freezing its line items
and assigning a sequential, gapless invoice_number for the account's
current financial year.
Finalizing is the point at which the invoice becomes a legal document in most jurisdictions. After this call the line items cannot be edited; correct a finalized invoice by voiding it and issuing a new one, or by issuing a credit note.
This operation is effectively idempotent by state: calling it on an
invoice that is already open returns 200 with the unchanged
invoice rather than an error. Calling it on a paid, void, or
uncollectible invoice returns 422 with invoice_not_editable.
| invoice_id required | string <= 64 characters ^inv_[A-Za-z0-9]{1,58}$ The invoice identifier, for example |
| Ledger-Version | string <date> Example: 2026-09-01 Pins the request to a dated API release, for example |
| Idempotency-Key | string [ 16 .. 255 ] characters Optional here, because this operation is already idempotent by state:
repeating it against a resource that has already made the transition
returns the current resource unchanged. Supply a key anyway if you want
the stored-response guarantee described on |
{- "id": "inv_7TgH2ReQvA",
- "object": "invoice",
- "status": "draft",
- "invoice_number": "INV-2026-004182",
- "customer_id": "cus_9ZQx4Kp2Lm",
- "currency": "string",
- "total": {
- "amount": 4500000,
- "currency": "INR"
}, - "amount_paid": {
- "amount": 4500000,
- "currency": "INR"
}, - "amount_remaining": {
- "amount": 4500000,
- "currency": "INR"
}, - "line_items": [
- {
- "description": "string",
- "quantity": 1,
- "unit_amount": 0
}
], - "due_at": "2019-08-24T14:15:22Z",
- "created_at": "2019-08-24T14:15:22Z",
- "finalized_at": "2019-08-24T14:15:22Z",
- "voided_at": "2019-08-24T14:15:22Z",
- "void_reason": "duplicate",
- "amount_due": {
- "amount": 4500000,
- "currency": "INR"
}
}Transitions an open invoice to void. A voided invoice is cancelled
and will not be collected, but it is never deleted and its
invoice_number is never reused, because reusing or removing a number
would break the gapless sequence that auditors rely on.
An invoice with any succeeded payment against it cannot be voided;
refund the payments first. That attempt returns 422 with
invoice_has_payments.
| invoice_id required | string <= 64 characters ^inv_[A-Za-z0-9]{1,58}$ The invoice identifier, for example |
| Ledger-Version | string <date> Example: 2026-09-01 Pins the request to a dated API release, for example |
| Idempotency-Key | string [ 16 .. 255 ] characters Optional here, because this operation is already idempotent by state:
repeating it against a resource that has already made the transition
returns the current resource unchanged. Supply a key anyway if you want
the stored-response guarantee described on |
| reason | string Enum: "duplicate" "fraudulent" "issued_in_error" "other" Why the invoice is being voided. Returned as |
{- "reason": "duplicate"
}{- "id": "inv_7TgH2ReQvA",
- "object": "invoice",
- "status": "draft",
- "invoice_number": "INV-2026-004182",
- "customer_id": "cus_9ZQx4Kp2Lm",
- "currency": "string",
- "total": {
- "amount": 4500000,
- "currency": "INR"
}, - "amount_paid": {
- "amount": 4500000,
- "currency": "INR"
}, - "amount_remaining": {
- "amount": 4500000,
- "currency": "INR"
}, - "line_items": [
- {
- "description": "string",
- "quantity": 1,
- "unit_amount": 0
}
], - "due_at": "2019-08-24T14:15:22Z",
- "created_at": "2019-08-24T14:15:22Z",
- "finalized_at": "2019-08-24T14:15:22Z",
- "voided_at": "2019-08-24T14:15:22Z",
- "void_reason": "duplicate",
- "amount_due": {
- "amount": 4500000,
- "currency": "INR"
}
}A payment is an attempt to move funds against an open invoice. Creating
a payment always succeeds at the HTTP layer if the request is well
formed; the outcome of the attempt is carried in Payment.status.
Sent when a payment reaches succeeded, whether it was created in
that state or left processing later. A payment that completes its
invoice also produces invoice.paid; provision on that event, not on
this one.
| id required | string Unique per event. Deduplicate on this. |
| object required | string Value: "event" |
| type required | string The event name, for example |
| created_at required | string <date-time> |
required | object The resource snapshot at the moment the event fired. |
{- "id": "evt_2WnF6yBk8R",
- "object": "event",
- "type": "invoice.paid",
- "created_at": "2019-08-24T14:15:22Z",
- "data": {
- "id": "pay_3MvB9kLd7Q",
- "object": "payment",
- "status": "processing",
- "invoice_id": "string",
- "amount": {
- "amount": 4500000,
- "currency": "INR"
}, - "amount_refunded": {
- "amount": 4500000,
- "currency": "INR"
}, - "amount_refund_pending": {
- "amount": 4500000,
- "currency": "INR"
}, - "failure_code": "insufficient_funds",
- "failure_message": "string",
- "created_at": "2019-08-24T14:15:22Z"
}
}Sent when a payment reaches failed, whether it was created in that
state or left processing later. The invoice remains open and
collectible.
| id required | string Unique per event. Deduplicate on this. |
| object required | string Value: "event" |
| type required | string The event name, for example |
| created_at required | string <date-time> |
required | object The resource snapshot at the moment the event fired. |
{- "id": "evt_2WnF6yBk8R",
- "object": "event",
- "type": "invoice.paid",
- "created_at": "2019-08-24T14:15:22Z",
- "data": {
- "id": "pay_3MvB9kLd7Q",
- "object": "payment",
- "status": "processing",
- "invoice_id": "string",
- "amount": {
- "amount": 4500000,
- "currency": "INR"
}, - "amount_refunded": {
- "amount": 4500000,
- "currency": "INR"
}, - "amount_refund_pending": {
- "amount": 4500000,
- "currency": "INR"
}, - "failure_code": "insufficient_funds",
- "failure_message": "string",
- "created_at": "2019-08-24T14:15:22Z"
}
}Attempts to capture funds against an open invoice.
A declined payment is a 201, not a 4xx. The HTTP status
describes whether the API understood and accepted your request; it does
not describe the commercial outcome of the attempt. A card decline, an
insufficient-funds response, or a bank rejection all produce a
Payment resource in the failed state with failure_code and
failure_message populated. Branch on status, never on the status
code, to decide what to tell the payer.
Some payment methods settle asynchronously. Those return a payment in
the processing state; the terminal outcome arrives on the
payment.succeeded or payment.failed webhook. Build on the
webhooks, and use getPayment to reconcile a payment whose event
you suspect you missed, not as a polling loop.
| Ledger-Version | string <date> Example: 2026-09-01 Pins the request to a dated API release, for example |
| Idempotency-Key required | string [ 16 .. 255 ] characters Example: 8f14e45f-ea1b-4c2d-9a35-7b1d6e0c3a92 A client-generated unique key that makes this Semantics:
The key is scoped to the account and the endpoint. The same key may be
used on |
| invoice_id required | string^inv_[A-Za-z0-9]{1,58}$ The |
required | object (Money) A monetary value.
The minor unit depends on the currency, and there is no safe default:
Do not hardcode a divisor of 100 when formatting for display. |
| payment_method_id required | string^pm_[A-Za-z0-9]{1,58}$ A stored payment method belonging to the invoice customer. |
{- "invoice_id": "inv_7TgH2ReQvA",
- "amount": {
- "amount": 5520000,
- "currency": "INR"
}, - "payment_method_id": "pm_4KdN8xWs1B"
}{- "id": "pay_3MvB9kLd7Q",
- "object": "payment",
- "status": "processing",
- "invoice_id": "string",
- "amount": {
- "amount": 4500000,
- "currency": "INR"
}, - "amount_refunded": {
- "amount": 4500000,
- "currency": "INR"
}, - "amount_refund_pending": {
- "amount": 4500000,
- "currency": "INR"
}, - "failure_code": "insufficient_funds",
- "failure_message": "string",
- "created_at": "2019-08-24T14:15:22Z"
}Returns a single payment, including its refund totals. Read
amount_refunded and amount_refund_pending here before deciding
whether a further refund fits.
Payment outcomes are delivered by webhook. Retrieve a payment to reconcile one whose event you suspect you missed, not in a polling loop.
| payment_id required | string <= 64 characters ^pay_[A-Za-z0-9]{1,58}$ The payment identifier, for example |
| Ledger-Version | string <date> Example: 2026-09-01 Pins the request to a dated API release, for example |
{- "id": "pay_3MvB9kLd7Q",
- "object": "payment",
- "status": "processing",
- "invoice_id": "string",
- "amount": {
- "amount": 4500000,
- "currency": "INR"
}, - "amount_refunded": {
- "amount": 4500000,
- "currency": "INR"
}, - "amount_refund_pending": {
- "amount": 4500000,
- "currency": "INR"
}, - "failure_code": "insufficient_funds",
- "failure_message": "string",
- "created_at": "2019-08-24T14:15:22Z"
}A refund returns captured funds to the payer. Refunds are only valid
against a payment in the succeeded state.
Sent when a refund leaves processing for succeeded. Its amount
moves from amount_refund_pending to amount_refunded on the
payment.
| id required | string Unique per event. Deduplicate on this. |
| object required | string Value: "event" |
| type required | string The event name, for example |
| created_at required | string <date-time> |
required | object The resource snapshot at the moment the event fired. |
{- "id": "evt_2WnF6yBk8R",
- "object": "event",
- "type": "invoice.paid",
- "created_at": "2019-08-24T14:15:22Z",
- "data": {
- "id": "ref_5QpZ1nTc6E",
- "object": "refund",
- "status": "processing",
- "payment_id": "string",
- "amount": {
- "amount": 4500000,
- "currency": "INR"
}, - "reason": "duplicate",
- "created_at": "2019-08-24T14:15:22Z",
- "settled_at": "2019-08-24T14:15:22Z"
}
}Sent when a refund leaves processing for failed. No funds moved,
and the amount it reserved is released back to the payment's refund
headroom.
| id required | string Unique per event. Deduplicate on this. |
| object required | string Value: "event" |
| type required | string The event name, for example |
| created_at required | string <date-time> |
required | object The resource snapshot at the moment the event fired. |
{- "id": "evt_2WnF6yBk8R",
- "object": "event",
- "type": "invoice.paid",
- "created_at": "2019-08-24T14:15:22Z",
- "data": {
- "id": "ref_5QpZ1nTc6E",
- "object": "refund",
- "status": "processing",
- "payment_id": "string",
- "amount": {
- "amount": 4500000,
- "currency": "INR"
}, - "reason": "duplicate",
- "created_at": "2019-08-24T14:15:22Z",
- "settled_at": "2019-08-24T14:15:22Z"
}
}Returns funds to the payer. Only a succeeded payment can be
refunded; any other state returns 422 with
payment_not_refundable. Omit amount to refund everything not
already refunded or pending.
A refund is accepted only if its amount fits within the payment's
refund headroom, amount - amount_refunded - amount_refund_pending.
Refunds still processing count against that headroom, and the check
and the reservation are a single atomic step, so two concurrent
requests cannot both claim the same amount. A request that does not
fit is rejected with 422 and refund_amount_exceeded. If a pending
refund ends failed, its amount is released and can be refunded
again.
This is the behavior from release 2026-09-01. Earlier releases did not
count processing refunds, so concurrent partial refunds could
together exceed the payment. The release notes and the 2026-09-01
migration guide describe the change.
Refunding the full amount of the only payment on an invoice does not
reopen the invoice. Its state remains paid.
| payment_id required | string <= 64 characters ^pay_[A-Za-z0-9]{1,58}$ The payment identifier, for example |
| Ledger-Version | string <date> Example: 2026-09-01 Pins the request to a dated API release, for example |
| Idempotency-Key required | string [ 16 .. 255 ] characters Example: 8f14e45f-ea1b-4c2d-9a35-7b1d6e0c3a92 A client-generated unique key that makes this Semantics:
The key is scoped to the account and the endpoint. The same key may be
used on |
object (Money) A monetary value.
The minor unit depends on the currency, and there is no safe default:
Do not hardcode a divisor of 100 when formatting for display. | |
| reason | string Enum: "duplicate" "fraudulent" "requested_by_customer" |
{- "amount": {
- "amount": 1020000,
- "currency": "INR"
}, - "reason": "requested_by_customer"
}{- "id": "ref_5QpZ1nTc6E",
- "object": "refund",
- "status": "processing",
- "payment_id": "string",
- "amount": {
- "amount": 4500000,
- "currency": "INR"
}, - "reason": "duplicate",
- "created_at": "2019-08-24T14:15:22Z",
- "settled_at": "2019-08-24T14:15:22Z"
}Returns a single refund. status says whether it has reached a
terminal state, and settled_at says when.
The refund.succeeded and refund.failed webhooks deliver the same
transition without a request. Retrieve a refund when you need its
current state on demand, for example to confirm that one refund has
finished before issuing the next against the same payment.
| refund_id required | string <= 64 characters ^ref_[A-Za-z0-9]{1,58}$ The refund identifier, for example |
| Ledger-Version | string <date> Example: 2026-09-01 Pins the request to a dated API release, for example |
{- "id": "ref_5QpZ1nTc6E",
- "object": "refund",
- "status": "processing",
- "payment_id": "string",
- "amount": {
- "amount": 4500000,
- "currency": "INR"
}, - "reason": "duplicate",
- "created_at": "2019-08-24T14:15:22Z",
- "settled_at": "2019-08-24T14:15:22Z"
}