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

Description

X-Api-TokenheaderstringRequiredAPI token of the Manager that performs the operation (see Viewing and updating manager's information)
Content-TypeheaderstringRequiredIndicates the media type (text/html or text/JSON) of the response that sent to the client by the server
AcceptheaderstringRequiredInformation about data types that the client (browser) supports
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. 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)

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