---
title: Retrieves taxes for a given service, using the configured tax calculation method for the affiliate
slug: docs/demo/retrieves-taxes-for-a-given-service-using-the-configured-tax-calculation-method-for-the-affiliate
description: Learn how to make a GET request to a specific URL using curl command in this comprehensive document. Includes step-by-step instructions and code example, complete with headers for accepting and sending JSON data. Master the art of efficient API communicat
createdAt: 2022-03-21T20:12:45.000Z
---

{
  "id": "Y98_3_kXSmSLQe203SEAg",
  "data": {
    "url": "https://api.fictive.com/REST/api/subscriptions/prices/{servicePriceReference}/tax/accounts/{accountReference}",
    "name": "Retrieves taxes for a given service, using the configured tax calculation method for the affiliate",
    "method": "GET",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "servicePriceReference",
          "type": "string",
          "description": ""
        },
        {
          "kind": "required",
          "name": "accountReference",
          "type": "string",
          "description": ""
        }
      ],
      "queryParameters": [
        {
          "kind": "optional",
          "name": "voucherCode",
          "type": "string",
          "description": "Offer reference code, if any applies to the purchase"
        },
        {
          "kind": "optional",
          "name": "country",
          "type": "string",
          "description": "Gets or sets the country"
        },
        {
          "kind": "optional",
          "name": "state",
          "type": "string",
          "description": "Gets or sets the state"
        },
        {
          "kind": "optional",
          "name": "county",
          "type": "string",
          "description": "Gets or sets the county"
        },
        {
          "kind": "optional",
          "name": "city",
          "type": "string",
          "description": "Gets or sets the city"
        },
        {
          "kind": "optional",
          "name": "street",
          "type": "string",
          "description": "Gets or sets the street"
        },
        {
          "kind": "optional",
          "name": "zipCode",
          "type": "string",
          "description": "Gets or sets the Zip Code"
        }
      ],
      "headerParameters": [
        {
          "kind": "optional",
          "name": "X-TokenId",
          "type": "string",
          "description": "The eSuite Token Id"
        },
        {
          "kind": "optional",
          "name": "X-SessionId",
          "type": "string",
          "description": "The eSuite Session Id"
        },
        {
          "kind": "required",
          "name": "X-Version",
          "type": "string",
          "description": "The eSuite Version"
        },
        {
          "kind": "optional",
          "name": "Origin",
          "type": "string",
          "description": "The eSuite Origin"
        }
      ],
      "bodyDataParameters": [],
      "formDataParameters": []
    },
    "responses": [
      {
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "schema": [
              {
                "kind": "optional",
                "name": "grossAmount",
                "type": "number<double>",
                "example": "",
                "description": "Groos amount"
              },
              {
                "kind": "optional",
                "name": "netAmount",
                "type": "number<double>",
                "example": "",
                "description": "Net amount"
              },
              {
                "kind": "optional",
                "name": "taxAmount",
                "type": "number<double>",
                "example": "",
                "description": "Tax amount"
              },
              {
                "kind": "optional",
                "name": "taxBreakDown",
                "type": "array",
                "schema": [
                  {
                    "kind": "optional",
                    "name": "category",
                    "type": "string",
                    "example": "",
                    "description": "Display name"
                  },
                  {
                    "kind": "optional",
                    "name": "name",
                    "type": "string",
                    "example": "",
                    "description": "Name"
                  },
                  {
                    "kind": "optional",
                    "name": "rate",
                    "type": "number<double>",
                    "example": "",
                    "description": "Rate"
                  },
                  {
                    "kind": "optional",
                    "name": "amount",
                    "type": "number<double>",
                    "example": "",
                    "description": "Amount"
                  },
                  {
                    "kind": "optional",
                    "name": "parameters",
                    "type": "object",
                    "schema": [],
                    "example": {},
                    "description": "Other tax parameters"
                  }
                ],
                "modelRef": "#/definitions/FictiveGlobal.Api.Rest.Dtos.v1.ExternalTax.ExternalTaxBreakDownDto",
                "customType": "FictiveGlobal.Api.Rest.Dtos.v1.ExternalTax.ExternalTaxBreakDownDto[]",
                "description": "Tax break"
              }
            ],
            "modelRef": "#/definitions/FictiveGlobal.Api.Rest.Dtos.v1.ExternalTaxDto",
            "customType": "FictiveGlobal.Api.Rest.Dtos.v1.ExternalTaxDto",
            "isExpanded": true,
            "description": "Tax breakdown"
          }
        ],
        "isExpanded": true,
        "statusCode": "200",
        "description": "OK",
        "jsonExample": "{\n  \"grossAmount\": 4.79,\n  \"netAmount\": 4.5,\n  \"taxAmount\": 0.29,\n  \"taxBreakDown\": [\n    {\n      \"category\": \"SALES AND USE TAXES\",\n      \"name\": \"Rental Tax\",\n      \"rate\": 0.023,\n      \"amount\": 0.115,\n      \"parameters\": {\n        \"param1\": \"value1\",\n        \"param2\": \"value2\"\n      }\n    },\n    {\n      \"category\": \"SALES AND USE TAXES\",\n      \"name\": \"Rental Tax\",\n      \"rate\": 0.007,\n      \"amount\": 0.035,\n      \"parameters\": {\n        \"param1\": \"value1\",\n        \"param2\": \"value2\"\n      }\n    },\n    {\n      \"category\": \"SALES AND USE TAXES\",\n      \"name\": \"Rental Tax\",\n      \"rate\": 0.056,\n      \"amount\": 0.28,\n      \"parameters\": {\n        \"param1\": \"value1\",\n        \"param2\": \"value2\"\n      }\n    }\n  ]\n}"
      },
      {
        "isExpanded": true,
        "statusCode": "400",
        "description": "Tax could not be calculated.",
        "jsonExample": ""
      },
      {
        "isExpanded": true,
        "statusCode": "404",
        "description": "The price does not exist.",
        "jsonExample": ""
      },
      {
        "isExpanded": true,
        "statusCode": "412",
        "description": "External Tax Provider was not configured.",
        "jsonExample": ""
      },
      {
        "isExpanded": true,
        "statusCode": "500",
        "description": "Internal Server Error.",
        "jsonExample": ""
      }
    ],
    "contentType": "application/json",
    "examples": {
      "languages": [
        {
          "id": "example-0-curl",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request GET \\\n     --url https://api.fictive.com/REST/api/subscriptions/prices/{servicePriceReference}/tax/accounts/{accountReference} \\\n     --header 'accept: application/json' \\\n     --header 'x-version: string'"
        },
        {
          "id": "example-1-javascript",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\nmyHeaders.append(\"x-version\", \"string\");\n\nvar requestOptions = {\n   method: 'GET',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"https://api.fictive.com/REST/api/subscriptions/prices/{servicePriceReference}/tax/accounts/{accountReference}\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "example-2-ruby",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.fictive.com/REST/api/subscriptions/prices/{servicePriceReference}/tax/accounts/{accountReference}\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Get.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\nrequest[\"x-version\"] = \"string\"\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "example-3-python",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.fictive.com/REST/api/subscriptions/prices/{servicePriceReference}/tax/accounts/{accountReference}\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json',\n   'x-version': 'string'\n}\n\nresponse = requests.request(\"GET\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "example-0-curl"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "{\n  \"grossAmount\": 4.79,\n  \"netAmount\": 4.5,\n  \"taxAmount\": 0.29,\n  \"taxBreakDown\": [\n    {\n      \"category\": \"SALES AND USE TAXES\",\n      \"name\": \"Rental Tax\",\n      \"rate\": 0.023,\n      \"amount\": 0.115,\n      \"parameters\": {\n        \"param1\": \"value1\",\n        \"param2\": \"value2\"\n      }\n    },\n    {\n      \"category\": \"SALES AND USE TAXES\",\n      \"name\": \"Rental Tax\",\n      \"rate\": 0.007,\n      \"amount\": 0.035,\n      \"parameters\": {\n        \"param1\": \"value1\",\n        \"param2\": \"value2\"\n      }\n    },\n    {\n      \"category\": \"SALES AND USE TAXES\",\n      \"name\": \"Rental Tax\",\n      \"rate\": 0.056,\n      \"amount\": 0.28,\n      \"parameters\": {\n        \"param1\": \"value1\",\n        \"param2\": \"value2\"\n      }\n    }\n  ]\n}"
        },
        {
          "id": "response-1-400",
          "language": "400",
          "code": "// Tax could not be calculated.\n"
        },
        {
          "id": "response-2-404",
          "language": "404",
          "code": "// The price does not exist.\n"
        },
        {
          "id": "response-3-412",
          "language": "412",
          "code": "// External Tax Provider was not configured.\n"
        },
        {
          "id": "response-4-500",
          "language": "500",
          "code": "// Internal Server Error.\n"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "type": "api-oas-v2",
  "children": [
    {
      "text": ""
    }
  ]
}