Skip to main content
POST
Record a success event

Authorizations

Authorization
string
header
required

A workspace API token. Create one in Settings → API. Send it as Authorization: Bearer sk_live_....

Body

application/json

Body for POST /v1/success-events.

dedupe_key
string
required

Your idempotency key for this fact, e.g. your order id. Unique per event_code within the workspace: sending the same key again returns the event already on file (200) instead of recording a second one — even if the rest of the body differs, so never reuse a key for a different fact.

Required string length: 1 - 255
Example:

"order-1001"

event_code
string
required

Which kind of success this is — the code of one of this workspace's event types. List them with GET /v1/success-event-types.

Required string length: 1 - 100
Example:

"sale_closed"

occurred_at
string<date-time>
required

When the success actually happened, with a timezone offset. May be in the past: an event reported late is still dated when it happened.

Example:

"2026-09-01T12:00:00-03:00"

contact_id
string | null

Unique identifier for a contact.

Pattern: ^con_[0-9a-f]{32}$
Example:

"con_9f2ac41d8b7e4a51b0d3e6f7a1c2d3e4"

conversation_id
string | null

Unique identifier for a conversation.

Pattern: ^conv_[0-9a-f]{32}$
Example:

"conv_9f2ac41d8b7e4a51b0d3e6f7a1c2d3e4"

deal_id
string | null

Unique identifier for a deal.

Pattern: ^deal_[0-9a-f]{32}$
Example:

"deal_9f2ac41d8b7e4a51b0d3e6f7a1c2d3e4"

reason
string | null

Free text kept for audit, e.g. why a sale was refunded.

Maximum string length: 2000
value_cents
integer | null

The event's own value in cents (BRL), e.g. the sale amount. Required when the event type's value_basis is amount; must be omitted when it is none.

Required range: x >= 0
Example:

150000

Response

Replayed: an event with this dedupe_key was already on file and is returned unchanged. Nothing new was recorded.

One entry in the success-event ledger.

billable
boolean
required

Whether a billing agreement was attached when the event was recorded. false means the event is kept for reporting but will never be invoiced, even if an agreement starts later.

created_at
string<date-time>
required

When Sailer recorded the event.

currency
string
required
Example:

"BRL"

dedupe_key
string
required
entry_kind
enum<string>
required

record for a success; reversal for the entry that undoes one. A reversal carries the same event_code and value_cents as the event it reverses.

Available options:
record,
reversal
event_code
string
required
id
string
required

Unique identifier for a success event.

Pattern: ^sev_[0-9a-f]{32}$
Example:

"sev_9f2ac41d8b7e4a51b0d3e6f7a1c2d3e4"

occurred_at
string<date-time>
required
agreement_id
string | null

Unique identifier for a billing agreement.

Pattern: ^agr_[0-9a-f]{32}$
Example:

"agr_9f2ac41d8b7e4a51b0d3e6f7a1c2d3e4"

contact_id
string | null

Unique identifier for a contact.

Pattern: ^con_[0-9a-f]{32}$
Example:

"con_9f2ac41d8b7e4a51b0d3e6f7a1c2d3e4"

conversation_id
string | null

Unique identifier for a conversation.

Pattern: ^conv_[0-9a-f]{32}$
Example:

"conv_9f2ac41d8b7e4a51b0d3e6f7a1c2d3e4"

deal_id
string | null

Unique identifier for a deal.

Pattern: ^deal_[0-9a-f]{32}$
Example:

"deal_9f2ac41d8b7e4a51b0d3e6f7a1c2d3e4"

object
string
default:success_event
Allowed value: "success_event"
reason
string | null
reverses_event_id
string | null

Unique identifier for a success event.

Pattern: ^sev_[0-9a-f]{32}$
Example:

"sev_9f2ac41d8b7e4a51b0d3e6f7a1c2d3e4"

value_cents
integer | null