POST
Reverse a card settlement
Organization space Accounting module Cannot be undone For: Accountant · Permission: settlements.reverse Conditions
  • The accounting module must be active for the organization.
  • A card settlement can be reversed only from the organization space.
  • The caller must have been granted access to the book in the URL and to the organization’s own book, which the reversal writes into.
  • The book in the URL must be a company book; the organization’s own book or a client book is refused.
  • The settlement must be a credit card payment; other methods are refused, and cheques have their own workflow.
  • When accounting_date is sent it must not be before the settled date (or the initiated date if it was never settled).
  • Replaying on a settlement that is already cancelled or reversed returns it unchanged.
  • A settlement whose entries were already reversed or refunded elsewhere is refused.
  • An entry in a closed fiscal period is reversed on the first day of the next open period instead of the requested date.
What else happens
  • A settled settlement becomes reversed: reversing journal entries are posted in both the company book and the organization book, the originals are marked reversed, and reversed_at / reversed_by are recorded.
  • The bank matches of the organization card settlement entry are kept, even on a closed statement.
  • A settlement that was only initiated becomes cancelled; no journal entry is posted.
  • The payment source’s accounting status follows the settlement status (reversed or cancelled).
Part of Card and payment settlements.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

settlement
string
required

Identifier of the credit card settlement to reverse (27-character KSUID string).

Query Parameters

response
enum<string>
default:none

Response mode. Default none; none answers 204 No Content.

Available options:
none,
resource
fields
string

Comma-separated JSON keys of the root resource (id is always rendered). Available: id, company_id, source_type, source_id, direction, payment_method, creation_mode, status, money_account_id, payment_route_account_id, register_payment_method_id, original_amount, original_currency_code, original_currency_exponent, company_functional_amount, company_currency_code, company_currency_exponent, organization_functional_amount, organization_currency_code, organization_currency_exponent, conversion_snapshot, external_reference, initiated_at, settled_at, reversed_at, reversed_by, reversed_by_type, created_at, updated_at.

include
string

Comma-separated include paths, each optionally followed by its fields in parentheses: units(id,sku),units.uomUnit(id,name). Max depth 6, max 40 paths. Available: .

Body

application/json
accounting_date
string<date>

Date the reversing entries are posted on (ISO 8601 date). Must not be before the settled date (or initiated date if never settled). Defaults to the date of the original entries; when that period is closed, the first day of the next open period is used.

Response

Resource (only with response=resource).

id

Identifier of the settlement (27-character KSUID string).

company_id

Identifier of the company the record belongs to.

source_type

Kind of business record whose payment is settled, for example order_payment or customer_credit_payment.

source_id

Identifier of that business record (27-character KSUID string). A payment can have only one settlement per company.

direction

Direction of the money flow; incoming for payments received.

payment_method

Payment method: credit_card (starts initiated, confirmed later by the organization), bank_transfer or mobile_money (created already settled).

creation_mode

manual or automatic: how the settlement was created. Settlements created for the supported methods are automatic.

status

initiated (waiting for the money), settled (money confirmed on the money account), cancelled (initiated one that was reversed) or reversed (settled one that was reversed).

money_account_id

Organization money account that receives the money (27-character KSUID string).

payment_route_account_id

Accounting account of the payment route the payment went through (27-character KSUID string).

register_payment_method_id

Identifier of the register payment method the payment went through (27-character KSUID string); null when the payment has none.

original_amount
integer

Amount in the currency the customer paid in, an integer in minor units (divide by 10 to the power original_currency_exponent).

original_currency_code

Currency the customer paid in (ISO 4217 code).

original_currency_exponent
integer

Number of decimal places of the original currency.

company_functional_amount
integer

Amount in the company currency, an integer in minor units, frozen from the payment conversion.

company_currency_code

Company currency (ISO 4217 code).

company_currency_exponent
integer

Number of decimal places of the company currency.

organization_functional_amount
integer

Amount in the organization currency, an integer in minor units, frozen from the payment conversion.

organization_currency_code

Organization currency (ISO 4217 code).

organization_currency_exponent
integer

Number of decimal places of the organization currency.

conversion_snapshot
object

Frozen record of the conversions, the fees applied when settled, a hash of the confirmation payload, the accounting posting status and the journal entry identifiers, and the reversal details. Never recalculated with newer rates.

external_reference

Reference supplied by the payment provider or the bank; null when none.

initiated_at

Date and time the settlement was initiated (ISO 8601).

settled_at

Date and time the money was confirmed (ISO 8601); null until settled.

reversed_at

Date and time the settlement was reversed or cancelled (ISO 8601); null otherwise.

reversed_by

Identifier of the member profile or agent account who reversed it; null otherwise.

reversed_by_type

Type of the actor who reversed it; null otherwise.

created_at

Date and time the record was created (ISO 8601, UTC).

updated_at

Date and time the record was last changed (ISO 8601, UTC).