AccountCreated
AccountUpdated
AccountDeleted
Events
An account has been successfully created, updated or deleted.
Webhooks and Notifications are in preview
Notification Payload
Example:
{
"id": "x9rmdjcpy6", // notification id, same as in `X-PayData-Notification-Id` header
"webhookId": "rddzhevagr", // webhook id, same as in `X-PayData-Webhook-Id` header
"eventType": "AccountCreated", // (or "AccountUpdated" or "AccountDeleted") event type, same as in `X-PayData-Event-Type` header
"eventRaisedAt": "2024-07-25T08:20:46.752678Z", // event raised timestamp
"eventData": {
"partnerId": "326vgsymrg", // partner id
"userId": "x96mdcvnzr", // user id
"accountId": "85jkt8nyc7w", // account id
"account": {
"id" : "85jkt8nyc7w", // account id
"accountTypeId": "amazon", // account type id
"name": "Amazon", // account name
"status": "Idle", // account status
"elementStatistics": {
"count": 3, // the number of transactions
"first": "2024-08-03T12:01:02.0000000Z", // last transaction booking date
"last": "2024-08-04T12:05:06.0000000Z" // last transaction booking date
},
"accountFields": { // account fields, account type specific
"merchant-id": "AIXXXXXXXXSG",
"marketplace": "amazon.de",
"start-date": "2024-08-03T12:00:00.0000000Z"
},
"errors": [],
"warnings": []
}
}
}
Example with an error:
{
"id": "x9rmdjcpy6", // notification id, same as in `X-PayData-Notification-Id` header
"webhookId": "rddzhevagr", // webhook id, same as in `X-PayData-Webhook-Id` header
"eventType": "AccountError", // event type, same as in `X-PayData-Event-Type` header
"eventRaisedAt": "2024-07-25T08:20:46.752678Z", // event raised timestamp
"eventData": {
"partnerId": "326vgsymrg", // partner id
"userId": "x96mdcvnzr", // user id
"accountId": "85jkt8nyc7w", // account id
"account": {
"id" : "85jkt8nyc7w", // account id
"accountTypeId": "amazon", // account type id
"name": "Amazon", // account name
"status": "ErrorCredentialsFailed", // account status
"elementStatistics": {
"count": 3, // the number of transactions
"first": "2024-08-03T12:01:02.0000000Z", // last transaction booking date
"last": "2024-08-04T12:05:06.0000000Z" // last transaction booking date
},
"accountFields": { // account fields, account type specific
"merchant-id": "AIXXXXXXXXSG",
"marketplace": "amazon.de",
"start-date": "2024-08-03T12:00:00.0000000Z"
},
"errors": [
{
"type": "CredentialsFailure",
"message": "An error occured while validating the account credentials",
"isUserActionRequired": false,
"isTemporary": false
}
],
"warnings": []
},
}
}
The notification payload you receive for the AccountCreated
, AccountUpdated
or AccountDeleted
event types has the same data model
as the response from the CreateTestAccountCreatedEvent method.
Testing Webhooks for the AccountCreated
, AccountUpdated
or AccountDeleted
Event Types
Use the CreateTestAccountCreatedEvent, CreateTestAccountUpdatedEvent or CreateTestAccountDeletedEvent methods to send test notifications and test your webhooks.
You need to provide a valid account id and optionally a list of webhook ids. The provided webhooks must be subscribed to the tested event and can have Active
or Disabled
status. If you do not provide webhook ids, then notifications will be sent to all active webhooks, subscribed to the event.
You can create a webhook as Disabled
to prevent PayData from trying to use it right away. After testing you can make it active.
The response of the CreateTestAccountCreatedEvent, CreateTestAccountUpdatedEvent and CreateTestAccountDeletedEvent methods contains the payload of the sent notification .
Example:
POST /webhook/v1/testevents/accountcreated HTTP/1.1
Host: api-sandbox.paydata-api.com
Content-Type: application/json
Authorization: Bearer **************
{
"id": "yzdmf84ktk",
"webhookIds": ["rynxhj4fd6"]
}
The account should exist in PayData.
When you call this endpoint notifications are sent to the URLs, specified for the webhooks. Additionally you get a list of the sent notifications as a response. Each notification in the list has the same data model as the payload of the sent notification.
You can optionally specify values for some of the account properties to be included in the notifications. For properties, for which you do not provide values, current values from the account will be used.
Example:
POST /webhook/v1/testevents/accountupdated HTTP/1.1
Host: api-sandbox.paydata-api.com
Content-Type: application/json
Authorization: Bearer **************
{
"id": "yzdmf84ktk",
"name": "Other account name",
"status": "ErrorCredentialsFailed",
"elementStatistics": {
"count": 111,
"first": "2024-10-27T11:11:00Z",
"last": "2025-01-10T11:11:00Z"
},
"errors":[
{
"type": "CredentialsFailure",
"message": "New logins not possible",
"providerMessage": "",
"isUserActionRequired": false,
"isTemporary": false
}],
"warnings":[
{
"type": "ImportFailure",
"message":"Some imports fail for unknown reason",
"providerMessage":"",
"isUserActionRequired":false,
"isTemporary":true
}
]
"webhookIds": ["rynxhj4fd6"]
}