Skip to navigation

Reverse an outcome charge

Reverses a charge by hand. This is the exception path; reversal rules handle the usual cases. Allowed while the charge is pending, disputed or confirmed, and refused with outcome_charge_locked once the reversal horizon has passed. A pending charge’s reservation is released. A confirmed prepaid charge’s credits are restored. A postpaid charge comes off the draft invoice, or appears as a credit on the next invoice if it was already invoiced. A reversal applies to a whole charge; partial reversals aren’t supported.

Authentication

AuthorizationBearer

A secret key (rl_sk_test_..., rl_sk_live_...) or a restricted key with limited scopes (rl_rk_test_..., rl_rk_live_...). A restricted key can carry agent: true and an expires_at, and is what a coding agent should hold. Keys end in a checksum so secret scanners can recognize them. People create, roll and revoke keys in the dashboard; GET /v1/api_keys lists them, masked.

Path parameters

outcome_charge_idstringRequired

The outcome charge ID (oc_...).

Request

This endpoint expects an object.
reason_codeenumRequired
Why a charge was reversed. New codes may be added.
notestringOptional<=500 characters
Kept on the reversal.

Response

The reversal.
idstring
object"reversal"
outcome_chargestring
customerstring
amountstring
reason_codeenum
Why a charge was reversed. New codes may be added.
sourceenum

rule: a reversal rule fired. dispute: a dispute was decided reverse, by you or by default. api: you called reverse.

Allowed values:
effectenum

reservation_released: the charge was pending, so nothing was billed. credits_restored: prepaid credits came back. accrual_removed: the postpaid charge came off the draft invoice. invoice_credit: the charge was already invoiced, so the next invoice carries a credit.

Allowed values:
ledger_entrieslist of strings
livemodeboolean
created_atdatetime
credit_typestringOptional
currencystringOptional
rulestringOptional

The rule key, when source is rule.

trigger_eventstringOptional

The signal event, when source is rule.

disputestringOptional
request_idstringOptional

The request, when source is api.

actorobjectOptional

Who reversed it, when source is api or a person decided a dispute. A rule is named by rule.

notestringOptional
credited_on_invoicestringOptional

invoice_credit only: the invoice carrying the credit, once it exists.

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
409
Conflict Error
422
Unprocessable Entity Error
429
Too Many Requests Error
500
Internal Server Error