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.


Punto Final

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

Solicitud
Campo
Tipo
Descripción
externalId
String
El identificador único del cliente del sistema/base de datos fuente. Si detectamos un registro con el mismo externalId, se actualizará; de lo contrario, se añadirá.
firstName
String
El primer nombre del cliente.
lastName
String
El apellido del cliente.
accountName
String
Si el cliente es una empresa, puedes usar este campo como un identificador adicional (Ej. 123 Main Street o ABC Company).
mobilePhone
String
El número de teléfono móvil del cliente. Requerido si se notificará a este cliente por mensaje de texto.
email
String
La dirección de correo electrónico del cliente. Requerido si se notificará a este cliente por correo electrónico.
notes
String
Notas internas del cliente. Visible solo para el comerciante.
attachmentRefs
Una lista de adjuntos.
deleted
Boolean
Esta bandera representa si el registro ha sido eliminado y ya no está disponible para ser utilizado.
Sample Request
			
{
  "externalId": "39772634",
  "firstName": "John",
  "lastName": "Doe",
  "accountName": "",
  "mobilePhone": "111-222-3333",
  "email": "johndoe@abc.com",
  "notes": "World's best customer",
  "notificationOptions": {
    "notifyPhone": true,
    "notifyEmail": true
  },
  "deleted": false
}


		
Respuesta
Campo
Tipo
Descripción
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"
  ]
}