POST
Record a customer payment
Company space For: Cashier and seller, Manager, Accountant · Permission: customer_credit_payments.create Conditions
  • the call must come from a cashier whose register is open; the payment is recorded at that register
  • the customer must be allowed to buy on credit
  • the register payment method must accept incoming money
  • the amount cannot exceed what the customer owes on the chosen orders plus their opening balance
  • the reference is required and must be unique among the company’s payments
  • a cashier on an open register can record it without the customer payments permission
What else happens
  • the payment settles the chosen credit orders, or the unpaid ones due first, and marks them paid or partly paid; what remains reduces the opening balance
  • what the customer owes goes down by the amount received
  • the repayment is posted in the accounts, in the cash, bank or mobile money account of the register payment method, with the operator fee if there is one
  • a payment in another currency is converted into the company currency, and the rate used is kept on the payment
Part of Collect customer credit.

Authorizations

Authorization
string
header
required

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

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, customer_id, source, cash_register_id, amount, currency_code, currency_exponent, original_amount, original_currency_code, original_currency_exponent, conversion_snapshot, actual_fee_amount, register_payment_method_id, payment_method, money_account_id, cash_account_id, payment_date, reference, description, 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
customer_id
string
required

Customer who pays. They must belong to the company, not be deleted, and be allowed to buy on credit.

value
number
required

Amount received, in the currency given by currency_code, written in major units (15000, or 12.5 for a currency with decimals). It may not have more decimal places than currency_exponent allows. It cannot be more than what the customer owes on the chosen orders plus their opening balance.

currency_code
string
required

Currency the customer paid in, as a three-letter code in capitals, such as XOF. The company currency when left out. A payment in another currency is converted into the company currency.

Required string length: 3
currency_exponent
integer
required

Number of decimal places of that currency (0 for XOF). The company currency's when left out.

Required range: 0 <= x <= 18
source
enum<string>
required

Where the money is taken. Only cash_register is accepted: the payment is recorded at the register of the cashier making the call, who must have their register open.

Available options:
cash_register
register_payment_method_id
string
required

Payment method of the cashier's register that receives the money (cash, mobile money, bank transfer, card or cheque). It must belong to that register and accept incoming money; methods of type other are refused.

Required string length: 27
reference
string
required

Your reference for this payment, such as a receipt number. Required, up to 100 characters, and unique among the company's payments.

Maximum string length: 100
actual_fee_amount
integer | null

Fee the bank or mobile money operator actually took on this payment, in minor units. Required when the fee rule of the receiving account is the actual fee; refused otherwise.

Required range: x >= 0
replacement_for_cheque_id
string

Not accepted here. To replace a bounced cheque, use Replace a bounced cheque payment.

cash_account_id
string

Not accepted: taken from the register payment method.

money_account_id
string

Not accepted: taken from the register payment method.

payment_method
string

Not accepted: taken from the register payment method.

description
string | null

Note kept on the payment and copied into the accounting entry. A standard wording is used when you leave it out.

Maximum string length: 255
exchange_rates
string

Not accepted.

cheque
object

Details of the cheque. Required when the register payment method is a cheque (series, number, issuing_bank_name, drawer_name and issue_date must then be filled), refused for any other method.

order_ids
string[] | null

Credit orders of this customer that the payment settles. Leave it out to settle the unpaid orders due first. What goes beyond these orders reduces the customer's opening balance.

Required string length: 27

Response

Resource (only with response=resource).

id

Identifier of the payment.

customer_id

Customer who paid.

source

Where the payment was taken: cash_register.

cash_register_id

Register where the payment was taken.

amount
integer

Amount received, converted into the company currency, in minor units of currency_code.

currency_code

Company currency, in which amount is expressed.

currency_exponent
integer

Number of decimal places of the company currency.

original_amount
integer

Amount as the customer paid it, in minor units of original_currency_code.

original_currency_code

Currency the customer paid in.

original_currency_exponent
integer

Number of decimal places of that currency.

conversion_snapshot
object | null

Exchange rate details used to convert the payment into the company currency, as recorded in the accounts.

actual_fee_amount
integer | null

Fee the operator actually took, in minor units, when one was given.

register_payment_method_id

Register payment method that received the money.

payment_method

Kind of payment: cash, credit_card, bank_transfer, mobile_money or cheque.

money_account_id

Money account linked to the register payment method that received the money, when that method has one.

cash_account_id

Cash account that received the money, for cash payments.

payment_date

Moment the payment was recorded.

reference

Your reference for the payment.

description

Note kept on the payment.

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).