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.

Server
https://b2b.payer.se

Generated server url

Server Variables

FlowClient Credentials
Token URL/oauth2/token
Scopes
NameDescription
No scopes

Returns all callback urls and types

Auth
Required Scopes:READWRITE
GET /api/v1/events/callbacks
Copy
Responses
200

OK

objectobject
callbacksarray[object]
typestring

Enum: BANK_ID_STATUS_UPDATED,CARD_PAYMENT_AUTHORIZED,CARD_PAYMENT_ERROR,CARD_PAYMENT_REFUNDED,CARD_PAYMENT_SETTLED,CREDIT_USED,INVOICE_CREATED,INVOICE_FINALISED,INVOICE_PAYMENT_RECEIVED,PAYMENT_AUTHORIZED,PAYMENT_SETTLED,PAYOUT_UPDATED,STORED_PAYMENT_DETAILS_UPDATED,SWISH_PAYOUT_UPDATED,SWISH_STATUS_UPDATED,WRITE_OFF_PAYMENT_CREATED

urlsarray[string]
400

Bad Request

401

Unauthorized

403

Forbidden

404

Not Found

500

Internal Server Error

503

Service Unavailable

Response
Copy

Adds callback URL:s to the merchant for a specific event type.

Auth
Required Scopes:READWRITE
Query String
typestring

Enum: BANK_ID_STATUS_UPDATED,CARD_PAYMENT_AUTHORIZED,CARD_PAYMENT_ERROR,CARD_PAYMENT_REFUNDED,CARD_PAYMENT_SETTLED,CREDIT_USED,INVOICE_CREATED,INVOICE_FINALISED,INVOICE_PAYMENT_RECEIVED,PAYMENT_AUTHORIZED,PAYMENT_SETTLED,PAYOUT_UPDATED,STORED_PAYMENT_DETAILS_UPDATED,SWISH_PAYOUT_UPDATED,SWISH_STATUS_UPDATED,WRITE_OFF_PAYMENT_CREATED

urlarray
POST /api/v1/events/callbacks
Copy
Responses
204

No Content

No response body
400

Bad Request

401

Unauthorized

403

Forbidden

404

Not Found

500

Internal Server Error

503

Service Unavailable

Response
Copy

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.

Auth
Required Scopes:READWRITE
Query String
typestring

Enum: BANK_ID_STATUS_UPDATED,CARD_PAYMENT_AUTHORIZED,CARD_PAYMENT_ERROR,CARD_PAYMENT_REFUNDED,CARD_PAYMENT_SETTLED,CREDIT_USED,INVOICE_CREATED,INVOICE_FINALISED,INVOICE_PAYMENT_RECEIVED,PAYMENT_AUTHORIZED,PAYMENT_SETTLED,PAYOUT_UPDATED,STORED_PAYMENT_DETAILS_UPDATED,SWISH_PAYOUT_UPDATED,SWISH_STATUS_UPDATED,WRITE_OFF_PAYMENT_CREATED

urlarray
DELETE /api/v1/events/callbacks
Copy
Responses
204

No Content

No response body
400

Bad Request

401

Unauthorized

403

Forbidden

404

Not Found

500

Internal Server Error

503

Service Unavailable

Response
Copy

Retrieves the event payload matching the supplied token.

After successfully processing the payload the receiver should send an ack for that token

Auth
Required Scopes:READWRITE
Path Params
tokenstring
GET /api/v1/events/{token}
Copy
Responses
200

OK

objectobject
payloadobject
typestring

Enum: BANK_ID_STATUS_UPDATED,CARD_PAYMENT_AUTHORIZED,CARD_PAYMENT_ERROR,CARD_PAYMENT_REFUNDED,CARD_PAYMENT_SETTLED,CREDIT_USED,INVOICE_CREATED,INVOICE_FINALISED,INVOICE_PAYMENT_RECEIVED,PAYMENT_AUTHORIZED,PAYMENT_SETTLED,PAYOUT_UPDATED,STORED_PAYMENT_DETAILS_UPDATED,SWISH_PAYOUT_UPDATED,SWISH_STATUS_UPDATED,WRITE_OFF_PAYMENT_CREATED

400

Bad Request

401

Unauthorized

403

Forbidden

404

Not Found

500

Internal Server Error

503

Service Unavailable

Response
Copy

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.

Auth
Required Scopes:READWRITE
Path Params
tokenstring
GET /api/v1/events/{token}/ack
Copy
Responses
204

No Content

No response body
400

Bad Request

401

Unauthorized

403

Forbidden

404

Not Found

500

Internal Server Error

503

Service Unavailable

Response
Copy

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).

Auth
Required Scopes:READWRITE
Query String
afterstring

Filter for events created after this time.

beforestring

Filter for events created before this time.

offsetinteger

minimum: 0

pageSizeinteger

maximum: 1000

minimum: 0

Default: 200

GET /api/v1/events/unacknowledged
Copy
Responses
200

OK

objectobject
contentsarray[object]
createddate-time
tokenstring
typestring

Enum: BANK_ID_STATUS_UPDATED,CARD_PAYMENT_AUTHORIZED,CARD_PAYMENT_ERROR,CARD_PAYMENT_REFUNDED,CARD_PAYMENT_SETTLED,CREDIT_USED,INVOICE_CREATED,INVOICE_FINALISED,INVOICE_PAYMENT_RECEIVED,PAYMENT_AUTHORIZED,PAYMENT_SETTLED,PAYOUT_UPDATED,STORED_PAYMENT_DETAILS_UPDATED,SWISH_PAYOUT_UPDATED,SWISH_STATUS_UPDATED,WRITE_OFF_PAYMENT_CREATED

offsetint64
pageSizeint32
totalCountint64
400

Bad Request

401

Unauthorized

403

Forbidden

404

Not Found

500

Internal Server Error

503

Service Unavailable

Response
Copy
Powered By