Implement the accounts.pay_distribution_updated
webhook to know when a pay distribution is updated.
The accounts.pay_distribution_updated
webhook is triggered after:
- You request to update a pay distribution.
- Your user confirms this update.
- Argyle updates the pay distribution successfully.
This webhook notifies you when the pay distribution update is successful. Depending on your pd_config
, this is what the webhook returns:
- If you configure a pay distribution for a single allocation type that is either a bank account or a card, a single
accounts.pay_distribution_updated
webhook is triggered. Thetype
field in the webhook’s payload returnsbank_account
orcard
accordingly. - If you configure a pay distribution that has both a bank account and a card, two separate
accounts.pay_distribution_updated
webhooks are triggered with corresponding payloads for each allocation type.
pay_allocations
webhooks are fired after a successful pay distribution update as well, but they can also trigger during periodic scans if something on the payroll or employment platform changes. Useaccounts.pay_distribution_updated
to track changes you make to the pay distribution configuration.
Remember that a single pay distribution for one account is composed of multiple pay allocations. If you would like to set up webhooks for pay allocations, see these pages:
Event
accounts.pay_distribution_updated
Configuration
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
account string uuid
ID of the account where the pay distribution update was successful.
user string uuid
ID of the user associated with the account.
resource object
The full account object is returned if the webhook subscription contains "include_resource": true
in the configuration.
allocation_id string uuid
ID of the pay allocation passed in the pay distribution config. The value is null
in some edge cases where it is not possible to match the updated pay allocation to any of the user's bank accounts or cards with total accuracy. In such cases, the details
field provides the reason why the updated allocation was not matched.
pay_distribution_changed boolean
Indicates whether a successful pay distribution update has resulted in any changes in the user’s pay distribution details.
For example, when a successful pay distribution update was created using the same pay distribution details that were already present on the user’s employment platform, pay_distribution_changed
returns false
because no details were changed.
type string enum
Denotes the type of allocation that was updated.
Possible values: bank_account
, card
flow string enum
Denotes the type of pay distribution flow that triggered the update.
Possible values:
update
- a pay distribution is updated.removal
- a pay distribution is removed.activation
- a pay allocation becomes active after a microdeposit verification.
details string enum
In some edge cases where it is not possible to match the updated pay allocation to any of the user's bank accounts or cards with total accuracy, the value of the allocation_id
field returns as null
. If the value of allocation_id
is null
, the details
field provides the reason why the updated allocation was not matched.
Possible values:
obfuscated
- the exactallocation_id
cannot be determined because the platform obfuscates bank account or card details.multiple_matching_allocations
- the exactallocation_id
cannot be determined because there are multiple allocations with partially matching bank account or card details used in the pay distribution update.
For example, the partially matching bank account details in bank_account_A
and bank_account_B
result in a multiple_matching_allocations
scenario:
{
"bank_account_A": {
"routing_number": "*****1234",
"account_number": "*********5678",
"account_type": "savings"
},
"bank_account_B": {
"routing_number": "*****1234",
"account_number": "*********5678",
"account_type": "savings"
}
}
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_updated"],
"secret": "<secret for signature verification>",
"name": "accounts.pay_distribution_updated",
"config": { "include_resource": true },
"url": "https://webhook.site/url"}'
{
"event":"accounts.pay_distribution_updated",
"name":"Pay distribution updated successfully",
"data":{
"account":"ada143be-3c90-4534-b7ea-9899674dc6e0",
"user":"3823026e-a964-45f6-b201-6b8c096b30d3",
"resource":{
"id":"ada143be-3c90-4534-b7ea-9899674dc6e0",
"user":"3823026e-a964-45f6-b201-6b8c096b30d3",
"employers":[
"homedepot"
],
"..."
},
"allocation_id":"4334r6e-a964-45eef6-b201-64464",
"pay_distribution_changed":true,
"type":"bank_account",
"details":null,
"flow":"update"
}
}