anyshop docs homeStatusOpen the dashboard

API reference Customers Update a customer

API referenceCustomers

Update a customer

PATCH methodhttps://api.anyshop.io/v1/customers/{id}

Changes the name, or gives or withdraws marketing consent (recorded with the source api and the time). A buyer without a record gets one, under a new cus_ ID. Live keys only. Erasing a customer and exporting their data are in the dashboard only, after the owner's fresh two-factor check.

  • Scope customers:write
  • Live keys only
  • Idempotent with Idempotency-Key
  • Works while the store is suspended

Path parameters

  • idstring required

Body

application/json0 required, 2 optional
  • namestring Their name, up to 200 characters; replaces the one keptUp to 200 characters
  • marketing_consentboolean true: they agreed to marketing emails, recorded with the source api and the time. false: they withdrew it, recording when. Left out, consent stays as it is

Headers

  • Idempotency-Keystring Up to 255 characters. A retry with the same key and request gets the first answer, without running twice (24 hours).

Returns

The customer object.

Errors

Status and error.type
  • 400invalid_requestThe request is not valid; error.param names the field
  • 401authenticationNo API key, or it is not valid
  • 403permissionThe key does not have the scope this needs, or the store is suspended (store_suspended)
  • 404not_foundNot found in the key's store and mode
  • 409conflictConflicts with the object's state (type conflict), or an Idempotency-Key reused for another request (type idempotency, code idempotency_key_reused)
  • 429rate_limitedToo many requests; see Retry-After