Overview
Webhooks let you subscribe to Subtotal system events and receive real-time HTTP requests when those events occur. Use webhooks to keep your systems in sync with connection and purchase activity.Properties included with every event
These properties are included with each webhook request:| Key | Type | Description |
|---|---|---|
| type | string | The webhook event type |
| id | string | Identifier for the webhook |
| payload | string | The payload of the webhook |
connection.activated
Connections areactivated when a customer successfully links their account.
| Key | Type | Description |
|---|---|---|
| payload.connection.connection_id | string | Identifier for the connection |
| payload.connection.customer_id | string | Identifier for the associated customer |
| payload.connection.retailer_id | string | Identifier for the retailer in the connection |
| payload.connection.email | string | Email address of the associated customer |
| payload.connection.mobile | string | Mobile phone number of the associated customer |
| payload.connection.status | string | Current status of the connection |
connection.activated event
connection.unauthenticated
Connections move fromactivated to unauthenticated when a customer needs to re-authenticate their account. For example, when a customer changes their password with the retailer.
| Key | Type | Description |
|---|---|---|
| payload.connection.connection_id | string | Identifier for the connection |
| payload.connection.customer_id | string | Identifier for the associated customer |
| payload.connection.retailer_id | string | Identifier for the retailer in the connection |
| payload.connection.email | string | Email address of the associated customer |
| payload.connection.mobile | string | Mobile phone number of the associated customer |
| payload.connection.status | string | Current status of the connection |
connection.unauthenticated event
connection.disconnected
Connections move todisconnected status when a customer disconnects their account.
| Key | Type | Description |
|---|---|---|
| payload.connection.connection_id | string | Identifier for the connection |
| payload.connection.customer_id | string | Identifier for the associated customer |
| payload.connection.retailer_id | string | Identifier for the retailer in the connection |
| payload.connection.email | string | Email address of the associated customer |
| payload.connection.mobile | string | Mobile phone number of the associated customer |
| payload.connection.status | string | Current status of the connection |
connection.disconnected event
purchase.created
Thepurchase.created event is sent when a new purchase is received from a customer’s connected retailer account.
We recommend using this event when you need to process customer purchases for your use case.
| Key | Type | Description |
|---|---|---|
| payload.connection.connection_id | string | Identifier for the connection |
| payload.connection.customer_id | string | Identifier for the associated customer |
| payload.connection.retailer_id | string | Identifier for retailer in the connection |
| payload.connection.email | string | Email address of the associated customer |
| payload.connection.mobile | string | Mobile phone number of the associated customer |
| payload.connection.status | string | Current status of the connection |
| payload.purchase.purchase_id | string | Identifier for the purchase |
| payload.purchase.date | string | Date of the purchase (ISO 8601) |
| payload.purchase.item_count | number | The number of items in the purchase |
| payload.purchase.subtotal | number | The subtotal of the purchase |
| payload.purchase.tax | number | The sales tax that was paid |
| payload.purchase.total | number | Total amount of the purchase |
| payload.purchase.items[].item_id | string | Identifier for the item |
| payload.purchase.items[].price | number | Price of the item |
| payload.purchase.items[].quantity | number | The quantity purchased |
| payload.purchase.items[].product.product_id | string | Identifier for the product |
| payload.purchase.items[].product.name | string | The name of the product |
| payload.purchase.items[].product.description | string | Description of the item |
| payload.purchase.items[].product.upc | string | Universal identifier for the product (UPC) |
| payload.purchase.items[].product.brand | string | The brand associated with the product |
purchase.created event