Webhook Events
payment.created
Occurs when a Book Payment is successfully created. Book payments are processed instantly, so the status will typically be Sent. This event does not fire for rejected payments, see payment.rejected instead.
| Relationship | Type | Description |
|---|---|---|
| payment | JSON:API Relationship | The payment. Resource type: payment. |
| account | JSON:API Relationship | The account the payment relates to. Resource type: account. |
| customer | JSON:API Relationship | Optional. The customer the account belongs to. Resource type: customer. |
| recurringPayment | JSON:API Relationship | Optional. The recurring payment that created the payment. Resource type: recurringPayment. |
Example payment.created payload:
{
"data": [
{
"id": "4132",
"type": "payment.created",
"attributes": {
"createdAt": "2021-12-27T12:12:39.133Z",
"status": "Sent",
"direction": "Credit",
"amount": 2500,
"tags": {
"tag": "value"
}
},
"relationships": {
"payment": {
"data": {
"id": "6",
"type": "payment"
}
},
"account": {
"data": {
"id": "10009",
"type": "account"
}
},
"customer": {
"data": {
"id": "10002",
"type": "customer"
}
},
"recurringPayment": {
"data": {
"id": "24",
"type": "recurringPayment"
}
}
}
}
]
}
payment.rejected
Occurs when a book payment gets rejected. This event includes a reason that specifies why the payment was rejected. See Rejections & Returns for possible rejection reasons.
| Relationship | Type | Description |
|---|---|---|
| payment | JSON:API Relationship | The payment. Resource type: payment. |
| account | JSON:API Relationship | The account the payment relates to. Resource type: account. |
| customer | JSON:API Relationship | Optional. The customer the account belongs to. Resource type: customer. |
| recurringPayment | JSON:API Relationship | Optional. The recurring payment that created the payment. Resource type: recurringPayment. |
Example payment.rejected payload:
{
"data": [
{
"id": "291",
"type": "payment.rejected",
"attributes": {
"createdAt": "2021-12-08T18:34:38.533Z",
"reason": "InsufficientFunds",
"direction": "Credit",
"amount": 2500,
"tags": {
"tag": "value"
}
},
"relationships": {
"payment": {
"data": {
"id": "6",
"type": "payment"
}
},
"account": {
"data": {
"id": "10009",
"type": "account"
}
},
"customer": {
"data": {
"id": "10002",
"type": "customer"
}
},
"recurringPayment": {
"data": {
"id": "24",
"type": "recurringPayment"
}
}
}
}
]
}
transaction.created
Occurs when a Book Transaction is created. Since book payments are processed instantly, the transaction is created immediately when the payment is created.
Example transaction.created payload:
{
"data": [
{
"id": "34",
"type": "transaction.created",
"attributes": {
"summary": "Book payment to Jane Doe",
"direction": "Debit",
"amount": 2500,
"balance": 689305,
"createdAt": "2020-07-30T09:17:21.593Z",
"tags": {
"tag": "value"
}
},
"relationships": {
"transaction": {
"data": {
"type": "bookTransaction",
"id": "10001"
}
},
"account": {
"data": {
"id": "1000",
"type": "account"
}
},
"customer": {
"data": {
"id": "1",
"type": "customer"
}
},
"payment": {
"data": {
"id": "515",
"type": "bookPayment"
}
}
}
}
]
}