Implement the accounts.pay_distribution_failed
webhook to know when a pay distribution update fails.
accounts.pay_distribution_failed
is triggered when a direct deposit flow could not be completed and the update is not successful.
A payroll account can allocate a paycheck to multiple accounts. Pay distribution webhooks will fire if any changes are made to any of these paycheck allocations. To monitor if a pay allocation to an individual account changes, set up webhooks for pay allocations, using these pages:
Event
accounts.pay_distribution_failed
Configuration
Attribute | Type | Description |
---|---|---|
include_resource | boolean optional | If set to true in the webhook subscription configuration, the webhook payload returns the full account object as resource . Defaults to false . |
Payload
Attribute | Type | Description |
---|---|---|
account | string uuid | ID of the account where the direct deposit update failed. |
user | string uuid | ID of the user associated with the account. |
error_code | string | Error code that defines the reason the direct deposit update failed. |
error_message | string | A longer text string associated with an error_code that explains why the error occurred. |
resource | object | The full account object is returned if the webhook subscription contains "include_resource": true in the configuration. |
Examples
curl -X POST https://api.argyle.com/v1/webhooks \
-u api_key_id:api_key_secret \
-H "Content-Type: application/json" \
-d '{"events": ["accounts.pay_distribution_failed"],
"secret": "<secret for signature verification>",
"name": "accounts.pay_distribution_failed",
"config": { "include_resource": true },
"url": "https://webhook.site/url"}'
{
"event": "accounts.pay_distribution_failed",
"name": "A pay distribution failed to update",
"data": {
"account": "ada143be-3c90-4534-b7ea-9899674dc6e0",
"user": "3823026e-a964-45f6-b201-6b8c096b30d3",
"error_code": "invalid_mfa",
"error_message": "This user did not provide the correct multi-factor authentication response."
"resource": {
"id": "ada143be-3c90-4534-b7ea-9899674dc6e0",
"user": "3823026e-a964-45f6-b201-6b8c096b30d3",
"employers": [
"homedepot"
],
"..."
}
}
}