Fifamè Sossou manages the Dépôt Houngbédji in Porto-Novo. Until now, the bars and restaurants that buy drinks from the depot were names in a phone and lines on delivery slips. When Edwige Assogba, who owns the bar Le Palmier, calls for ten crates, Fifamè wants to find her record at once, know where the van must go, and see whether she may buy on credit. The same steps apply to any business that keeps a list of regular buyers, such as a hardware store, a pharmacy or a wholesaler.

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.
When credit is allowed, Exowpee opens a debt account for the customer in the accounts. If the opening balance is above zero, an opening entry is posted, so the customer starts out owing that amount. For a customer who may not buy on credit, the opening balance is not kept. Amounts are written in the currency of the company. In XOF there are no decimal places, so 150000 means 150,000 FCFA. Amounts cannot be negative or have more decimal places than the currency allows, and the due date cannot be in the past.

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.

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: Deleting an address is also refused while it is a stop in an active trip, or while a delivery refers to it. The trip and delivery cases are refused as a conflict; a customer who still owes money or holds store credit gets a validation error.

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