Adding taxes for Charges in Postpay model
The Create Charges 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 with 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.
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 the Manager that performs the operation (see Viewing and updating manager's information) |
Content-Type | header | string | Required | Indicates the media type (text/html or text/JSON) of the response that sent to the client by the server |
Accept | header | string | Required | Information about data types that the client (browser) supports |
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. Tax name is displayed in Customer Control Panel in the Transaction History and in the Invoices (see Balance statement, Viewing Charges of the Invoice), and in 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"
}
}
]
}