Send notifications on closing documents
The Send notifications on closing documents method is used for triggering the closing documents generated event (see Creating an event handler). This event is used for sending notifications to accounts of the current reseller or any of its downstream resellers on closing documents in the New status for the selected period from an ERP system.
An API token of a manager is required for authorization. To get an API token via the Operator Control Panel, see Viewing and updating manager's information.
The manager's API token specified in an API request determines:
- The role and access level of the manager, which determine the availability of a method.
- The current reseller and downstream resellers accessible within a method.
POST {base_url}/api/v3/resellers/{reseller_id}/notifications/external_invoices
Arguments
Name | Parameter Type | Data type | Required/Optional | Description |
---|---|---|---|---|
X-Api-Token | header | string | Required | API token of a manager that performs the operation (see Viewing and updating manager's information) |
Content-Type | header | string | Required | Media type of the request. Specify the following: application/vnd.api+json |
Accept | header | string | Required | Supported media types of the answer. Specify the following: application/vnd.api+json |
base_url | path | string | Required | ActivePlatform URL |
reseller_id | path | number | Required | ID of the current reseller or any of its downstream resellers (see Viewing and updating reseller general information) |
account_ids | form | array | Required | Comma-separated list of account IDs to send the notification |
start_date | form | string | Required | Start date of the billing period for which closing documents are issued |
end_date | form | string | Required | End date of the billing period for which closing documents are issued |
Response model
The method responses with null
and the 200 OK status.
To check that the notifications were sent, use the notifications log (see Notifications log).
If the account_ids
array is empty or has the incorrect format, the method responds with the error description and 422 (Unprocessable Entity) status. Notifications will not be sent.
{
"errors": {
"title": "param is missing or the value is empty: account_ids",
"status": "422"
}
}
Request example
POST /api/v3/resellers/1/accounts/505/notifications/external_invoices
Host: test.activeplatform.com
Content-Type: application/vnd.api+json
X-Api-Token: vY5fwetestK3gJXZH5uHCw
Accept: application/vnd.api+json
{
"account_ids": [
2003421,
2003565,
2013289,
2013459
],
"start_date": "2019-11-01",
"end_date": "2019-11-30"
}
Response example
- Status: 200 OK
- Body:
null