---
title: Retrieves taxes for a given order
slug: docs/demo/retrieves-taxes-for-a-given-order
description: Learn how to use cURL to make a GET request to an API endpoint and retrieve tax information. This document includes a code example with request headers, URL parameters, and specific account and payment references for accurate tax data retrieval. Perfect f
docTags: 
createdAt: 2022-03-21T20:12:45.000Z
---

{
  "id": "H7p6fjRETczxXtI-3qLEa",
  "data": {
    "url": "https://api.fictive.com/REST/api/accounts/{accountReference}/payments/{paymentReference}/tax",
    "name": "Retrieves taxes for a given order",
    "method": "GET",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "accountReference",
          "type": "string",
          "description": ""
        },
        {
          "kind": "required",
          "name": "paymentReference",
          "type": "string",
          "description": ""
        }
      ],
      "queryParameters": [],
      "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": "404",
        "description": "The price does not exist.",
        "jsonExample": ""
      },
      {
        "isExpanded": true,
        "statusCode": "500",
        "description": "Internal Server Error.",
        "jsonExample": ""
      }
    ],
    "contentType": "application/json",
    "examples": {
      "languages": [
        {
          "id": "SoOA80toykCUU15XjYHjL",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request GET \\\n     --url https://api.fictive.com/REST/api/accounts/{accountReference}/payments/{paymentReference}/tax \\\n     --header 'accept: application/json' \\\n     --header 'x-version: string'"
        },
        {
          "id": "a9AJW5nICTVbmkUaAm4ou",
          "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/accounts/{accountReference}/payments/{paymentReference}/tax\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "iUnrWgpULFkeCwM4tGHND",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.fictive.com/REST/api/accounts/{accountReference}/payments/{paymentReference}/tax\")\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": "5V-AYWC6PBG5iEyAwM-vn",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.fictive.com/REST/api/accounts/{accountReference}/payments/{paymentReference}/tax\"\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": "SoOA80toykCUU15XjYHjL"
    },
    "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-404",
          "language": "404",
          "code": "// The price does not exist.\n"
        },
        {
          "id": "response-2-500",
          "language": "500",
          "code": "// Internal Server Error.\n"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "type": "api-oas-v2",
  "children": [
    {
      "text": ""
    }
  ]
}