Skip to main content
POST
/
v0
/
tax
/
calculate
Calculate product price including tax
curl --request POST \
  --url https://api.fungies.io/v0/tax/calculate \
  --header 'Content-Type: application/json' \
  --header 'x-fngs-public-key: <api-key>' \
  --data '
{
  "offerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "quantity": 1,
  "state": "<string>",
  "postalCode": "<string>"
}
'
import requests

url = "https://api.fungies.io/v0/tax/calculate"

payload = {
    "offerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "quantity": 1,
    "state": "<string>",
    "postalCode": "<string>"
}
headers = {
    "x-fngs-public-key": "<api-key>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
  method: 'POST',
  headers: {'x-fngs-public-key': '<api-key>', 'Content-Type': 'application/json'},
  body: JSON.stringify({
    offerId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
    quantity: 1,
    state: '<string>',
    postalCode: '<string>'
  })
};

fetch('https://api.fungies.io/v0/tax/calculate', 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.fungies.io/v0/tax/calculate",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => json_encode([
    'offerId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
    'quantity' => 1,
    'state' => '<string>',
    'postalCode' => '<string>'
  ]),
  CURLOPT_HTTPHEADER => [
    "Content-Type: application/json",
    "x-fngs-public-key: <api-key>"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.fungies.io/v0/tax/calculate"

	payload := strings.NewReader("{\n  \"offerId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n  \"quantity\": 1,\n  \"state\": \"<string>\",\n  \"postalCode\": \"<string>\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("x-fngs-public-key", "<api-key>")
	req.Header.Add("Content-Type", "application/json")

	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.fungies.io/v0/tax/calculate")
  .header("x-fngs-public-key", "<api-key>")
  .header("Content-Type", "application/json")
  .body("{\n  \"offerId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n  \"quantity\": 1,\n  \"state\": \"<string>\",\n  \"postalCode\": \"<string>\"\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://api.fungies.io/v0/tax/calculate")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-fngs-public-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"offerId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n  \"quantity\": 1,\n  \"state\": \"<string>\",\n  \"postalCode\": \"<string>\"\n}"

response = http.request(request)
puts response.read_body
{
  "status": "<string>",
  "data": {
    "offerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "quantity": 0,
    "amountSubtotal": 0,
    "amountTax": 0,
    "amountTotal": 0,
    "taxBreakdown": [
      {
        "amount": 0,
        "inclusive": true,
        "taxType": null,
        "country": null,
        "state": null,
        "percentage": null
      }
    ],
    "object": "tax_calculation"
  }
}
{
  "status": "error",
  "error": {
    "message": "Sample error message"
  }
}

Authorizations

x-fngs-public-key
string
header
required

Body

application/json

POST /v0/tax/calculate Request body

offerId
string<uuid>
required
country
enum<string>
required
Available options:
AF,
AX,
AL,
DZ,
AD,
AO,
AI,
AQ,
AG,
AR,
AM,
AW,
AU,
AT,
AZ,
BS,
BH,
BD,
BB,
BY,
BE,
BZ,
BJ,
BM,
BT,
BO,
BA,
BW,
BV,
BR,
IO,
VG,
BN,
BG,
BF,
BI,
KH,
CM,
CA,
CV,
BQ,
KY,
CF,
TD,
CL,
CN,
CO,
KM,
CG,
CD,
CK,
CR,
CI,
HR,
CW,
CY,
CZ,
DK,
DJ,
DM,
DO,
EC,
EG,
SV,
GQ,
ER,
EE,
SZ,
ET,
FK,
FO,
FJ,
FI,
FR,
GF,
PF,
TF,
GA,
GM,
GE,
DE,
GH,
GI,
GR,
GL,
GD,
GP,
GU,
GT,
GG,
GN,
GW,
GY,
HT,
HN,
HK,
HU,
IS,
IN,
ID,
IQ,
IE,
IM,
IL,
IT,
JM,
JP,
JE,
JO,
KZ,
KE,
KI,
XK,
KW,
KG,
LA,
LV,
LB,
LS,
LR,
LY,
LI,
LT,
LU,
MO,
MG,
MW,
MY,
MV,
ML,
MT,
MQ,
MR,
MU,
YT,
MX,
MD,
MC,
MN,
ME,
MS,
MA,
MZ,
MM,
NA,
NR,
NP,
NL,
NC,
NZ,
NI,
NE,
NG,
NU,
MK,
NO,
OM,
PK,
PS,
PA,
PG,
PY,
PE,
PH,
PN,
PL,
PT,
PR,
QA,
RE,
RO,
RU,
RW,
WS,
SM,
ST,
SA,
SN,
RS,
SC,
SL,
SG,
SX,
SK,
SI,
SB,
SO,
ZA,
GS,
KR,
SS,
ES,
LK,
BL,
SH,
KN,
LC,
MF,
PM,
VC,
SD,
SR,
SJ,
SE,
CH,
TW,
TJ,
TZ,
TH,
TL,
TG,
TK,
TO,
TT,
TN,
TR,
TM,
TC,
TV,
UG,
UA,
AE,
GB,
US,
UY,
UZ,
VU,
VA,
VE,
VN,
WF,
EH,
YE,
ZM,
ZW
quantity
integer<int64>
default:1
Required range: x <= 1000
state
string
Maximum string length: 10
postalCode
string
Maximum string length: 20

Response

POST /v0/tax/calculate Positive response

status
string
required
Allowed value: "success"
data
object
required