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.
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": "bookPayment"
}
},
"account": {
"data": {
"id": "10009",
"type": "account"
}
},
"customer": {
"data": {
"id": "10002",
"type": "customer"
}
}
}
}
]
}
payment.rejected
Occurs when a book payment gets rejected. This event includes a reason that specifies why the payment was rejected. See Error Codes for possible rejection reasons.
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": "bookPayment"
}
},
"account": {
"data": {
"id": "10009",
"type": "account"
}
},
"customer": {
"data": {
"id": "10002",
"type": "customer"
}
}
}
}
]
}
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"
}
}
}
}
]
}