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/v4/site/{site_id}/customer/addUpdate

Demande
Champ
Type
Description
_id
String
L'identifiant du client. Ce champ est généré par le système et n'est pas requis lors de la création d'un nouveau client, mais il est requis lors de la mise à jour d'un client existant.
displayName
String
Le nom qui sera affiché pour le client.
accountName
String
Si le client est un groupe, vous voudrez peut-être fournir un nom d'entreprise ou l'adresse du client ici.
primaryContact
Les informations de contact principales des clients. Requis si aucun contacts n'est fourni.
contacts
Une liste de contacts clients. Requis si primaryContact n'est pas passé en paramètre.
parentCustomer
String
L'identifiant du client parent, si applicable.
billToParentFlag
Boolean
Un drapeau indiquant si le client parent doit être facturé pour ce client. Applicable uniquement si parentCustomer est fourni.
notes
String
Notes internes pour le client. Visible seulement par le commerçant.
attachmentRefs
Une liste de pièces jointes.
deleted
Boolean
Que le dossier du client ait été supprimé et n'est plus actif.
Default = false
Sample Request (Add a Customer with a single contact)
			
{
  "displayName": "ABC Plumbing",
  "primaryContact": {
    "firstName": "John",
    "lastName": "Doe",
    "mobilePhone": "333-444-5555",
    "email": "johndoe@abc.com",
    "billingAddress": {
      "addressLine1": "123 Main Street",
      "addressLine2": "Suite 123",
      "city": "Naples",
      "stateCode": "FL",
      "zipCode": "34102"
    }
  }
}


		
Sample Request (Add a Customer with multiple contacts)
			
{
  "displayName": "ABC Plumbing",
  "contacts": [
    {
      "_id": "6839e415564d3cc21603221e",
      "isPrimary": true
    },
    {
      "_id": "6839e415564d3cc2160t623c",
      "isPrimary": false
    }
  ]
}


		
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"
  ]
}