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
- Authenticate - Register or log the customer in to obtain a JWT.
- Send the token - Pass it as
Authorization: Bearer <token>on protected endpoints. - 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
| Method | Endpoint | Description |
|---|---|---|
POST | /api/v1/sdk/customer | Get customer |
PUT | /api/v1/sdk/customer | Update customer |
POST | /api/v1/sdk/customer/refresh | Refresh token |
GET | /api/v1/sdk/customer/plans | Eligible plans |
GET | /api/v1/sdk/customer/coupons | Eligible coupons |
GET | /api/v1/sdk/customer/product_sku | Eligible product SKUs |
GET | /api/v1/sdk/customer/email/verify | Request email verification |
POST | /api/v1/sdk/customer/email/verify | Verify email |
POST | /api/v1/sdk/customer/picture | Upload profile picture |
DELETE | /api/v1/sdk/customer/picture | Delete 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_confirmto 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:
| Attribute | Type | Description |
|---|---|---|
id | integer | Unique identifier for the customer |
email | string | Customer email address |
first_name / last_name | string | Customer name |
display_name / username | string | Display name and unique username |
phone | string | Phone number |
language | string | Two-letter language code |
email_confirm | boolean | Whether the email is verified |
metadata | object | Custom key-value pairs |
subscriptions / memberships | array | Active subscriptions and memberships |
addresses / sources | array | Addresses and payment methods |
auth_token / token | string | JWT (returned by authentication endpoints) |
