Calculate Tax

To calculate tax, use the following URL and a POST method:

{service_URI}/api/v3/marketplace/tax/calculate

where {service_URI} is the service's URI.

For example:

https://marketplace-api.sandbox.marketplace.taxamo.com/api/v3/marketplace/tax/calculate

Details

TypeValue
Endpoint/api/v3/marketplace/tax/calculate
MethodPOST
Seller API Reference DocumentCalculate Tax

Fields

The fields are listed in the Transactions Fields Reference section.

Request Example

In this example, we want to calculate the tax amounts and assign line item level obligations.

The basket contains physical goods that are shipped to Bath in Great Britain and contains two items:

  • 200 EUR physical item sold by seller from EU (EU1M), shipped from China, with Combined Nomenclature (CN) code "8504 31 80 15"
  • 100 EUR physical item sold by seller from China (CN1M), shipped from Poland, with the same CN code.

The first item will have the tax liability assigned to the buyer (and no tax added), the second will have the tax liability assigned to the platform.

curl --request POST \
  --url https://marketplace-api.sandbox.marketplace.taxamo.com/api/v3/marketplace/tax/calculate \
  --header 'content-type: application/json' \
  --header "x-marketplace-token: $TOKEN" \
  --data '{
	"transaction": {
		"currency_code": "EUR",
		"buyer_name": "Scenario #1 buyer",
    "invoice_timestamp": "2020-05-20T01:59:59+04:00",
		"ship_to_address": {
			"street_name": "30 Monmouth Street",
			"city": "Bath",
			"postal_code": "BA1 2AP",
			"country_code": "GB"
		},   
		"description": "Example sale to GB.",
		"transaction_lines": [
			{
        "seller_code": "EU1M",
				"custom_id": "line_1",
				"amount": 150,
				"ship_from_address": {"country_code": "CN"},
				"product_class": "P",
				
				"description": "Goods #1",				
				"parcel_reference": "3897329872423",
				"carrier_id": "DHL",
        "product_cn_code": "8504 31 80 15",
        "product_reference_number": ""
        
        
			}, 
    {
        "seller_code": "CN1M",
				"custom_id": "line_2",
				"amount": 100,
				"ship_from_address": {"country_code": "PL"},
				"product_class": "P",
				
				"description": "Goods #2",				
				"parcel_reference": "3897329872423",
				"carrier_id": "DHL",
        "product_cn_code": "8504 31 80 15",
        "product_reference_number": ""
        
        
    }]
	}
}'

Response Example

The following is an example of the JSON that is returned by the API:

{
   "transaction" : {
      "countries" : {},
      "required_fields" : {
         "tax_required_fields" : [],
         "audit_required_fields" : [],
         "storage_required_fields" : []
      },
      "ship_to_address" : {
         "country_code" : "GB",
         "postal_code" : "BA1 2AP",
         "street_name" : "30 Monmouth Street",
         "city" : "Bath"
      },
      "amount" : 250,
      "tax_country_codes" : "GB",
      "tax_amount" : 20,
      "transaction_lines" : [
         {
            "deducted_tax_rate" : 0,
            "quantity" : 1,
            "product_class" : "P",
            "tax_number_service" : "vies",
            "tax_address_kind" : "ship-to-address",
            "carrier_id" : "DHL",
            "tax_country_code" : "GB",
            "tax_supported" : true,
            "tax_engine" : "taxamo",
            "custom_id" : "line_1",
            "tax_region" : "EU",
            "description" : "Goods #1",
            "tax_entity_name" : "United Kingdom",
            "tax_liability_rule" : "physical-shipment-into-EU-goods-above-150-eur",
            "total_amount" : 150,
            "unit_price" : 150,
            "tax_liability_owner_code" : "buyer",
            "taxes" : [],
            "line_key" : "FXespKi7SifDDEuh",
            "line_num" : 1,
            "kind" : "b2c",
            "product_cn_code" : "8504 31 80 15",
            "parcel_reference" : "3897329872423",
            "reverse_charge" : false,
            "ship_from_address" : {
               "country_code" : "CN"
            },
            "product_reference_number" : "",
            "seller_code" : "EU1M",
            "amount" : 150,
            "deducted_tax_amount" : 0
         },
         {
            "line_key" : "jIZ2xhTg41ezIcwX",
            "taxes" : [
               {
                  "rate" : 20,
                  "rate_type" : "Standard",
                  "tax_name" : "European VAT physical",
                  "amount_fraction_taxable" : 1
               }
            ],
            "line_num" : 2,
            "kind" : "b2c",
            "back_to_back_invoice_country_code" : "PL",
            "product_cn_code" : "8504 31 80 15",
            "reverse_charge" : false,
            "ship_from_address" : {
               "country_code" : "PL"
            },
            "seller_code" : "CN1M",
            "product_reference_number" : "",
            "parcel_reference" : "3897329872423",
            "amount" : 100,
            "tax_amount" : 20,
            "quantity" : 1,
            "product_class" : "P",
            "tax_country_code" : "GB",
            "carrier_id" : "DHL",
            "tax_supported" : true,
            "tax_address_kind" : "ship-to-address",
            "tax_number_service" : "vies",
            "tax_engine" : "taxamo",
            "custom_id" : "line_2",
            "tax_region" : "EU",
            "total_amount" : 120,
            "tax_liability_rule" : "physical-shipment-inside-EU-seller-outside-EU",
            "unit_price" : 100,
            "tax_liability_owner_code" : "P1",
            "tax_entity_name" : "United Kingdom",
            "description" : "Goods #2"
         }
      ],
      "invoice_address" : {
         "city" : "Bath",
         "postal_code" : "BA1 2AP",
         "street_name" : "30 Monmouth Street",
         "country_code" : "GB"
      },
      "currency_code" : "EUR",
      "invoice_timestamp" : "2020-05-20T01:59:59+04:00",
      "product_classes" : "P",
      "buyer_name" : "Scenario #1 buyer",
      "total_amount" : 270,
      "description" : "Example sale to GB.",
      "tax_liability_owner_codes" : "buyer,P1",
      "location_evidence" : {}
   }
}