Implement the payouts.partially_synced
webhook to know when 30 days of historial payouts have been scanned.
By default, the payouts.partially_synced
webhook triggers when 30 days of historical payouts have been successfully scanned (starting from the most recent payouts). The number of days scanned is a configurable parameter. You can subscribe this webhook to multiple times with different day ranges. It triggers only on the initial scan, and does not trigger during a periodic scan. If an account has zero or a small number of payouts, the initial scan may return all historical data and only fire the payouts.fully_synced
webhook.
Event
payouts.partially_synced
Configuration
Attribute | Type | Description |
---|---|---|
days_synced | integer optional | The number of days to be scanned. The default value is 30. |
Payload
Attribute | Type | Description |
---|---|---|
account | string uuid | ID of the account the payouts were scanned from. |
user | string uuid | ID of the user associated with the account. |
days_synced | integer | The number of days that were scanned. |
available_from | string timestamp | The date of the oldest available payout within the time period provided in the days_synced configuration. The available_from timestamp will precede the available_to timestamp. |
available_to | string timestamp | The date of the most recent available payout within the time period provided in the days_synced configuration. |
available_count | integer | The total number of payouts associated with the account at the moment the webhook call is made. |
Examples
curl -X POST https://api.argyle.com/v1/webhooks \
-u api_key_id:api_key_secret \
-H "Content-Type: application/json" \
-d '{"events": ["payouts.partially_synced"],
"secret": "<secret for signature verification>",
"name": "payouts.partially_synced",
"url": "https://webhook.site/url"}'
curl -X POST https://api.argyle.com/v1/webhooks \
-u api_key_id:api_key_secret \
-H "Content-Type: application/json" \
-d '{"events": ["payouts.partially_synced"],
"secret": "<secret for signature verification>",
"name": "payouts.partially_synced_cr",
“config”: { “days_synced” : 7 },
"url": "https://webhook.site/url"}'
{
"event": "payouts.partially_synced",
"name": "7 days synced",
"data": {
"account": "12db5af4-fd5f-4d1f-bd98-0360df770aa8",
"user": "abdb5af4-fd5f-4d1f-bd10-0360df77012c",
"days_synced": 7,
"available_from": "2019-06-07T20:12:09Z",
"available_to": "2019-06-14T20:12:09Z",
"available_count": 324
}
}