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/ 
Optional

Description

X-Api-TokenheaderstringRequiredAPI token of a manager that performs the operation (see Viewing and updating manager's information)
Content-TypeheaderstringRequiredMedia type of the request. Specify the following: application/vnd.api+json
AcceptheaderstringRequired

Supported media types of the answer. Specify the following: application/vnd.api+json

base_urlpathstringRequiredActivePlatform URL
reseller_idpathintegerRequiredCurrent reseller ID
taxesformarray of objectsОбязательныйInformation about charges and taxes
charge_idpathintegerRequiredCharge 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)

descriptionformstringOptional

Tax description and additional information

valueformfloatRequired

Tax amount with up to two decimals, for example, 12.53

Response model

NameData typeDescription
dataarray of objectsResponse data

idintegerTax ID

typestringData type

attributesobjectTax information


created_atstringDate and time of tax creation


updated_atstringData and time of tax last update


charge_idinteger

ID of the charge with the tax



namestringTax name


descriptionstringTax description and additional information


valuefloatTax 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"
            }
        }
    ]
}