Scenario 5: Webhooks

The webhooks can provide immediate notifications for billing outcomes. The use of webhooks is dependent on the needs of the business. Ezypay has webhooks that can send out notifications for certain scenarios. For example: For failed payments or retrieving debits by date.

🚧

NOTE

A public bin will be required in order for Ezypay to send all webhooks into

Create a webhook

You can create a webhook (API) that will send a callback request to a URL of your choice in response to events that happen in Ezypay. The webhook will return a full response object containing all details of the object. For example, when a customer created event occurs, the webhook will return the details of the customer object created e.g. name, email, contact information and address.

Event Types

Ezypay provides the following events and subscribed Webhooks can be configured to sent notifications when these events happen:

EventOccurs when...
customer_createEvent when a new customer is created.
customer_updateEvent when a customer's details are updated.
invoice_createdEvent after an invoice is created.
invoice_past_dueEvent when an invoice status has changed to past_due because the invoice due date has passed but the invoice has not been paid. Can occur because of a failed transaction or no transaction was attempted.
invoice_paidEvent when an invoice status has changed to paid because of a successful payment transaction or an external payment was recorded.
subscription_createEvent when a new subscription is created.
subscription_cancelEvent when a subscription is cancelled.
subscription_activateEvent when a subscription is activated.
payment_method_invalidEvent when a customer's payment method becomes invalid. This event is only thrown when a valid payment method becomes invalid. If a payment method is invalid upon creation, no webhook event is triggered.
subscription_payment_reactivateEvent when a customer's subscription is reactivated. A customer's subscription can become deactivated because of past due invoices. When all invoices are resolved, the subscription will automatically reactivate.
credit_note_createdEvent when a credit note is created. This event is triggered when a merchant moves funds to a customer usually as a refund or a dispute.
credit_note_paidEvent when a credit note is successfully paid. Credit note status changed to paid.
credit_note_failedEvent when a credit note transaction has failed. Credit note status changed to failed.
partner_invoice_createdEvent after a partner invoice is created.
partner_invoice_paidEvent when a partner invoice status changed to paid because of a successful payment transaction or an external payment was recorded.
partner_invoice_past_dueEvent when a partner invoice status has changed to past_due. Can occur because the invoice due date has passed but the invoice has not been paid because of a failed transaction or simply no transaction was attempted.

How to create a webhook can be found here:
https://developer.ezypay.com/reference#create-webhook

🚧

NOTE

In an event whereby Ezypay fails to send a webhook to the integrator. Ezypay will try a maximum of 32 times only

Automatic Retries

If a webhook notification fails (i.e. endpoint does not return a 2xx HTTP or timeout response), Ezypay will automatically attempt to resend the webhook notification to your webhook URL. For the next 24 hours, Ezypay will resend the webhook notification every 60 mins after each fail attempt.

Each failed attempt will be recorded in the webhook event notification log in the order in which they were created, allowing for follow-up support action. You can retrieve the notification log by calling the List webhook notification log (API). Failed attempts can be identified as they will have the status = fail. The webhook notifications log will display the most up-to-date information on webhooks sent in the system.

Simulate a webhook event

You can test out a webhook to ensure it is working correctly by manually simulating a webhook event (API). You can specify what events will trigger the webhook response. A record of events will be created in the webhook notification log. You can view this log by calling the List webhook notification log (API)

View a webhook

You can retrieve a webbhook (API) to view details such as the events that have been assigned to trigger this webhook.

How to retrieve webhook details can be found here:
https://developer.ezypay.com/reference#retrieve-webhook-details
https://developer.ezypay.com/reference#list-webhook-notification-logs

Update a webhook

You can update a webhook (API) to make changes to an existing webhook such as:

  • changing the callback URL
  • adding or removing events that will trigger this webhook

How to update a webhook can be found here:
https://developer.ezypay.com/reference#update-webhook

Delete a webhook

You can delete a webhook (API) that is no longer required.

How to delete a webhook can be found here:
https://developer.ezypay.com/reference#delete-webhook

👍

Steps to setup your Ezypay POSTman environment:

Guide to setting up Ezypay's POSTman sandbox environment

Setting up Ezypay's webhooks collection

Incase of missing button, just click import on your POSTman application and select "Link":
https://www.getpostman.com/collections/91cf21f3299732669f20


What’s Next

Scenario 6: Settlement
The sixth scenario in the integration process