- Resource lifecycle changes: Set up entitlements in your service as a result of object creation, such as a
subscription.createdevent. - Balance events: Send out an end-user email when a customer’s pre-paid credit balance is nearing zero.
- Data exports: Receive events when an export of resource data to a destination succeeds or fails.
Delivery of Resource lifecycle changes webhooks typically occurs in near real-time, though occasional delays may occur.For alerts on usage, cost, and credit balance, we evaluate alerts (and therefore issue webhooks) several times a day, but the latency guarantee will be a function of your workload. This can be reduced with provisioning for customers on Growth and Enterprise plans.
Configuring webhooks
Webhooks are configured to anHTTPS URL on your backend server (note that only the HTTPS scheme is accepted for the production version of your webhook configuration).
Each webhook endpoint is associated with a secret (see the X-Orb-Signature clause below). By default, all webhook events are sent to every endpoint.
Debugging webhooks
In the Orb UI, you can test your webhook configuration to ensure that it’s set up properly and ready to receive events from us. From the webhooks portal, you can select on any webhook endpoint to send a “test event.”
If you need to manually trigger a webhook event to be sent to your server, you can also resend it in the UI.
Webhooks retries
Orb guarantees at-least-once delivery for a single webhook event to each of your endpoint. Orb expects a2xx within five seconds as a successful response to a webhook request. If the request returns an error or otherwise times out, Orb will attempt to retry the event on the following retry schedule, stopping when either retries are exhausted or the request is accepted:
- 5 seconds
- 5 minutes
- 30 minutes
- 2 hours
- 5 hours
- 10 hours
- 10 hours
id of a webhook event temporarily in the webhook consumer and refusing to re-process an event if the same id has already been seen.
Automatic disabling of failing webhook endpoints
Any webhook endpoints that return a5XX HTTP status codes for more than 99% of deliveries over a 7-day period will be disabled automatically by Orb to preserve system stability. These endpoints can be re-enabled in the Orb UI.
Webhook patterns
Event types follow the pattern<resource_name>.<verb>, where <resource_name> is the root object that is related to the webhook, and the <verb> is the event that has taken place (e.g. customer.created is a newly created Customer resource).
By convention, a key in the payload will match the resource_name prefix in type (e.g. if the type is subscription.action, the payload will contain the serialized subscription resource under the subscription key).
Webhook Event Types: Resource Lifecycle Changes
Orb currently issues the following webhooks for resource lifecycle changes:backfill.reflected
Issued when a backfill is closed and its events have been processed as usage.backfill.reverted
Issued when a backfill is reverted, reversing its effects.billable_metric.edited
Issued when a billable metric is edited. This webhook is only issued when metadata for the resource changes, as billable metrics are otherwise immutable. Theprevious_attributes object will be present and populated with the previous state of any billable metric attributes that have changed.
credit_note.issued
Issued when a credit note is created.credit_note.marked_as_void
Issued when a credit note is marked as void.customer.balance_transaction_created
Issued when the customer balance changes for an Orb customer. Thebalance_transaction object will be present and populated with the specific entry that modified the balance.
customer.created
Issued when a customer resource is created.customer.edited
Issued when a customer is edited. Theprevious_attributes object will be present and populated with the previous state of any Customer attributes that have changed.
invoice.automation_schedule_step_executed
Issued when a Collections Automations schedule step executes for an invoice. One event fires per step, with one entry inproperties.actions per action that ran (payment retry, email). Unlike most invoice events, the invoice key carries a condensed invoice object designed for running notification workflows without a follow-up API call. See Collections Automations for the full payload reference and examples.
Each entry in
properties.actions is discriminated by its action_type.
send_email entries:
retry_payment entries:
During the migration from Orb’s legacy dunning system, accounts that previously consumed the legacy
invoice.dunning_schedule_* webhooks also receive those events alongside Collections Automations activity, for a deprecation window. See Migrating from legacy dunning webhooks.invoice.edited
Issued when a draft invoice has been edited via the webapp. Theprevious_attributes object will be present and populated with the previous state of any Invoice attributes that have changed.
invoice.invoice_date_elapsed
Issued when theinvoice_date of an invoice has elapsed.
invoice.issue_failed
Issued when an invoice fails to issue.invoice.issued
Issued when an invoice transitions to the"issued" state. "issued" invoices are frozen (they cannot be edited, manually or via the API). The automatically_marked_as_paid property will be true when the issued invoice’s amount due is zero, which results in the invoice status being set to paid.
invoice.manually_marked_as_paid
Issued when an invoice is manually marked as paid.invoice.manually_marked_as_void
Issued when an invoice is manually marked as void.invoice.payment_failed
Issued when automated payment collection for an invoice fails for a configured payment gateway.invoice.payment_processing
Issued when a payment for an invoice starts processing.invoice.payment_succeeded
Issued when automated payment collection for an invoice succeeds for a configured payment gateway. This webhook is not sent for $0 invoices that are automatically marked as paid upon issuance.invoice.sync_failed
Issued when an invoice fails to sync to the invoice provider.invoice.sync_succeeded
Issued when an invoice successfully syncs to the invoice provider.invoice.undo_mark_as_paid
Issued when undoing thePaid status for an invoice that was manually marked as paid.
plan.default_version_set
Issued when a plan’s default version is set.plan.version_created
Issued when a new plan version is created.price.edited
Issued when a price is edited. This webhook is only issued when metadata for the resource changes, as prices are otherwise immutable. Theprevious_attributes object will be present and populated with the previous state of any price attributes that have changed.
resource_event.test
Issued via the Orb UI to test if your webhook configuration is set up properly and ready to receive events from us.subscription.cancellation_scheduled
Issued when a subscription cancellation is scheduled for the future.subscription.cancellation_unscheduled
Issued when a previously scheduled subscription cancellation is unscheduled/cancelled.Unscheduling a cancellation is a lossy operation—the subscription may not fully match its original pre-cancellation state.
subscription.created
Issued when a subscription resource is created.subscription.edited
Issued when a subscription has been edited. This will not be triggered for changes to pricing.subscription.ended
Occurs whenever a customer’s subscription ends/lapses.subscription.fixed_fee_quantity_updated
Issued when a subscription’s fixed fee quantity has been updated.subscription.plan_change_scheduled
subscription.plan_changed
Issued when a scheduled plan change occurs.subscription.plan_version_change_scheduled
Issued when a plan version change is scheduled in the future for a subscription.subscription.plan_version_changed
Issued when a subscription moves to a new plan version.subscription.started
Issued when a subscription begins.subscription.trial_ended
Issued when a subscription’s trial ends.Webhook Event Types: Usage Patterns and Balance Events
Orb currently issues the following usage patterns and balance events webhooks:customer.credit_balance_depleted
Issued when a customer’s prepaid credit balance is depleted.customer.credit_balance_dropped
Issued when a customer’s prepaid credit balance is depleted to a configured threshold.customer.credit_balance_recovered
Issued when a customer’s prepaid credit balance is replenished after depletion.subscription.alert_disabled
Issued when Orb automatically disables an alert. Currently sent when a grouped cost alert exceeds the per-evaluation group cardinality limit and is disabled for the affected subscription.reason identifies why the alert was disabled, and cardinality / cardinality_limit report the observed and maximum group counts.
subscription.cost_exceeded
Issued when a subscription’s accrued spend for a month exceeds a pre-configured currency amount.Orb will not evaluate alerts on cost that are configured with a threshold below the total of a plan’s fixed costs with a prioritized cadence during billing period rollovers. These alerts can be expected to fire near the first actual usage event received for the new billing period and will subsequently be evaluated several times a day. The evaluated spend is the running invoice total after any credit offsets, so prepurchased credits applied to the subscription reduce the spend that is compared against the threshold.
subscription.grouped_cost_exceeded
Issued when one or more groups of a grouped cost alert exceed a pre-configured currency amount. A single event batches every group that crossed a threshold in the same evaluation. Each entry ingroups reports that group’s group_values (in grouping_keys order), the amount_threshold it crossed, and its evaluated_amount.
subscription.usage_exceeded
Issued when a billable metric in a subscription exceeds a pre-configured quantity threshold.Webhook Event Types: Accounting Sync
Orb issues the following webhooks when syncing resources to external accounting systems.These events are only emitted when the Accounting Sync integration is enabled and configured. Supported connection types are “quickbooks” and “netsuite”. See Accountingand QuickBookssetup guides.
Accounting Sync Record object
Theaccounting_sync_record included in these events contains the following fields:
credit_block.accounting_sync_failed
Issued when a credit block fails to sync to the configured accounting system.credit_block.accounting_sync_succeeded
Issued when a credit block successfully syncs to the configured accounting system.credit_note.accounting_sync_failed
Issued when a credit note fails to sync to the configured accounting system.credit_note.accounting_sync_succeeded
Issued when a credit note successfully syncs to the configured accounting system.customer.accounting_sync_failed
Issued when a customer fails to sync to the configured accounting system.customer.accounting_sync_succeeded
Issued when a customer successfully syncs to the configured accounting system.invoice.accounting_sync_failed
Issued when an invoice fails to sync to the configured accounting system.invoice.accounting_sync_succeeded
Issued when an invoice successfully syncs to the configured accounting system.subscription.accounting_sync_failed
Issued when a subscription fails to sync to the configured accounting system.subscription.accounting_sync_succeeded
Issued when a subscription successfully syncs to the configured accounting system.transaction.accounting_sync_failed
Issued when a transaction fails to sync to the configured accounting system.transaction.accounting_sync_succeeded
Issued when a transaction successfully syncs to the configured accounting system.Webhook Event Types: Data Exports
Orb currently issues the following webhooks for data exports:data_exports.transfer_error
Issued upon a failed transfer of resource data to a destination.data_exports.transfer_success
Issued upon a successful transfer of resource data to a destination.Webhooks security
Each webhook event sent by Orb also includes two specific headers in the request:X-Orb-Timestamp: This header represents the time that the webhook was sent from Orb. You can check this timestamp and compare it to a configured threshold in your system, in order to prevent processing of the webhook event. This can be a mitigation against replay attacks where webhook events are re-sent, causing downstream systems to behave unexpectedly.X-Orb-Signature: The signature header (formatted asv1=<signature>) is a security header which can be used to confirm that the webhook event originated from Orb. We highly recommend verifying the signature, and only processing events where the header matches the signature you generate. Since each webhook endpoint is associated with a secret, your backend server should re-compute the signature by preparing the payload and subsequently computing an HMAC with the SHA 256 function.- The
payloadfor the HMAC is the literal"v1:"followed by the ISO formatX-Orb-Timestampand finally the literal:followed by the event message body itself. - You should use the configured secret for the endpoint URL as the signing secret for the HMAC.
- When comparing to your generated HMAC, you can either prefix the literal
v1=to compare withX-Orb-Signatureheader directly, or extract the element afterv1=inX-Orb-Signatureto check against your generated value.
- The