Events may be sent for certain actions in Payer B2B.
To subscribe for events, use the POST /api/v1/events/callbacks
method below and specify which URL the event should be sent to.
It is possible to subscribe to the same event with multiple callback URLs.
When Payer B2B invokes your registered callback URL, it will append a token
query parameter that can be used to fetch the event payload and acknowledge the event.
Payer B2B will invoke the callback multiple times with an exponential backoff timer until the event is acknowledged using GET /api/v1/events/{token}/ack
.
The the callback is invoked at most 10 times with ~4h30m between the first and last attempt.
After an event is acknowledged, no more callbacks will be made and it will no longer be possible to fetch the event payload.
If you are interested in the payload, make sure to fetch it before the event is acknowledged using GET /api/v1/events/{token}
.
Payer B2B can not guarantee that events are never delivered again after acknowledging so the consumer is encouraged to keep track of event tokens to determine if events are unique.
Available event types can be found by expanding the Events API -> POST /api/v1/events/callbacks
method.
Available event payloads can be found by expanding Models
. Event payloads are named the same as EVENT_TYPES
, but with PascalCase
and are postfixed with Payload
.
Ex: The INVOICE_PAYMENT_RECEIVED
event has a payload named InvoicePaymentReceivedPayload
.
Generated server url
Returns all callback urls and types
OK
Bad Request
Unauthorized
Forbidden
Not Found
Internal Server Error
Service Unavailable
Adds callback URL:s to the merchant for a specific event type.
No Content
Bad Request
Unauthorized
Forbidden
Not Found
Internal Server Error
Service Unavailable
Removes callback URL:s to the merchant for a specific event type.
These URL:s won't receive any more callbacks after this. But since callbacks are only sent to the callback URL:s registered at the time of an event, this also means you should wait a bit after adding new callback URL:s before removing the old ones, to ensure you don't miss any events.
No Content
Bad Request
Unauthorized
Forbidden
Not Found
Internal Server Error
Service Unavailable
Retrieves the event payload matching the supplied token.
After successfully processing the payload the receiver should send an ack for that token
OK
Bad Request
Unauthorized
Forbidden
Not Found
Internal Server Error
Service Unavailable
Confirms that the event payload matching token has been received and processed successfully.
After sending a successful ack callbacks for the event matching this token will not be made and it will no longer be possible to fetch the event.
No Content
Bad Request
Unauthorized
Forbidden
Not Found
Internal Server Error
Service Unavailable
Get all unacknowledged events.
Returns a list of all outstanding unacknowledged events. Use the get/ack endpoints with the tokens to retrieve and acknowledge the events. Intended to be used when getting back up after an outage, to be able to know that you're up to speed with events instead of waiting for us to retry sending events to you (which might take a while if you've been down for a while, due to exponential backoff).
OK
Bad Request
Unauthorized
Forbidden
Not Found
Internal Server Error
Service Unavailable