Customers

One record per customer across payments, invoices, subscriptions, bookings, gifts and orders.

Watenga joins a customer’s activity across products into one record with per-currency totals and a timeline. Create customers from your system (with your own external_id) so they match. Deleting a customer is done in the dashboard.

Keys and scopes

A secret key, or a restricted key with the customers scope.

Create and update

typescript
const customer = await watenga.customers.create({ name: 'Ada Buyer', email: 'ada@example.com', external_id: 'crm-1001' });
await watenga.customers.update(customer.id, { phone: '+263771234567' });

Find and read

search matches name, email, phone and external id. A customer answers with its per-currency totals, tags and recent payments; timeline lists its activity, newest first. On other resources, expand=customer inlines the customer next to customer_id.

typescript
for await (const c of watenga.customers.listAll({ search: 'ada' })) console.log(c.id, c.email);
const timeline = await watenga.customers.timeline(customer.id, { limit: 20 });

Test it

Use a test secret key (sk_test_…): it never moves money. Pay with the test cards and wallet numbers, and receive the webhooks on your machine with watenga listen --forward-to http://localhost:3000/webhooks (CLI).

Related: Subscriptions · Pagination