Understanding webhook events

Get to know the fields of you event payload and the list of events fired

Cake would essentially notify you about the activity updates in your account as well as all the Sub-Accounts that would be created by you as part of our ENTERPRISE product.

These events would help you keep your records updates allowing you a seamless integrated experience.

We would now look at how these events are structured and what all type of events are sent from Cake.

Payload structure

With the goal to keep things uniform we have structured our payloads in a way that they follow a similar structure across all events. Here is how a event payload would look like for a newly created transaction

{
      "id": "fdc8f84d-82cb-4800-a0cc-c246e476c2d1",
      "entity": {
        "id": "f1209a94-8f30-4a09-8c62-8b6f58970247",
        "type": "transaction"
      },
      "created_at": "1722616926703",
      "event_name": "transaction-created",
      "resource_url": "https://sandbox.cakecapital.com/api/v1/send/transactions/f1209a94-8f30-4a09-8c62-8b6f58970247/"
    }

The payload fields

FieldDescription
idThe unique identifier of the webhook event
entity.idThe unique identifier of the entity for which this event was created
entity.typeThe entity type
entity.directionThis field is only sent when the entity is transaction and represents whether the transaction direction is inbound or outbound
entity.transaction_idThis field is only sent when the entity is session and represents the associated transaction_id with the session
created_atTimestamp at which this event was fired at
event_nameDenotes the name of the event, helpful in identifying the underlying operation
resource_urlAn environment specific url which can be used to fetch the resource for which this event was created

Events

Following is a comprehensive list of events that we would send to your configured webhook url

Entity TypeEvent nameDescription
corporatecorporate-approvedSent whenever a corporate account is approved
counterpartycounterparty-createdSent whenever a new counterparty is created
counterpartycounterparty-activeSent whenever the counterparty is active to receive payments
counterpartycounterparty-disabledSent whenever a counterparty is marked as disabled
transactiontransaction-createdSent whenever a new transaction is created
transactiontransaction-canceledSent whenever a transaction has been canceled successfully
transactiontransaction-failedSent whenever a transaction has failed
transactiontransaction-expiredSent whenever a transaction expires when it was in intermediate state for too long
transactiontransaction-completedSent whenever a transaction has completed
transactiontransaction-settledSent when a transaction amount gets settled (only applicable for PAYIN transactions)
financial-accountfinancial-account-approvedSent whenever the financial account gets approved.
sessionsession-createdSent when a payin session is created
sessionsession-completedSent when a payin session is completed
sessionsession-expiredSent when a payin session is expired
🚧

There can be scenarios where you could receive multiple calls for the same event, make sure that this case is handled in your integration system.