Get a customer
You can get a customer using the GET customer endpoint.
const customer = await priceos.customers.get("customer_123");
The customer object will have feature access info too.
Update a customer
You can use the PUT customer endpoint to update customer info, add/remove custom products, and more.
Update Email/Name
Add Custom Products
Remove Custom Products
const customer = await priceos.customers.update({
customerId: "customer_123",
name: "Alex Johnson",
email: "alex@acme.com",
});
If the customer exists in Stripe, then any updates to name/email will be overwritten if updated again in Stripe.
Use customProductKeys in customers.update to set custom product assignments.const customer = await priceos.customers.update({
customerId: "customer_123",
customProductKeys: ["custom_basic", "custom_addon"],
});
To remove one or more custom products, call update with the remaining customProductKeys.
To remove all custom products, send an empty array.const customer = await priceos.customers.update({
customerId: "customer_123",
customProductKeys: [],
});
This only applies to custom products. Stripe product access is removed in Stripe (cancel/update subscription).
Delete a customer
You can delete customers using the DEL customer endpoint.
const result = await priceos.customers.delete("customer_123");
If a customer exists in Stripe, you will need to delete the customer in Stripe - not PriceOS.