TheDocumentation Index
Fetch the complete documentation index at: https://docs.tybritelabs.com/llms.txt
Use this file to discover all available pages before exploring further.
CustomersService class (accessed via client.customers) provides administrative and logistical control over customer profiles.
Profile Management
createCustomer
Create a new customer profile. This is ideal for bulk imports or custom CRM integrations.
This method requires a Secret Key and should only be called from secure server-side environments.
getCustomer
Retrieve complete details for a specific customer, including store metrics and purchase history.
This method requires both a Publishable/Secret Key (in client constructor) AND the customer’s session token (
xAuthToken). The token resolves to a customer whose id must match the id parameter — otherwise 403 is returned. This prevents enumeration of other customers’ profiles.updateCustomer
Perform partial updates on a customer record. Only the fields you provide will be modified.
Customers may only update their own record. The
xAuthToken (session JWT) must resolve to a customer whose id matches the id parameter, or the server returns 403.Customer Utilities
Authentication Flow
ThegetCustomer and updateCustomer methods require a customer session JWT (xAuthToken) in addition to your API key. Obtain the token via the AuthenticationService — either through login or verifyOtp.
createCustomer is intentionally Secret Key only — it is an admin/CRM operation (e.g. bulk imports) and does not involve customer authentication. No xAuthToken is required or accepted.Response Codes
| Code | Meaning |
|---|---|
201 | Customer created successfully (createCustomer) |
400 | Invalid request — malformed body or missing required fields |
401 | Invalid API key, or missing/invalid xAuthToken |
403 | Forbidden — the customer token does not match the customer_id in the path |
404 | Customer not found |
409 | Duplicate email at this store (on createCustomer) |

