Register a customer
Fifamè creates a record for Le Palmier with Create a customer. The record holds:- Name: required, at least 3 characters, and not already used by another customer of the company. The name is saved with each word starting with a capital, so “LE PALMIER” is saved as “Le Palmier” and counts as the same name.
- Contact details: phone number, address, city and country.
- Credit settings: whether the customer may buy on credit, an opening balance, a maximum balance, a maximum credit per sale and a due date. The meaning of each is explained in Collect customer credit.
Keep delivery addresses
Le Palmier has a bar and a storage room across town. Fifamè adds both with Add a customer address. Each address has a label and the address itself, both required. It can also carry a city, a phone number, and a latitude and longitude. Latitude is between -90 and 90 and longitude between -180 and 180. The label must be different for each address of the same customer. Moussa Alassane, the driver, can then see which one a delivery refers to.- List customer addresses shows all addresses of one customer.
- View a customer address shows one.
- Edit a customer address changes it. The label must stay unique.
- Delete a customer address removes it for good.
Find and read customers
List customers shows the customers of the company, with sorting, paging and a search by name. View a customer shows one record with its details.Change a customer
Le Palmier has paid on time for a year, so Fifamè raises its limits with Edit a customer. Credit can also be granted later to a customer who had none. The first time a customer is made creditable, the debt account is opened and the opening balance, if any, is posted. After that, the opening balance is ignored.Remove a customer
A bar closes. Fifamè removes it with Delete a customer. The customer no longer appears in the list or in lookups, but the record is kept. No action of the API restores it. The removal is refused when:- the customer still owes money;
- the customer still holds store credit (see Pay back customers’ store credit);
- the customer is a stop in an active trip.
The rules
- A customer belongs to one company.
- The name must be unique among the company’s customers and keeps that rule when it is changed. The name of a removed customer still counts.
- Credit cannot be switched off, and the maximum balance or maximum credit per sale cannot be lowered or cleared, while the customer still owes money.
- The opening balance counts only the first time a customer becomes creditable.
- Deleting a customer cannot be undone through the API: no action restores a removed customer.
All the actions of this topic
- List customers: Shows the company customers, with sorting, paging and a search by name.
- Create a customer: Registers a new customer, optionally allowing them to buy on credit with an opening balance and limits.
- View a customer: Shows one customer with their details.
- Edit a customer: Changes a customer details, including credit settings and limits.
- Delete a customer: Removes a customer that is no longer needed.
- List customer addresses: Shows the delivery or contact addresses saved for one customer of the company.
- Add a customer address: Saves a new address on a customer so it can be used later, for example for deliveries.
- View a customer address: Shows the details of one address saved for a customer.
- Edit a customer address: Changes the details of an address saved for a customer.
- Delete a customer address: Removes an address from a customer when it is no longer needed.