{
  "openapi": "3.0.1",
  "info": {
    "title": "UK Import Duty & Landed Cost Calculator",
    "description": "Duty, VAT, excise and control flags for UK imports, straight from the HMRC Trade Tariff. Returns every underlying measure with its regulation ID, and tells you when the answer is ambiguous instead of guessing.",
    "version": "1.0",
    "x-build-id": "ySb7fLOgtgAQ1omnC"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/kestraz~uk-import-duty-landed-cost/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-kestraz-uk-import-duty-landed-cost",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/kestraz~uk-import-duty-landed-cost/runs": {
      "post": {
        "operationId": "runs-sync-kestraz-uk-import-duty-landed-cost",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/kestraz~uk-import-duty-landed-cost/run-sync": {
      "post": {
        "operationId": "run-sync-kestraz-uk-import-duty-landed-cost",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "required": [
          "originCountry"
        ],
        "properties": {
          "commodityCode": {
            "title": "Commodity code",
            "type": "string",
            "description": "The 10-digit UK commodity code for your goods, as it appears on the declaration. Spaces and dots are fine — '2204 21 17 90' works. Shorter codes are padded with zeros, but be aware that 6- and 8-digit codes are usually headings or subheadings rather than declarable codes. If you enter one, we'll tell you exactly which 10-digit codes sit beneath it so your next attempt works. Don't know the code? Leave this blank and use Product description instead."
          },
          "productQuery": {
            "title": "Product description (if you don't have a code)",
            "type": "string",
            "description": "Describe the goods in plain English, for example 'cotton t-shirts' or 'still wine in bottles'. You'll get back ranked candidate commodity codes to choose from. We never pick the code for you — tariff classification is the importer's legal responsibility, and a wrong code is the most expensive mistake in customs. Use this OR the commodity code above, not both."
          },
          "originCountry": {
            "title": "Country of origin",
            "type": "string",
            "description": "Two-letter country code for where the goods were MADE — not where they ship from. Origin is what drives the duty rate and whether a trade agreement preference is available. Examples: CN China, US United States, CL Chile, IN India, VN Vietnam, TR Türkiye."
          },
          "cifValue": {
            "title": "CIF value",
            "minimum": 0,
            "type": "number",
            "description": "Customs value of the consignment: the cost of the goods plus insurance and freight to the UK border. This is the figure duty is calculated on. Decimals are accepted."
          },
          "currency": {
            "title": "Currency",
            "enum": [
              "GBP"
            ],
            "type": "string",
            "description": "GBP only. We deliberately don't apply exchange rates: an unsourced FX rate would make every figure on your output untraceable. Convert your CIF value using the HMRC monthly exchange rate for your import month, then enter it here.",
            "default": "GBP"
          },
          "importDate": {
            "title": "Import date",
            "type": "string",
            "description": "The date the goods enter free circulation, as YYYY-MM-DD. Rates are resolved as at this date, so you can price a shipment landing next month or check what applied last quarter. Leave blank for today."
          },
          "quantityValue": {
            "title": "Quantity",
            "minimum": 0,
            "type": "number",
            "description": "How much you're importing, measured in the unit below. Only needed when duty is charged per unit rather than as a percentage of value — wine, spirits, tobacco and some agricultural goods. Leave both quantity fields blank if you're not sure: if we need a quantity we'll tell you exactly which unit to supply, rather than guess and give you a wrong total."
          },
          "quantityUnit": {
            "title": "Quantity unit",
            "enum": [
              "hl",
              "l",
              "1000l",
              "lpa",
              "kg",
              "100kg",
              "t",
              "g",
              "item",
              "100 items",
              "1000 items",
              "pair",
              "m",
              "m2",
              "m3",
              "carat",
              "mwh"
            ],
            "type": "string",
            "description": "The unit your quantity is measured in. It must match the unit the tariff uses for that commodity — we never convert between units, because a wrong conversion is a wrong duty. If it doesn't match, we'll tell you which unit is required."
          },
          "items": {
            "title": "Bulk rows",
            "type": "array",
            "description": "Price a whole catalogue in one run. Each row can set its own commodityCode, originCountry, cifValue, quantityValue and quantityUnit — anything you leave out falls back to the values above. Throughput is about 10 rows per second, so 10,000 rows takes roughly 17 minutes; runs are asynchronous and rows appear in the dataset as they complete. Volume pricing gets cheaper as the run gets longer and resets each run, so run a catalogue as one job rather than splitting it into batches."
          },
          "cacheTtlMinutes": {
            "title": "Reuse results for (minutes)",
            "minimum": 0,
            "maximum": 1440,
            "type": "integer",
            "description": "The UK tariff is updated once a day, so we reuse a result for the same commodity code, origin and import date for this long instead of asking HMRC again. Lower it if you need a guaranteed fresh read; set 0 to always go to HMRC.",
            "default": 60
          },
          "mode": {
            "title": "Mode",
            "enum": [
              "resolve",
              "canary"
            ],
            "type": "string",
            "description": "Leave on Resolve to calculate landed cost. Canary is a health check that verifies HMRC's data still looks the way we expect and fails the run loudly if it doesn't — schedule it hourly if you depend on this in production.",
            "default": "resolve"
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}