Skip to main content

TransactionsImported Event

Fired when transactions for a period of time or a report have been successfully imported from a payment provider or if an error occurred while importing the transactions.

warning

Webhooks and Notifications are in preview

Notification Payload

Example:

{
"id": "16n4jczvv6", // notification id, same as in `X-PayData-Notification-Id` header
"webhookId": "rddzhevagr", // webhook id, same as in `X-PayData-Webhook-Id` header
"eventType": "TransactionsImported", // event type, same as in `X-PayData-Event-Type` header
"eventRaisedAt": "2024-10-28T09:28:40.1949759Z", // event raised timestamp
"eventData": {
"partnerId": "326vgsymrg", // partner id
"userId": "x96mdcvnzr", // user id
"accountId": "gd3kh2w7a19", // account id
"transactions": { // transactions import summary
"dataImportId": "387t3j11ck47tmp", // data import id
"countReceived": 3, // the number of imported transactions (new and updated)
"countAdded": 2, // the number of added transactions
"countUpdated": 1, // the number of updated transactions
"bookingDateStart": "2024-10-27T00:00:00", // the earliest transaction booking date
"bookingDateEnd": "2024-10-27T00:00:00", // the latest transaction booking date
"createdAt": "2024-10-28T09:28:36.5546876Z", // import timestamp
"status": "Done", // import status
"warnings": [],
"errors": []
},
"report": { // report data has the same model as returned by the GetReport method, included for report based accounts only
"id": "wjmsxpyskwet4z", // report id
"name": "2024-10-27-57", // report name
"elementStatistics": {
"count": 3, // the number of imported transactions
"first": "2024-10-27T00:00:00Z", // deprecated
"bookingDateStart": "2024-10-27T00:00:00Z", // the earliest transaction booking date
"last": "2024-10-27T00:00:00Z", // deprecated
"bookingDateEnd": "2024-10-27T00:00:00Z" // the latest transaction booking date
},
"reportDate": "2024-10-27T00:00:00Z", // report date
"reportPeriod": {}, // report period
"createdAt": "2024-10-28T09:28:33.2469253Z", // report creation timestamp
"modifiedAt": "2024-10-28T09:28:38.0062078Z", // report modification timestamp
"importedAt": "2024-10-28T09:28:38.0062076Z", // import timestamp
"state": "imported", // report state
"warnings": [],
"errors": []
}
}
}

Example with an error:

{
"id": "26231cg7gr",
"webhookId": "rddzhevagr",
"eventType": "TransactionsImported",
"eventRaisedAt": "2024-10-28T09:42:17.1295162Z",
"eventData": {
"partnerId": "326vgsymrg",
"userId": "x96mdcvnzr",
"accountId": "d8kyhnd2fj8",
"transactions": {
"dataImportId": "71yb75jyfp1xce1",
"countReceived": 0,
"countAdded": 0,
"countUpdated": 0,
"createdAt": "2024-10-28T09:42:12.9572301Z",
"status": "Failed",
"warnings": [],
"errors": [
{
"type": "ImportFailure",
"message": "Error importing transactions",
"isUserActionRequired": false,
"isTemporary": false
}
]
},
"report": {
"id": "xjvs7gybj82tn3",
"name": "2024-10-27-58",
"elementStatistics": {
"count": 0
},
"reportDate": "2024-10-27T00:00:00Z",
"reportPeriod": {},
"createdAt": "2024-10-28T09:42:06.8625122Z",
"modifiedAt": "2024-10-28T09:42:14.9372957Z",
"state": "import_error",
"error": "Fehler beim Einlesen",
"warnings": [],
"errors": [
{
"type": "ReportParseFailure",
"message": "Report parse failure",
"isUserActionRequired": false,
"isTemporary": false
}
]
}
}
}

The notification payload you receive for the TransactionsImported event type has the same data model as the response from the CreateTestImportEvent method.

Testing Webhooks for the TransactionsImported Event Type

Use the CreateTestImportEvent method 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.

tip

You can create a webhook as Disabled to prevent PayData from trying to use it right away. After testing you can make it active.

Example:

POST /webhook/v1/testevents/transactionsimported HTTP/1.1
Host: api-sandbox.paydata-api.com
Content-Type: application/json
Authorization: Bearer **************

{
"accountId": "yzdmf84ktk",
"transactions": {
"dataImportId": "ppytnmfk1k5s7"
},
"webhookIds": ["sd76fgfsdfks"]
}

The account and the data import 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 properties of transactions and report objects to be included in the notifications. For properties, for which you do not provide values, current values from the Account or DataImport will be used.

Example:

POST /webhook/v1/testevents/transactionsimported HTTP/1.1
Host: api-sandbox.paydata-api.com
Content-Type: application/json
Authorization: Bearer **************
{
"accountId": "gd3khyzyvc3",
"transactions": {
"dataImportId": "ppytnmfk1k5s7",
"countReceived": 722,
"countAdded": 733,
"countUpdated": 440,
"bookingDateStart": "2025-01-09T00:00:22.0000000Z",
"bookingDateEnd": "2025-01-09T00:00:22.0000000Z",
"createdAt": "2025-01-12T15:22:22.3688705Z",
"status": "Done",
"errors":[
{
"type": "CredentialsFailure",
"message":"Login failed, credentials not valid",
"providerMessage":"Insufficient permissions",
"isUserActionRequired":true,
"isTemporary":false
}],
"warnings":[
{
"type": "ImportFailure",
"message":"Some transactions were not imported",
"providerMessage":"",
"isUserActionRequired":false,
"isTemporary":false
}]
},
"report":{
"id": "j4pa21bnjn5bp",
"name": "Stripe test report 1",
"elementStatistics": {
"count": 8,
"bookingDateStart": "2025-01-09T00:00:00.0000000Z",
"bookingDateEnd": "2025-01-09T00:00:00.0000000Z"
},
"reportDate": "2025-01-09T00:00:00.0000000Z",
"reportPeriod": {
"start": "2025-01-09T00:00:00.0000000Z",
"end": "2025-01-09T00:00:00.0000000Z"
},
"depositDate": null,
"createdAt": "2025-01-12T15:21:58.1446366Z",
"modifiedAt": "2025-01-12T15:22:04.0099404Z",
"importedAt": "2025-01-12T15:22:04.0099403Z",
"state": "imported",
"warnings": [],
"errors": []
},
"webhookIds": ["rynxhj4fd6"]
}