POST
Replace a bounced cheque payment
Company space Accounting module For: Accountant, Manager · Permission: cheques.resolve Conditions
  • The organization’s plan must include the accounting module; otherwise the call is refused before anything else.
  • This action is available only in the company space.
  • The cheque must be unpaid or returned and its recovery status must be open; a cheque already resolved or written off is refused. Calling again after success is therefore refused, not replayed.
  • The caller must be an active cashier assigned to a cash register; otherwise the call is refused.
  • The caller also needs the permission to create repayments and access to the customer.
  • register_payment_method_id must be a payment method of the your company; its route must support incoming payments, must not be of type other, a cash method needs a configured cash account, and a non-cash method needs a money account open to the company for incoming flows.
  • When the payment method is cheque, cheque.series, cheque.number, cheque.issuing_bank_name, cheque.drawer_name and cheque.issue_date are required; with any other method the cheque object is refused.
  • exchange_rates is refused.
  • actual_fee_amount is refused when the fee rule of the payment method is not of type actual, and required when it is.
  • The amount of the replacement payment, converted to the company currency, must equal the cheque amount exactly, otherwise the call is refused.
  • The original payment must still have its order allocations (or, for a refunded cheque, its refunded claim); otherwise the call is refused.
  • A replacement payment already linked to this cheque with a different payload is refused as a conflict.
  • cheque.due_date must not be before cheque.issue_date.
What else happens
  • Creates a repayment of the cheque amount, linked to the cheque, dated now and attached to the cashier’s cash register.
  • Records a movement on the customer’s outstanding debt.
  • Applies the replacement payment to the same orders the original cheque paid (not when the original payment had been refunded).
  • Posts the accounting entry of the payment: against the unpaid-cheque account when the cheque is unpaid, against the customer receivable when it is returned.
  • Sets the cheque recovery status to resolved, increments its version and sets the payment source status to resolved. No step is added to the cheque history.
Part of Handle cheques.

Authorizations

Authorization
string
header
required

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

Path Parameters

cheque
string
required

Identifier of the cheque (27-character KSUID).

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, organization_id, customer, customer_id, identity, financial_status, status, recovery_status, accounting_owner, physical_holder, version, source_type, source_id, amount, currency_code, currency_exponent, original_amount, original_currency_code, original_currency_exponent, reference, received_at, accounting_status, settlement_id, cheque_transfer_id, order.

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: operations.

Body

application/json
event_id
string
required

Required, up to 120 characters. Not used to replay the request: a second call is refused because the cheque recovery is already resolved.

Maximum string length: 120
accounting_date
string<date-time>
required

Required date (ISO 8601). It is validated, but the replacement payment itself is recorded with the current date.

reference
string
required

Required. Reference of the replacement payment (for example the new cheque number or a receipt number), up to 100 characters.

Maximum string length: 100
value
number
required

Required. Amount of the replacement payment in major units (a decimal, up to 18 decimals, greater than 0) of currency_code. Converted to the company currency, it must equal the cheque amount exactly.

currency_code
string
required

ISO 4217 code of the currency the customer pays in, three letters. Default: the company's currency. Converted to upper case.

Required string length: 3
currency_exponent
integer
required

Number of decimal places of the currency (0 for XOF). An amount in minor units divided by 10 to this power gives the amount in the currency.

Required range: 0 <= x <= 18
register_payment_method_id
string
required

Required. Identifier (27-character KSUID) of the payment method of the cash register used for the replacement payment. It decides whether the cheque details are required.

Required string length: 27
description
string | null

Optional text for the replacement payment, up to 255 characters. A default description is used when omitted.

Maximum string length: 255
actual_fee_amount
integer | null

Fee charged on the payment, in minor units. Refused when the payment method's fee rule is not of type actual, and required when it is.

Required range: x >= 0
exchange_rates
string

Not accepted: exchange rates are taken from the server's own conversion, not from the request.

cheque
object

Details of the new cheque. Required only when the payment method is cheque; refused for any other method.

Response

Resource (only with response=resource).

id

Identifier of the cheque (27-character KSUID).

source_type

Type of the payment this cheque came from, for example order_payment (a sale) or customer_credit_payment (a payment on a customer's debt).

source_id

Identifier of that originating payment (27-character KSUID).

company_id

Identifier of the company the record belongs to.

organization_id

Identifier of the organization the record belongs to.

customer
object

The customer who gave the cheque, as an object with the customer's id and name (name as recorded on the payment).

customer_id

Identifier of the customer who gave the cheque (27-character KSUID).

order
object

The order the cheque paid, as an object with id and number; both are null when the cheque is not linked to an order.

amount
integer

Cheque amount in minor units of currency_code (divide by 10 to the power currency_exponent). It is the amount in the company's functional currency.

currency_code

ISO 4217 code of the currency of amount.

currency_exponent
integer

Number of decimal places of the currency (0 for XOF). An amount in minor units divided by 10 to this power gives the amount in the currency.

original_amount
integer

Amount as tendered, in minor units of original_currency_code.

original_currency_code

ISO 4217 code of the currency the customer paid in.

original_currency_exponent
integer

Number of decimal places of the original currency; divide original_amount by 10 to this power.

reference

Reference recorded on the originating payment.

received_at

Date and time the payment was received (ISO 8601).

accounting_status

Status of the payment source for accounting. It starts as not_initiated, follows the cheque's financial status after each step (received, in_collection, settled, unpaid, returned), becomes resolved or written_off after recovery, and shows transferred or reversed for the older cheque-transfer flow.

settlement_id

Identifier of the settlement that moved this payment into a money account, when one exists.

cheque_transfer_id

Identifier of the older cheque transfer made for this payment, when one exists.

identity
object

What is written on the cheque, as an object: series, number, issuing_bank_name, issuing_bank_code, drawer_name, drawer_account_reference, issue_date and due_date (dates as YYYY-MM-DD), beneficiary_name. Each is null when unknown.

financial_status

Where the cheque is in its life: received (held, not yet deposited), in_collection (deposited at the bank), settled (the bank paid it), unpaid (the bank refused it), returned (given back to the customer).

status

Same value as financial_status.

recovery_status

Follow-up of an unpaid or returned cheque: open (the debt is still to be recovered), resolved (a replacement payment was recorded), written_off (the debt was written off). Null while no recovery applies.

accounting_owner
object

Book that currently holds the cheque, as an object: type (company or organization) and id.

physical_holder
object

Who physically holds the paper cheque, as an object: type (company, organization, bank, customer or none) and id (null for bank and none).

version
integer

Counter increased by one at each change of the cheque; use it to detect that the cheque moved.

operations
array

Step history of the cheque in time order (deposit, settlement, rejection and so on, with reversals). Present only when requested with ?include=operations.