Docs

Customers API

Create, retrieve, update, and delete customer records.

Customer API routes are served by apps/api under the Customers tag.

Upsert customer

POST /api/customers/upsert

Creates or updates a customer based on the body accepted by the customer upsert schema.

Find customer

GET /api/customers/find-first/{idOrEmail}

Finds the first customer matching an ID or email value.

Update customer

POST /api/customers/update/{id}

Updates the customer identified by id.

Delete customer

DELETE /api/customers/delete/{id}

Deletes the customer identified by id.

Example

curl "$BETTERSTORE_API_URL/api/customers/find-first/customer@example.com" \
  -H "Authorization: Bearer $BETTERSTORE_API_SECRET"

Notes

  • Customer routes require an organization API secret.
  • Customer data can be sensitive. Keep customer email, address, and segment data server-side unless it is explicitly needed by a customer-facing flow.
  • Customer import and export workflows are platform features and should preserve existing permissions and validation rules.

On this page