Webhook Events

Webhooks serve as a mechanism that enables real-time communication between different your application and Pay Advantage

Webhooks allow you to receive Pay Advantage events to endpoints that you host. The current list of events are detailed below. Please check from time to time as these will be updated occasionally.

Webhook Event Data

πŸ“˜

Release date for Webhook payloads: 7th May 2024

Prior to 7th May the Webhook Data attribute is only available by request. After 7th of May the webhook Data attribute will be enabled for all webhook API users

Historically, when processing Webhook Events, the webhook consumer has been responsible for evaluating the type of event that occurred and then making a subsequent request to the PayAdvantage API in order to retrieve the resource that the event related to.

Webhook Events now include the resource that the event relates to by including the Data attribute in the request body. The schema exactly matches the PayAdvantage API for each type of resource. For example, if a payment.created event occurs, the Data attribute will include the payment that was created, and it will be identical to the data you would have received by making a request to the API by using the ResourceUrl.

It is important to note that when processing Webhook Events, the Data attribute contains a copy of the resource from a point in time when the event was sent, not when the event occurred. Under most scenarios this shouldn't pose a problem, you should just be aware that the copy of the resource is not a point in time capture from when the event occurred.

[
    {
        "Code": "1FFDB5FA",
        "MerchantCode": "PA12345",
        "DateCreated": "2024-04-02T15:38:02.487+00:00",
        "DateUpdated": "2024-04-02T15:38:08.527+00:00",
        "Event": "payment.created",
        "ResourceCode": "9SFUZA",
        "ResourceUrl": "https://test.payadvantage.com.au/payments/9SFUZA",
        "EndpointCode": "TSFUZA",
        "EndpointUrl": "http://mysite.com/pawebhook",
        "Status": "sending",
        "Data": {
            "Code": "9SFUZA",
            "DateCreated": "2024-04-03T02:37:54.640+11:00",
            "DatePaid": "2024-04-03T02:37:54.640+11:00",
            "DateFailed": null,
            "DateClears": "2024-04-04T00:00:00.000+11:00",
            "DateSettled": null,
            "DateUpdated": "2024-04-03T02:37:54.640+11:00",
            "ReadyToSettle": true,
            "FailCode": null,
            "FailReason": null,
            "PaymentType": "realtime_credit_card",
            "Amount": 34,
            "AmountIncFees": 35.34,
            "AmountRefunded": 0,
            "Customer": {
                "Code": "PF2UZA",
                "Name": "John Davies"
            },
            "BPAYReference": null,
            "ExternalID": null,
            "ExternalReference": null,
            "SettlementCode": null,
            "DDR": null
        }
    }
]

List of supported Webhook Events

Endpoint Creation

All events in this category return a Webhook Endpoint in the Data attribute.

EventDescriptionName
Endpoint ArmedFired every time an endpoint passes the arming process.
The arming process is initiated when an endpoint is registered or re-registered with Pay Advantage.
webhook_endpoint.armed

Payments

All events in this category return a Payment in the Data attribute.

EventDescriptionName
Payment CreatedSent every time a payment is created.payment.created
Payment FailureSent every time a payment fails.payment.failed
Payment SettledSent every time a payment settles. Please note that a payment can still fail after it has settled due to a chargeback.payment.settled

Customers

All events in this category return a Customer in the Data attribute.

EventDescriptionName
Customer CreatedSent every time a new customer is created.customer.created

Direct Debits

All events in this category return a Direct Debit in the Data attribute.

EventDescriptionName
Direct Debit Request CreatedSent every time a direct debit requests is created.ddr.created
Direct Debit Request DeletedSent every time a direct debit requests is deleted.ddr.deleted
Direct Debit Request AuthorisedSent every time a direct debit requests is authorised by a customer.ddr.authorised
Direct Debit Request ActivatedSent every time a direct debit requests is approved by Pay Advantage.ddr.activated
Direct Debit Request RejectedSent every time a direct debit requests is rejected.ddr.rejected
Direct Debit Request CancelledSent every time a direct debit requests is cancelled.ddr.cancelled
Direct Debit Request PausedSent every time a direct debit requests is paused.ddr.paused
Direct Debit Request ResumedSent every time a direct debit requests is resumed.ddr.resumed
Direct Debit Request CompletedSent every time a direct debit requests is completed. This occurs when the direct debit is for a fixed amount and all installments are completed.ddr.completed
Direct Debit Request Re-activatedSent every time a direct debit requests is re-activated. This usually occurs when a payment fails after the direct debit has completed.ddr.reactivated

Webhook Retention Time

It is very important to understand that Webhook Events are only short lived. Once an event has been accepted by all active Endpoints it is eligible for deletion. Any Event older than 1 month is eligible for deletion; even if it has not been accepted.