PUT
Edit a customer
Company space For: Cashier and seller, Manager · Permission: customers.update Conditions
  • The name, when changed, must stay unique among the company’s customers.
  • Credit cannot be switched off, and max_balance or max_credit_amount cannot be lowered or cleared, while the customer still owes money.
  • initial_balance is only taken into account the first time the customer is made creditable; afterwards it is ignored.
  • global_due_date cannot be in the past.
What else happens
  • The first time the customer is made creditable, a debt account is opened and, if the opening balance is above zero, an opening entry is posted from the company credit-sales account to that debt account.
Part of Manage customers.

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, name, phone_number, address, city, country, is_creditable, initial_balance, max_balance, max_credit_amount, computed_balance, global_due_date, 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: .

Response

Resource (only with response=resource).

id

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

name

Name of the customer, stored with each word capitalised. Unique among the company's customers.

phone_number

Phone number of the customer, or null when none was given.

address

Free-text postal address of the customer, or null when none was given.

city

City of the customer, or null when none was given.

country

Country of the customer, or null when none was given.

is_creditable
boolean

True when the customer is allowed to buy on credit. A creditable customer has a debt account in the accounts.

initial_balance
number | null

Amount the customer owed when credit was first enabled, in major units of the company currency. Null for a customer that was never creditable.

max_balance
number | null

Most the customer may owe at any time, in major units of the company currency. Null means no limit is set.

max_credit_amount
number | null

Largest amount of credit allowed on a single order, in major units of the company currency. Null means no limit is set.

computed_balance
number

What the customer currently owes, in major units of the company currency, read from the customer's debt account. 0 for a customer without a debt account.

global_due_date

Default due date for the customer's credit orders that have no due date of their own. Null when none is set.

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