Add/Update Customer


The following endpoint can be used to add or update a customer within the Hyfin application. The customer mobile phone number and email address will be used to send payment requests to the customer.


Point de terminaison

The following endpoint can be used to add or update a customer. You must replace the {base_url} and {site_id} variable with the site id that was provided when the site was created.

POST
{base_url}/api/v3.1/site/{site_id}/customer/addUpdate

Demande
Champ
Type
Description
external_id
String
Le numéro d'identification unique du client provenant du système/base de données source. Si nous détectons un enregistrement avec le même external_id, il sera mis à jour, sinon il sera ajouté.
first_name
String
Le prénom du client.
last_name
String
Le nom de famille du client.
account_name
String
Si le client est une entreprise, vous pouvez utiliser ce champ comme identifiant supplémentaire (Ex. 123 rue Principale ou Entreprise ABC).
mobile_phone
String
Le numéro de téléphone mobile du client. Requis si notification_options.notify_phone est activé.
email
String
L'adresse courriel des clients. Requis si notification_options.notify_email est activé.
notes
String
Notes internes pour le client. Visible seulement par le commerçant.
active
Boolean
Que le dossier du client soit actif et disponible pour être utilisé.
Default = true
notification_options
Les préférences du client pour recevoir des notifications par message texte et courriel.
Sample Request
			
{
  "external_id": "39772634",
  "first_name": "John",
  "last_name": "Doe",
  "account_name": "",
  "mobile_phone": "111-222-3333",
  "email": "johndoe@abc.com",
  "notes": "World's best customer",
  "active": true,
  "notification_options": {
    "notify_phone": true,
    "notify_email": true
  }
}


		
Réponse
Champ
Type
Description
success
Boolean
Whether the record was added or updated successfully.
action
String
Informs whether the record was added or updated. Will only be returned if success is true.
One of added, updated
_id
String
The auto generated id assigned to the record.
errors
String [ ]
A list of errors. Will only be returned if success is false.
Sample Response (Successful)
			
{
  "success": true,
  "action": "added",
  "_id": "60f720d248f143332af022e0"
}


		
Sample Response (Failed)
			
{
  "success": false,
  "errors": [
    "invalid field2",
    "missing field_name"
  ]
}