Events

Every event you can send, with examples.

Sending events

Events are how your software tells Zahrex what happened.

The response lists each event in results as accepted, duplicate, or rejected with an error. A rejected event does not fail the others in the batch.

You can send up to 100 events in one batch.

customer.upserted

Create a customer, or update the one with the same phone or email.

Scope
customers:write
Required
namephone or email
Optional
cityexternal_idsourcenotetagsstage
{
  "name": "Sara Example",
  "phone": "+212600000000",
  "email": "sara@example.com",
  "city": "Casablanca",
  "tags": [
    "vip"
  ]
}

lead.created

A new prospect who has not bought yet.

Scope
leads:write
Required
namephone or email
Optional
cityexternal_idsourcenotetagsstage
{
  "name": "Sara Example",
  "phone": "+212600000000",
  "email": "sara@example.com",
  "source": "pricing_page",
  "stage": "signed_up"
}

order.created

A new order with its line items.

Scope
orders:write
Required
external_idcustomer.nameitems[].nameitems[].quantityitems[].unit_pricecurrencytotal
Optional
customer.phonecustomer.emailcustomer.citystatuspayment_status
{
  "external_id": "ord_1001",
  "customer": {
    "name": "Sara Example",
    "phone": "+212600000000",
    "email": "sara@example.com"
  },
  "items": [
    {
      "name": "Starter plan",
      "quantity": 1,
      "unit_price": 29
    }
  ],
  "currency": "USD",
  "total": 29,
  "payment_status": "pending"
}

payment.succeeded

A payment for an order went through.

Scope
orders:write
Required
order_external_idamountcurrency
{
  "order_external_id": "ord_1001",
  "amount": 29,
  "currency": "USD"
}

payment.refunded

A payment for an order was refunded.

Scope
orders:write
Required
order_external_idamountcurrency
{
  "order_external_id": "ord_1001",
  "amount": 29,
  "currency": "USD"
}

subscription.started

A customer started a subscription.

Scope
events:write
Required
external_idcustomerplan
Optional
amountcurrencyinterval
{
  "external_id": "sub_2001",
  "customer": {
    "name": "Sara Example",
    "phone": "+212600000000",
    "email": "sara@example.com"
  },
  "plan": "Pro",
  "amount": 29,
  "currency": "USD",
  "interval": "month"
}

subscription.renewed

A subscription renewed for another period.

Scope
events:write
Required
external_idcustomerplan
Optional
amountcurrencyinterval
{
  "external_id": "sub_2001",
  "customer": {
    "name": "Sara Example",
    "phone": "+212600000000",
    "email": "sara@example.com"
  },
  "plan": "Pro",
  "amount": 29,
  "currency": "USD",
  "interval": "month"
}

subscription.canceled

A customer canceled a subscription.

Scope
events:write
Required
external_idcustomerplan
Optional
amountcurrencyinterval
{
  "external_id": "sub_2001",
  "customer": {
    "name": "Sara Example",
    "phone": "+212600000000",
    "email": "sara@example.com"
  },
  "plan": "Pro"
}

booking.created

A customer booked a time slot.

Scope
events:write
Required
external_idcustomerstarts_at
Optional
ends_atservice
{
  "external_id": "bk_3001",
  "customer": {
    "name": "Sara Example",
    "phone": "+212600000000",
    "email": "sara@example.com"
  },
  "starts_at": "2026-12-01T10:00:00Z",
  "ends_at": "2026-12-01T10:30:00Z",
  "service": "Consultation"
}

booking.updated

A booking changed, for example to a new time.

Scope
events:write
Required
external_idcustomerstarts_at
Optional
ends_atservice
{
  "external_id": "bk_3001",
  "customer": {
    "name": "Sara Example",
    "phone": "+212600000000",
    "email": "sara@example.com"
  },
  "starts_at": "2026-12-02T10:00:00Z"
}

booking.canceled

A booking was canceled.

Scope
events:write
Required
external_idcustomerstarts_at
Optional
ends_atservice
{
  "external_id": "bk_3001",
  "customer": {
    "name": "Sara Example",
    "phone": "+212600000000",
    "email": "sara@example.com"
  },
  "starts_at": "2026-12-01T10:00:00Z"
}

form.submitted

A visitor submitted a form on your site.

Scope
events:write
Required
formfields
Optional
customer
{
  "form": "contact",
  "fields": {
    "message": "Hello"
  },
  "customer": {
    "name": "Sara Example",
    "phone": "+212600000000",
    "email": "sara@example.com"
  }
}

Custom events

Event types matching custom.<name> are accepted as custom events with scope events:write, up to 32768 bytes each.

Smarter sales automation,
powered by AI.

Find products, build stores, launch campaigns, confirm orders, ship and get paid, from one connected platform.

Stay in touch!