Skip to navigation

Create a customer

View as Markdown

Active at once. It has no password: the customer sets one with “forgot password” on the store’s login page. Counts toward the plan’s customer limit (409 plan_limit), and fires the Customer Registered webhook. Requires customers:write. Needs customer registration on in the store settings (409 registration_disabled otherwise).

Authentication

AuthorizationBearer

An API key from the store's admin: חנות > API ומפתחות. Send it as Authorization: Bearer coi_sk_... (or X-Api-Key: coi_sk_...). Never in the URL - ?apikey= is refused with 400.

Headers

Idempotency-KeystringOptional<=255 characters
Makes a retry safe, as on Create a product.

Request

This endpoint expects an object.
emailstringOptional<=150 characters

Required on create. Unique in the store (409 email_taken).

firstNamestringOptional<=50 characters
lastNamestringOptional<=50 characters
phonestringOptional<=50 characters
newsletterbooleanOptional
notesstring or nullOptional
activebooleanOptional

Update only. true approves a pending customer (it is emailed that it can log in) or unlocks one; false locks it out at once.

Response

Created.
oktrueOptional
dataobjectOptional

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
409
Conflict Error
429
Too Many Requests Error