Skip to content
Coursey CreativeSign in

PATCH /customer/profile

/api/store/[slug]/customer/profile

Updates the signed-in customer's profile fields (name, phone, default shipping address, marketing opt-in); only provided fields change.

Customer bearer token requiredHow authentication works

Path parameters

slugstringrequired

Business store slug (non-empty string); 404 if no business matches.

Body parameters

first_namestringoptional

First name, trimmed, max 100 characters.

last_namestringoptional

Last name, trimmed, max 100 characters.

phonestringoptional

Phone in E.164 format (regex ^\+?[1-9]\d{1,14}$), max 20 characters.

default_shipping_addressobjectoptional

US-only address object: street_line_1 (required, max 255), street_line_2 (optional, max 255), city (required, max 100), state (required, 2-50 chars), postal_code (required, US ZIP regex ^[0-9]{5}(-[0-9]{4})?$), country (required, 2-letter code, must be 'US').

marketing_opt_inbooleanoptional

Whether the customer opts in to marketing.

Responses

200

The request succeeded.

400

A field failed validation. The response names the fields that failed, not just the first.

500

Something failed on our side. The response carries no detail; retry is safe on a GET.

What comes back

200: { success: true, profile: { id, first_name, last_name, phone, default_shipping_address, marketing_opt_in, created_at, updated_at } }. 400 validation errors return { success: false, error: 'Validation failed', details: { fieldPath: message } }. Returns 500 'Failed to update profile' when no profile row exists yet - GET /customer/profile auto-creates the row on first access.