/

Sending events

Send events in batches

Up to 100 events per request for imports and backfills.

2 min read

When you import historical data or catch up after an outage, send events in batches. Each event in a batch is handled on its own, so one invalid event does not block the others.

await sluice.events.batch("cus_1042", [
  { type: "invoice.paid", payload: { invoice: "inv_8841" } },
  { type: "invoice.paid", payload: { invoice: "inv_8842" } },
]);
await sluice.events.batch("cus_1042", [
  { type: "invoice.paid", payload: { invoice: "inv_8841" } },
  { type: "invoice.paid", payload: { invoice: "inv_8842" } },
]);
await sluice.events.batch("cus_1042", [
  { type: "invoice.paid", payload: { invoice: "inv_8841" } },
  { type: "invoice.paid", payload: { invoice: "inv_8842" } },
]);

The response lists an ID or an error for each event, in the order you sent them.

Something missing or wrong on this page? Tell us at support@sluicehq.dev and we will fix it.

Create a free website with Framer, the website builder loved by startups, designers and agencies.