POST
Pay a customer's store credit out in cash
Company space Cannot be undone For: Cashier and seller, Manager · Permission: customers.withdrawcredit Conditions
  • the call must come from a cashier whose register is open; the cash comes out of that register
  • the customer must hold store credit in the currency asked for
  • the register payment method must be one of that register, accept outgoing money and be cash; other methods are refused
  • the cash account of the register must be set up
  • the amount must be above 0, with no more decimals than the wallet currency, and cannot exceed the refundable credit of the customer in that currency
  • the reference is required and must be unique among the company’s store credit movements
What else happens
  • the refundable credit of the customer goes down by the amount
  • the cash refund is posted in the accounts, out of the register cash account, and the movement records the register, the cashier, the payment method and the cash account
  • a withdrawal movement is added to the customer’s history
Part of Pay back customers’ store credit.

Authorizations

Authorization
string
header
required

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

Path Parameters

customer
string
required

Identifier of the customer (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, customer_id, type, direction, nature, amount, currency_code, currency_exponent, reference, source_activity_type, source_activity_id, register_payment_method_id, payment_method, cashier_id, cash_register_id, cash_account_id, reason, created_by, created_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
amount
number
required

Amount to pay out, in main units of the currency (for example 12500 for 12,500 FCFA), above 0 and with no more decimals than the wallet currency.

currency_code
string
required

Currency of the wallet to take the credit from. It must be one of the company's currencies and the customer must hold a wallet in it.

Required string length: 3
register_payment_method_id
string
required

Payment method of the cashier's open register that pays the cash out. It must accept outgoing money and be cash.

Required string length: 27
reference
string
required

Your reference for this payout, up to 100 characters, unique among the company's store credit movements.

Maximum string length: 100
reason
string | null

Why the credit is paid out, up to 255 characters. Optional.

Maximum string length: 255

Response

Resource (only with response=resource).

id

Identifier of the movement.

customer_id

Customer whose wallet moved.

type

What happened: issue (credit added, for example by a cancelled paid sale), withdrawal (cash paid out to the customer), redemption (credit used) or reversal (a movement undone). Only issues and withdrawals are recorded today.

direction

credit when the wallet gained money, debit when it lost money.

nature

Which half of the wallet moved: advance (money paid in advance) or refundable (credit that can be paid back in cash).

amount
number

Amount of the movement, in main units of currency_code. Always positive; direction tells the sign.

currency_code

Currency of the movement.

currency_exponent
integer

Number of decimal places of the currency for this movement.

reference

Reference given with the withdrawal, unique among the company's movements. Empty for credit added by a cancelled sale.

source_activity_type

Kind of document that caused the credit, for example order. Empty for withdrawals.

source_activity_id

Identifier of that document, for example the cancelled order.

register_payment_method_id

Register payment method the cash went out through. Withdrawals only.

payment_method

Payment method the cash went out through. Withdrawals only, always cash.

cashier_id

Cashier who paid the cash out. Withdrawals only.

cash_register_id

Register the cash came from. Withdrawals only.

cash_account_id

Cash account the money left. Withdrawals only.

reason

Free-text reason given with the withdrawal.

created_by

Agent account or user profile that caused the movement.

created_at

When the movement was recorded.