Skip to content

Update Customer by email, id or phone

Request

Actualiza un nuevo customer buscado por email, id o phone. Puedes realizar la busqueda igual que los métodos get

Security
api-key
Bodyapplication/json
customerobject(Customer)
agent_idinteger

ID del agente asignado al cliente (puede estar en nivel raíz o dentro de customer)

tagsArray of objects

Array de etiquetas del cliente (puede estar en nivel raíz o dentro de customer)

custom_fieldsArray of objects

Array de campos personalizados del cliente (puede estar en nivel raíz o dentro de customer)

curl -i -X PUT \
  https://app.mercately.com/retailers/api/v1/customers/:phone \
  -H 'Content-Type: application/json' \
  -H 'api-key: YOUR_API_KEY_HERE' \
  -d '{
    "customer": {
      "first_name": "string",
      "last_name": "string",
      "email": "string",
      "phone": "string",
      "id_type": "cedula",
      "id_number": "string",
      "address": "string",
      "city": "string",
      "state": "string",
      "zip_code": "string",
      "customer_addresses_attributes": [
        {
          "address": "string",
          "city": "string",
          "state": "string",
          "zip_code": "string",
          "country_id": 0,
          "latitude": "string",
          "longitude": "string",
          "description": "string",
          "main": true
        }
      ],
      "notes": "string"
    },
    "agent_id": 0,
    "tags": [
      {
        "name": "string",
        "value": true
      }
    ],
    "custom_fields": [
      {
        "field_name": "string",
        "field_content": "string"
      }
    ]
  }'

Responses

OK

Bodyapplication/json
messagestring

Mensaje de confirmación

Example:"Customer updated successfully"
customerobject(Customer)
Response
{ "message": "Customer updated successfully", "customer": { "id": "string", "first_name": "string", "last_name": "string", "email": "string", "phone": "string", "id_type": "cedula", "id_number": "string", "address": "string", "city": "string", "state": "string", "zip_code": "string", "country_id": "string", "notes": "string", "whatsapp_opt_in": true, "whatsapp_name": "string", "customer_addresses": [ … ], "tags": [ … ], "custom_fields": [ … ], "agent": { … }, "outbound_status": "error", "campaign_id": 0, "error_message": "string", "campaign_url": "string", "creation_date": "2019-08-24T14:15:22Z", "sent_at": "2019-08-24T14:15:22Z", "delivered_at": "2019-08-24T14:15:22Z", "read_at": "2019-08-24T14:15:22Z", "last_chat_interaction": "2019-08-24T14:15:22Z" } }