curl --request POST \
--url https://api.exowpee.com/v1/catalog/taxes/simulate \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.exowpee.com/v1/catalog/taxes/simulate"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.exowpee.com/v1/catalog/taxes/simulate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.exowpee.com/v1/catalog/taxes/simulate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.exowpee.com/v1/catalog/taxes/simulate"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.exowpee.com/v1/catalog/taxes/simulate")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.exowpee.com/v1/catalog/taxes/simulate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"gross": 123,
"before_vat_amount": 123,
"vat_amount": 123,
"after_vat_amount": 123,
"net": 123,
"total": 123,
"product_nature": "<string>",
"tax_resolution": "<string>",
"rounding": {
"adjustment_amount": 123,
"": "<string>"
},
"tax_lines": "<array>"
}{
"message": "<string>",
"errors": {}
}Simulate tax on a price
Calculates, without saving anything, the taxes and totals that would apply to an item at a given price and quantity.
curl --request POST \
--url https://api.exowpee.com/v1/catalog/taxes/simulate \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.exowpee.com/v1/catalog/taxes/simulate"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.exowpee.com/v1/catalog/taxes/simulate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.exowpee.com/v1/catalog/taxes/simulate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.exowpee.com/v1/catalog/taxes/simulate"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.exowpee.com/v1/catalog/taxes/simulate")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.exowpee.com/v1/catalog/taxes/simulate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"gross": 123,
"before_vat_amount": 123,
"vat_amount": 123,
"after_vat_amount": 123,
"net": 123,
"total": 123,
"product_nature": "<string>",
"tax_resolution": "<string>",
"rounding": {
"adjustment_amount": 123,
"": "<string>"
},
"tax_lines": "<array>"
}{
"message": "<string>",
"errors": {}
}taxes.simulate
Conditions
- stockable_id must be an item of the organization; a bundle must belong to the current company.
- stockable_unit_id, when sent, must be a unit of that item.
- price is in major units, at least 0, with at most the currency’s decimals.
- stockable_price_id is refused.
- A price that the configured taxes cannot split (below its inclusive fixed taxes, for example) is refused.
- Nothing is stored: the result is computed only.
- The answer is 200 with the simulated amounts, in major units.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Response
TaxSimulationResource
Price sent, as total including taxes that are included in it, in major units.
Amount on which VAT is computed (net plus the taxes VAT depends on), in major units; equals total when no VAT line applies.
VAT amount, in major units.
before_vat_amount plus VAT only, in major units; other taxes stay out of it.
Net price without taxes, in major units.
Amount to pay including all taxes added on top, in major units.
Nature of the priced item, as resolved for the item.
How the tax setup of the item was resolved. untaxed_unconfigured and untaxed_not_taxable mean no tax lines apply.
Rounding remainder assigned by the extraction; null when there was none.
Show child attributes
Show child attributes
One line per applied tax (VAT first): tax_id, tax_kind, tax_name, tax_code, amount_type, configured_rate, configured_fixed_amount, vat_treatment, inclusion_policy, base_amount, dependency_tax_amount, taxable_amount, tax_amount (amounts in major units) and dependencies.