Add taxes
The Add taxes method adds taxes to charges within the Postpay model (see Particular aspects of charges within the Postpay charging model). Taxes are applicable only for charges in the Opened or Blocked statuses. Positive total tax value is added to the charge amount. Negative tax value is tax refund that is deducted from the charge amount (see Get Charge Info by ID), but the total charge amount cannot become negative. If a tax is added to a charge with the Blocked status, the account balance immediately is changed by the tax value.
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 current reseller and downstream resellers accessible within a method.
POST {base_url}/api/v3/resellers/{reseller_id}/taxes
Arguments
Name | Parameter Type | Data type | Required/ | 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 | integer | Required | Current reseller ID |
taxes | form | array of objects | Обязательный | Information about charges and taxes |
charge_id | path | integer | Required | Charge ID for adding a tax |
name | form | string | Required | Tax name. The tax name is displayed in the Customer Control Panel in the transaction history and in the invoices (see Balance statement, Viewing Charges of the Invoice), and in the Operator Control Panel in the invoices (see Viewing Invoice details) |
description | form | string | Optional | Tax description and additional information |
value | form | float | Required | Tax amount with up to two decimals, for example, 12.53 |
Response model
Name | Data type | Description | ||
---|---|---|---|---|
data | array of objects | Response data | ||
id | integer | Tax ID | ||
type | string | Data type | ||
attributes | object | Tax information | ||
created_at | string | Date and time of tax creation | ||
updated_at | string | Data and time of tax last update | ||
charge_id | integer | ID of the charge with the tax | ||
name | string | Tax name | ||
description | string | Tax description and additional information | ||
value | float | Tax amount |
Status code:
- 200 — request was processed successfully. Taxes are created.
- 401 — authorization error.
- 422 — request was not processed successfully. Taxes are not created.
Request example
POST /api/v3/resellers/1/taxes
Host: test.activeplatform.com
Content-Type: application/vnd.api+json
X-Api-Token: vY5fwetest3gJXZH5uHCw
Accept: application/vnd.api+json
{
"taxes": [
{
"charge_id": "77530",
"name": "VAT",
"description": "VAT",
"value": "11.23"
}
]
}
Response example
{
"data": [
{
"id": "1",
"type": "taxes",
"attributes": {
"created_at": "2020-07-27T05:02:18.576061+0300",
"updated_at": "2020-07-27T05:02:18.576061+0300",
"charge_id": 77530,
"name": "VAT",
"description": "VAT",
"value": "11.23"
}
}
]
}