Webhooks API Documentation
Transaction
By subscribing to a transaction topic, you will be notified of two transaction types: payments and refunds. Check the
Resource Attributes
| data.transactions[0] | ||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| id | integer | The transaction's ID. | ||||||||||||||||||||||||
| invoice_id | integer | ID of the associated invoice. | ||||||||||||||||||||||||
| currency_code | string | The currency ISO code. | ||||||||||||||||||||||||
| amount_cents | integer | The amount in cents of the transaction. | ||||||||||||||||||||||||
| amount | string | The amount in localized currency of the transaction. | ||||||||||||||||||||||||
| error_message | string | The error message for the transaction if it failed. | ||||||||||||||||||||||||
| description | string | The description of the transaction. | ||||||||||||||||||||||||
| voided_at | timestamp | The date the transaction was voided. | ||||||||||||||||||||||||
| payment_type_id | integer | The type id of the available payment method. | ||||||||||||||||||||||||
| type | string | Type is one of ['Payment', 'Refund']. | ||||||||||||||||||||||||
| settled | boolean | Whether transaction has settled according to the payment gateway. Settled transactions cannot be voided. | ||||||||||||||||||||||||
| state | string | One of ['failed', 'processing', 'completed', 'checkout'] | ||||||||||||||||||||||||
| uuid | uuid | UUID of the transaction. | ||||||||||||||||||||||||
| autobill | boolean | Whether or not this transaction is on autobill. | ||||||||||||||||||||||||
| payment_id | integer | ID of the payment. Only included if the transaction is a Refund. | ||||||||||||||||||||||||
| external_transaction_id | integer | ID of the transaction according to the external transaction processor. | ||||||||||||||||||||||||
| payment_type | string | Type of payment. One of ['cash', 'check', 'creditcard', 'ach', 'comp', 'free', 'external_creditcard', 'square', 'paypal', 'external', 'credit']. | ||||||||||||||||||||||||
| created_at | timestamp | Timestamp for when transaction was created. | ||||||||||||||||||||||||
| updated_at | timestamp | Timestamp for when transaction was last updated. | ||||||||||||||||||||||||
| invoice | object | Details of the associated invoice.
| ||||||||||||||||||||||||
transaction.created
Triggers when a new transaction is created.
Payload Example
Transaction Created Webhook Payload
{
"topic": "transaction.created",
"webhook_id": 11,
"business_id": 1,
"data": {
"transactions": [
{
"id": 1,
"invoice_id": 1,
"currency_code": "USD",
"amount_cents": 10000,
"amount": "100.00",
"error_message": null,
"description": "Stored Visa 1111",
"voided_at": null,
"payment_type_id": 3,
"type": "Payment",
"settled": false,
"state": "checkout",
"uuid": "c8421956-fcef-412c-bc1f-92b7b2dd7156",
"autobill": false,
"external_transaction_id": "abc123",
"payment_type": "creditcard",
"created_at": "2012-09-03T09:05:02Z",
"updated_at": "2012-09-03T09:05:02Z",
"invoice": {
"id": 1,
"total_cents": 10000,
"state_events": [
"reopen"
],
"send_receipt": false,
"receipt_email": "john@example.com",
"currency": "USD",
"state": "closed"
}
}
]
}
}
transaction.updated
Triggers when a certain properties of a transaction are updated.
The specific list of fields that trigger an update are:
| Changes to these fields trigger a notification |
|---|
| invoice_id |
| currency_code |
| amount_cents |
| error_message |
| description |
| voided_at |
| payment_type_id |
| type |
| settled |
| state |
| uuid |
| autobill |
| payment_id |
| external_transaction_id |
| payment_type |
| data | ||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| transactions | array | Array of one updated transaction. | ||||||||||||||||||||||||||||||||||||||||||||||||
| previous | object | Previous values of the resource. The following are supported:
| ||||||||||||||||||||||||||||||||||||||||||||||||
Payload Example
Transaction Updated Webhook Payload
{
"topic": "transaction.updated",
"webhook_id": 12,
"business_id": 2,
"data": {
"transactions": [
{
"id": 60,
"invoice_id": 57,
"currency_code": "USD",
"amount_cents": 900,
"amount": "9.00",
"error_message": null,
"description": "Cash",
"payment_type_id": 1,
"type": "Refund",
"settled": true,
"state": "completed",
"uuid": "0e7c369c-c4c9-439d-a8eb-2a95bdb53789",
"autobill": false,
"payment_id": 59,
"external_transaction_id": null,
"payment_type": "cash",
"voided_at": "2019-03-22T19:43:23Z",
"created_at": "2019-03-22T19:32:23Z",
"updated_at": "2019-03-22T19:43:23Z",
"invoice": {
"id": 57,
"total_cents": 900,
"state_events": [
"reopen"
],
"send_receipt": false,
"receipt_email": "john@example.com",
"currency": "USD",
"state": "closed"
}
}
],
"previous": {
"voided_at": null,
"updated_at": "2019-03-22T19:32:23Z"
}
}
}