Developer Guide

Taxes

Returns a list off all the tax settings linked to the logged in account

URL

GET https://api.billagain.com/v1/tax

URL PARAMETERS

None - optional paging values can be passed through

OUTPUT PARAMETERS (3 Fields)

Parameter Format Description
taxSettingID Numeric Unique tax setting identifier
Name Alpha Numeric The tax name
rules Object List
taxRuleID Numeric Unique tax rule identifier
Perc Numeric The Tax percentage
countryID Numeric Unique country identifier
countryStateID Numeric Unique country's state identifier
TaxNumber Alpha Numeric Specified tax, Tax Number

EXAMPLES

JSON Output

HTTP CODE: 200 OK
[
{
  "taxSettingID": 245,
  "Name": "VAT",
  "rules": [
    {
      "taxRuleID": 72,
      "countryID": 71,
      "countryStateID": 5,
      "Perc": 0.14,
      "TaxNumber": "1323123456"
    }
  ]
},
  {
    "taxSettingID": 246,
    "Name": "PSD",
    "rules": [
      {
        "taxRuleID": 74,
        "countryID": 71,
        "countryStateID": 4,
        "Perc": 0.12,
        "TaxNumber": ""
      }
    ]
  }
]

Returns a specific tax setting

URL

GET https://api.billagain.com/v1/tax/{taxSettingID}

URL PARAMETERS (1 Field)

Parameter Format Description
taxSettingID Numeric Unique tax setting identifier

OUTPUT PARAMETERS (3 Fields)

Parameter Format Description
taxSettingID Numeric Unique tax setting identifier
Name Alpha Numeric The tax name
rules Object List
taxRuleID Numeric Unique tax rule identifier
Perc Numeric The Tax percentage
countryID Numeric Unique country identifier
countryStateID Numeric Unique country's state identifier
TaxNumber Alpha Numeric Specified tax, Tax Number

EXAMPLES

JSON Output

HTTP CODE: 200 OK
[
{
  "taxSettingID": 245,
  "Name": "VAT",
  "rules": [
    {
      "taxRuleID": 72,
      "countryID": 71,
      "countryStateID": 5,
      "Perc": 0.14,
      "TaxNumber": "1323123456"
    }
  ]
},
  {
    "taxSettingID": 246,
    "Name": "PSD",
    "rules": [
      {
        "taxRuleID": 74,
        "countryID": 71,
        "countryStateID": 4,
        "Perc": 0.12,
        "TaxNumber": ""
      }
    ]
  }
]

Adds a tax setting to your account

URL

POST https://api.billagain.com/v1/tax

INPUT PARAMETERS (2 Fields)

Parameter Format Description
Name req Alpha Numeric The tax name
rules Object List List of tax rules
Perc req Numeric The Tax percentage
countryID Numeric Unique country identifier
countryStateID Numeric Unique country's state identifier
TaxNumber Alpha Numeric Specified tax, Tax Number

OUTPUT PARAMETERS (3 Fields)

Parameter Format Description
taxSettingID Numeric Unique tax setting identifier
Name Alpha Numeric The tax name
rules Object List List of tax rules
taxRuleID Numeric Unique tax rule identifier
Perc Numeric The Tax percentage
countryID Numeric Unique country identifier
countryStateID Numeric Unique country's state identifier
TaxNumber Alpha Numeric Specified tax, Tax Number

EXAMPLES

JSON Input

  {
    "Name": "VAT",
    "rules": [
      {
        "countryID": 71,
        "countryStateID": 5,
        "Perc": 0.14,
        "TaxNumber": "123123123"
      }
    ]
  }

JSON Output

HTTP CODE: 201 Created
{
  "taxSettingID": 248,
  "Name": "VAT",
  "rules": [
    {
      "taxRuleID": 76,
      "countryID": 71,
      "countryStateID": 5,
      "Perc": 0.14,
      "TaxNumber": "123123123"
    }
  ]
}

Edits a specific tax setting

URL

PUT https://api.billagain.com/v1/tax/{taxSettingID}

URL PARAMETERS (1 Field)

Parameter Format Description
taxSettingID req Numeric Unique tax setting identifier

INPUT PARAMETERS (2 Fields)

Parameter Format Description
Name req Alpha Numeric The tax name
rules Object List List of tax rules - options:
  • Add - by posting a nested rule object and excluding the {taxRuleID}
  • Edit- by posting a nested rule object and including existing {taxRuleID} connected to the this {taxSettingID}
  • Delete - by not including the existing rule object from the rule list
taxRuleID Numeric Unique tax rule identifier
Perc req Numeric The Tax percentage
countryID Numeric Unique country identifier
countryStateID Numeric Unique country's state identifier
TaxNumber Alpha Numeric Specified tax, Tax Number

EXAMPLES

JSON Input

{
  "Name": "Vat",
  "rules": [
    {
      "taxRuleID": 72,
      "countryID": 71,
      "countryStateID": 5,
      "Perc": 0.14,
      "TaxNumber": "123123123"
    },
    {     
      "countryID": 71,
      "countryStateID": 6,
      "Perc": 0.14,
      "TaxNumber": "123"
    }
  ]
}

JSON Output

HTTP CODE: 204 No Content

Delete a tax setting in your account

URL

DELETE https://api.billagain.com/v1/tax/{taxSettingID}

URL PARAMETERS (1 Field)

Parameter Format Description
taxSettingID req Numeric Unique tax setting identifier

EXAMPLES

JSON Output

HTTP CODE: 204 No Content