Skip to main content

AccountTypeUpdated Event

An account type has been updated with new state information.

warning

Only changes to the state, errors and warnings trigger the notification.

warning

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": "AccountTypeUpdated" // same as in `X-PayData-Event-Type` header
"eventRaisedAt": "2024-07-25T08:20:46.752678Z", // event raised timestamp
"eventData": {
"partnerId": "326vgsymrg", // partner id
"accountType": {
"id" : "stripe_api", // account type id
"name": "Stripe", // account type name
"deprecated": false,
"connectionTestSupported": false,
"accountFields": [
// the account fields
],
"transactionFields": [
// the transaction fields
],
"logos": {
"Standard": "https://paydatapublic.blob.core.windows.net/images/accounts/stripe.png",
"Gray": "https://paydatapublic.blob.core.windows.net/images/accounts/stripe_gray.png",
"Svg": "https://paydatapublic.blob.core.windows.net/images/accounts/stripe.svg"
},
"helpUrls": {},
"state": "Ok", // account type state
"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": "AccountTypeUpdated" // same as in `X-PayData-Event-Type` header
"eventRaisedAt": "2024-07-25T08:20:46.752678Z", // event raised timestamp
"eventData": {
"partnerId": "326vgsymrg", // partner id
"accountType": {
"id" : "stripe_api", // account type id
"name": "Stripe", // account type name
"deprecated": false,
"connectionTestSupported": false,
"accountFields": [
// the account fields
],
"transactionFields": [
// the transaction fields
],
"logos": {
"Standard": "https://paydatapublic.blob.core.windows.net/images/accounts/stripe.png",
"Gray": "https://paydatapublic.blob.core.windows.net/images/accounts/stripe_gray.png",
"Svg": "https://paydatapublic.blob.core.windows.net/images/accounts/stripe.svg"
},
"helpUrls": {},
"state": "Degraded", // account type state
"errors": [
{
"type": "LoginFailure",
"message": "New authentications with the provider are not possible",
"isUserActionRequired": false,
"isTemporary": true
}
],
"warnings": []
}
}
}

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

Testing Webhooks for the AccountTypeUpdated Event Type

Use the CreateTestAccountTypeUpdatedEvent method to send test notifications and test your webhooks.

You need to provide a valid account type id and optionally a list of webhook ids. The provided webhooks must be subscribed to the AccountTypeUpdated 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/accounttypeupdated HTTP/1.1
Host: api-sandbox.paydata-api.com
Content-Type: application/json
Authorization: Bearer **************

{
"id": "stripe_api",
"webhookIds": ["rynxhj4fd6"]
}

The account type should exist in PayData and be available to the partner.

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 state, errors or warnings account type properties to be included in the notifications. For properties, for which you do not provide values, current values from the account type will be used.

Example:

POST /webhook/v1/testevents/accounttypeupdated HTTP/1.1
Host: api-sandbox.paydata-api.com
Content-Type: application/json
Authorization: Bearer **************
{
"id": "stripe_api",
"state": "Down",
"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"]
}