Customer

Overview

The customer is the core identity in the Open API — the person who signs in, subscribes, and manages their account. Most endpoints return the shared customer resource, which carries the profile, relationships, and a JWT used to authenticate subsequent requests.


How It Works

  1. Authenticate - Register or log the customer in to obtain a JWT.
  2. Send the token - Pass it as Authorization: Bearer <token> on protected endpoints.
  3. Manage the customer - Retrieve and update the profile, refresh the token, check eligible offers, verify the email, and manage the profile picture.

Example: After a customer logs in, load their profile with Get Customer, let them edit it with Update Customer, and refresh their token before it expires to keep them signed in.


API Endpoints

MethodEndpointDescription
POST/api/v1/sdk/customerGet customer
PUT/api/v1/sdk/customerUpdate customer
POST/api/v1/sdk/customer/refreshRefresh token
GET/api/v1/sdk/customer/plansEligible plans
GET/api/v1/sdk/customer/couponsEligible coupons
GET/api/v1/sdk/customer/product_skuEligible product SKUs
GET/api/v1/sdk/customer/email/verifyRequest email verification
POST/api/v1/sdk/customer/email/verifyVerify email
POST/api/v1/sdk/customer/pictureUpload profile picture
DELETE/api/v1/sdk/customer/pictureDelete profile picture

Important Behaviors

  • Authentication: Get, Update, Refresh, and the segment, email-verification request, and profile-picture endpoints are protected and require a bearer token. Login, Register, and Verify Email are public.
  • Token echoed / refreshed: Get Customer echoes the bearer token; Update and Refresh return a fresh token.
  • Email change: Updating the email resets email_confirm to false and, when email verification is enabled, triggers a verification email.
  • Partial update: Update Customer changes only the fields you send.

Customer Object

The shared customer resource is documented in full on Resources. Key attributes:

AttributeTypeDescription
idintegerUnique identifier for the customer
emailstringCustomer email address
first_name / last_namestringCustomer name
display_name / usernamestringDisplay name and unique username
phonestringPhone number
languagestringTwo-letter language code
email_confirmbooleanWhether the email is verified
metadataobjectCustom key-value pairs
subscriptions / membershipsarrayActive subscriptions and memberships
addresses / sourcesarrayAddresses and payment methods
auth_token / tokenstringJWT (returned by authentication endpoints)