Skip to main content

Update a customer

PATCH/api/v1/customers/{id}

  • Needs an API key, and runs with the access of the member who made the key.
  • Send an Idempotency-Key. The same key with the same request within 24 hours gives the first answer again and changes nothing.
  • A connected AI assistant can use it too, as updateCustomer.

Parameters

In the address

  • idstring (uuid)required

Headers

  • Idempotency-Keystringrequired

    Unique user-scoped key for safely retrying this mutation for 24 hours.

    At least 1 character. Up to 200 characters.

Request body

Sent as application/json.

  • customerobjectrequired

    Fields(12)
    • lock_versioninteger

      At least 0.

    • namestring

    • company_namestring or null

    • emailstring (email) or null

    • phonestring or null

    • payment_terms_daysinteger

      At least 0.

    • notesstring or null

    • automatic_emailsboolean

      Deprecated: use `invoice_reminders`, `quote_follow_ups` and `visit_reminders`, which it stands for. It reads false only when all three are `off`. Writing false sets all three to `off`; writing true sets all three to `default` when they were all `off`, and otherwise changes nothing. Sent with any of the three, it is ignored. It changes nothing about emails a person sends.

      Default: true. Deprecated.

    • invoice_remindersstring

      Whether this customer is reminded by email about their overdue invoices.

      One of: default, on, off. Default: "default".

    • quote_follow_upsstring

      Whether this customer's quotes awaiting an answer are followed up by email.

      One of: default, on, off. Default: "default".

    • visit_remindersstring

      Whether this customer is reminded by email of their visits the day before.

      One of: default, on, off. Default: "default".

    • billing_addressobject or null

      Fields(6)
      • address_line_1stringrequired

      • address_line_2string or null

      • citystringrequired

      • regionstring or null

      • postal_codestringrequired

      • country_codestringrequired

        At least 2 characters. Up to 2 characters.

Responses

200Customer details.

  • dataobjectrequired

    Fields(18)
    • lock_versioninteger

      At least 0.

    • created_atstring (date-time)required

    • updated_atstring (date-time)required

    • idstring (uuid)required

    • account_idstring (uuid)required

    • namestringrequired

    • company_namestring or null

    • emailstring (email) or null

    • phonestring or null

    • payment_terms_daysintegerrequired

      At least 0.

    • notesstring or null

    • automatic_emailsboolean

      Deprecated: use `invoice_reminders`, `quote_follow_ups` and `visit_reminders`, which it stands for. It reads false only when all three are `off`. Writing false sets all three to `off`; writing true sets all three to `default` when they were all `off`, and otherwise changes nothing. Sent with any of the three, it is ignored. It changes nothing about emails a person sends.

      Default: true. Deprecated.

    • invoice_remindersstring

      Whether this customer is reminded by email about their overdue invoices.

      One of: default, on, off. Default: "default".

    • quote_follow_upsstring

      Whether this customer's quotes awaiting an answer are followed up by email.

      One of: default, on, off. Default: "default".

    • visit_remindersstring

      Whether this customer is reminded by email of their visits the day before.

      One of: default, on, off. Default: "default".

    • billing_addressobject or null

      Fields(6)
      • address_line_1stringrequired

      • address_line_2string or null

      • citystringrequired

      • regionstring or null

      • postal_codestringrequired

      • country_codestringrequired

        At least 2 characters. Up to 2 characters.

    • portal_urlstring (uri) or null

      The customer's sign-in link to their customer portal. It signs them in without a password, so it is null for technicians, for AI assistants and for an archived customer. Replace it with rotateCustomerPortalKey.

      Read only.

    • archived_atstring (date-time) or null

A refusal answers in the one error shape every operation shares.

Example

A request our own tests send. The ids are made up: put your own in their place.

curl -X PATCH "https://app.tradesender.co.uk/api/v1/customers/372a8e62-6d44-552f-9c0e-c1229b6478be" \
  -H "Authorization: Bearer $TRADESENDER_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "customer": {
    "company_name": "Taylor Property Services"
  }
}'