{
  "openapi": "3.1.0",
  "info": {
    "title": "TaxJar Sales Tax API",
    "version": "2022-01-24",
    "summary": "Real-time sales tax calculation, rate lookups, nexus, transactions, and validation.",
    "description": "Unofficial OpenAPI description of the TaxJar (Stripe) Sales Tax API v2, prepared from the public API reference (developers.taxjar.com/api/reference) and official SDKs. Use it for AI/agent discovery, client generation, and testing. Verify against the live API before production use.\n\nBase URL: https://api.taxjar.com/v2/ (sandbox: https://api.sandbox.taxjar.com/v2/). Authenticate with a Bearer API token.",
    "contact": {
      "name": "TaxJar Support",
      "url": "https://developers.taxjar.com/api/reference/",
      "email": "support@taxjar.com"
    },
    "termsOfService": "https://www.taxjar.com/terms-of-service",
    "license": {
      "name": "Proprietary \u2014 TaxJar/Stripe"
    }
  },
  "externalDocs": {
    "description": "TaxJar API Reference",
    "url": "https://developers.taxjar.com/api/reference/"
  },
  "servers": [
    {
      "url": "https://api.taxjar.com/v2",
      "description": "Production"
    },
    {
      "url": "https://api.sandbox.taxjar.com/v2",
      "description": "Sandbox"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "tags": [
    {
      "name": "Taxes",
      "description": "Calculate sales tax for orders."
    },
    {
      "name": "Rates",
      "description": "Look up and summarize sales tax rates."
    },
    {
      "name": "Categories",
      "description": "Product tax categories."
    },
    {
      "name": "Transactions",
      "description": "Record order and refund transactions for reporting and filing."
    },
    {
      "name": "Customers",
      "description": "Manage customers and exemptions."
    },
    {
      "name": "Nexus",
      "description": "Nexus regions for the account."
    },
    {
      "name": "Addresses",
      "description": "Address validation (TaxJar Plus)."
    },
    {
      "name": "Validation",
      "description": "VAT number validation."
    }
  ],
  "paths": {
    "/categories": {
      "get": {
        "tags": [
          "Categories"
        ],
        "summary": "List tax categories",
        "operationId": "listCategories",
        "description": "Lists all tax categories and their TaxJar product tax codes.",
        "parameters": [
          {
            "name": "x-api-version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "example": "2022-01-24"
            },
            "description": "Optional API version date to pin behavior."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CategoriesResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized \u2014 missing or invalid API token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests \u2014 rate limited.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/rates/{zip}": {
      "get": {
        "tags": [
          "Rates"
        ],
        "summary": "Show tax rates for a location",
        "operationId": "showRates",
        "description": "Shows the sales tax rates for a given location. Supply street/city/state for rooftop accuracy in the US; international lookups return VAT/GST rates.",
        "parameters": [
          {
            "name": "zip",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Postal code (US ZIP or ZIP+4; or postal code for supported countries)."
          },
          {
            "name": "country",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Two-letter ISO country code."
          },
          {
            "name": "state",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Two-letter ISO region/state code."
          },
          {
            "name": "city",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "City for the location."
          },
          {
            "name": "street",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Street address for rooftop accuracy."
          },
          {
            "name": "x-api-version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "example": "2022-01-24"
            },
            "description": "Optional API version date to pin behavior."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RatesResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized \u2014 missing or invalid API token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests \u2014 rate limited.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/taxes": {
      "post": {
        "tags": [
          "Taxes"
        ],
        "summary": "Calculate sales tax for an order",
        "operationId": "calculateTax",
        "description": "Calculates the sales tax to collect for an order, including line-item and shipping breakdowns.",
        "parameters": [
          {
            "name": "x-api-version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "example": "2022-01-24"
            },
            "description": "Optional API version date to pin behavior."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TaxParams"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaxResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized \u2014 missing or invalid API token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable entity \u2014 validation error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests \u2014 rate limited.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/transactions/orders": {
      "get": {
        "tags": [
          "Transactions"
        ],
        "summary": "List order transactions",
        "operationId": "listOrders",
        "parameters": [
          {
            "name": "transaction_date",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Filter by a specific transaction date (YYYY/MM/DD)."
          },
          {
            "name": "from_transaction_date",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Start of a transaction date range."
          },
          {
            "name": "to_transaction_date",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "End of a transaction date range."
          },
          {
            "name": "provider",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Filter by transaction provider."
          },
          {
            "name": "x-api-version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "example": "2022-01-24"
            },
            "description": "Optional API version date to pin behavior."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrdersListResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized \u2014 missing or invalid API token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests \u2014 rate limited.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Transactions"
        ],
        "summary": "Create an order transaction",
        "operationId": "createOrder",
        "parameters": [
          {
            "name": "x-api-version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "example": "2022-01-24"
            },
            "description": "Optional API version date to pin behavior."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrderParams"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized \u2014 missing or invalid API token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable entity \u2014 validation error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests \u2014 rate limited.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/transactions/orders/{transaction_id}": {
      "get": {
        "tags": [
          "Transactions"
        ],
        "summary": "Show an order transaction",
        "operationId": "showOrder",
        "parameters": [
          {
            "name": "transaction_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Unique identifier of the order transaction."
          },
          {
            "name": "x-api-version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "example": "2022-01-24"
            },
            "description": "Optional API version date to pin behavior."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized \u2014 missing or invalid API token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests \u2014 rate limited.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Transactions"
        ],
        "summary": "Update an order transaction",
        "operationId": "updateOrder",
        "parameters": [
          {
            "name": "transaction_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Unique identifier of the order transaction."
          },
          {
            "name": "x-api-version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "example": "2022-01-24"
            },
            "description": "Optional API version date to pin behavior."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrderUpdateParams"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized \u2014 missing or invalid API token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable entity \u2014 validation error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests \u2014 rate limited.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Transactions"
        ],
        "summary": "Delete an order transaction",
        "operationId": "deleteOrder",
        "parameters": [
          {
            "name": "transaction_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Unique identifier of the order transaction."
          },
          {
            "name": "x-api-version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "example": "2022-01-24"
            },
            "description": "Optional API version date to pin behavior."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized \u2014 missing or invalid API token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests \u2014 rate limited.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/transactions/refunds": {
      "get": {
        "tags": [
          "Transactions"
        ],
        "summary": "List refund transactions",
        "operationId": "listRefunds",
        "parameters": [
          {
            "name": "transaction_date",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Filter by a specific transaction date (YYYY/MM/DD)."
          },
          {
            "name": "from_transaction_date",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Start of a transaction date range."
          },
          {
            "name": "to_transaction_date",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "End of a transaction date range."
          },
          {
            "name": "provider",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Filter by transaction provider."
          },
          {
            "name": "x-api-version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "example": "2022-01-24"
            },
            "description": "Optional API version date to pin behavior."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RefundsListResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized \u2014 missing or invalid API token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests \u2014 rate limited.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Transactions"
        ],
        "summary": "Create a refund transaction",
        "operationId": "createRefund",
        "parameters": [
          {
            "name": "x-api-version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "example": "2022-01-24"
            },
            "description": "Optional API version date to pin behavior."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RefundParams"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RefundResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized \u2014 missing or invalid API token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable entity \u2014 validation error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests \u2014 rate limited.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/transactions/refunds/{transaction_id}": {
      "get": {
        "tags": [
          "Transactions"
        ],
        "summary": "Show a refund transaction",
        "operationId": "showRefund",
        "parameters": [
          {
            "name": "transaction_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Unique identifier of the refund transaction."
          },
          {
            "name": "x-api-version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "example": "2022-01-24"
            },
            "description": "Optional API version date to pin behavior."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RefundResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized \u2014 missing or invalid API token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests \u2014 rate limited.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Transactions"
        ],
        "summary": "Update a refund transaction",
        "operationId": "updateRefund",
        "parameters": [
          {
            "name": "transaction_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Unique identifier of the refund transaction."
          },
          {
            "name": "x-api-version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "example": "2022-01-24"
            },
            "description": "Optional API version date to pin behavior."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RefundUpdateParams"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RefundResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized \u2014 missing or invalid API token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable entity \u2014 validation error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests \u2014 rate limited.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Transactions"
        ],
        "summary": "Delete a refund transaction",
        "operationId": "deleteRefund",
        "parameters": [
          {
            "name": "transaction_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Unique identifier of the refund transaction."
          },
          {
            "name": "x-api-version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "example": "2022-01-24"
            },
            "description": "Optional API version date to pin behavior."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RefundResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized \u2014 missing or invalid API token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests \u2014 rate limited.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/customers": {
      "get": {
        "tags": [
          "Customers"
        ],
        "summary": "List customers",
        "operationId": "listCustomers",
        "parameters": [
          {
            "name": "x-api-version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "example": "2022-01-24"
            },
            "description": "Optional API version date to pin behavior."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomersListResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized \u2014 missing or invalid API token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests \u2014 rate limited.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Customers"
        ],
        "summary": "Create a customer",
        "operationId": "createCustomer",
        "parameters": [
          {
            "name": "x-api-version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "example": "2022-01-24"
            },
            "description": "Optional API version date to pin behavior."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerParams"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized \u2014 missing or invalid API token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable entity \u2014 validation error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests \u2014 rate limited.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/customers/{customer_id}": {
      "get": {
        "tags": [
          "Customers"
        ],
        "summary": "Show a customer",
        "operationId": "showCustomer",
        "parameters": [
          {
            "name": "customer_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Unique identifier of the customer."
          },
          {
            "name": "x-api-version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "example": "2022-01-24"
            },
            "description": "Optional API version date to pin behavior."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized \u2014 missing or invalid API token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests \u2014 rate limited.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Customers"
        ],
        "summary": "Update a customer",
        "operationId": "updateCustomer",
        "parameters": [
          {
            "name": "customer_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Unique identifier of the customer."
          },
          {
            "name": "x-api-version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "example": "2022-01-24"
            },
            "description": "Optional API version date to pin behavior."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerParams"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized \u2014 missing or invalid API token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable entity \u2014 validation error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests \u2014 rate limited.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Customers"
        ],
        "summary": "Delete a customer",
        "operationId": "deleteCustomer",
        "parameters": [
          {
            "name": "customer_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Unique identifier of the customer."
          },
          {
            "name": "x-api-version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "example": "2022-01-24"
            },
            "description": "Optional API version date to pin behavior."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized \u2014 missing or invalid API token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests \u2014 rate limited.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/nexus/regions": {
      "get": {
        "tags": [
          "Nexus"
        ],
        "summary": "List nexus regions",
        "operationId": "listNexusRegions",
        "description": "Lists existing nexus locations for a TaxJar account.",
        "parameters": [
          {
            "name": "x-api-version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "example": "2022-01-24"
            },
            "description": "Optional API version date to pin behavior."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NexusRegionsResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized \u2014 missing or invalid API token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests \u2014 rate limited.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/addresses/validate": {
      "post": {
        "tags": [
          "Addresses"
        ],
        "summary": "Validate an address",
        "operationId": "validateAddress",
        "description": "Validates and normalizes a US address. Requires a TaxJar Plus subscription.",
        "parameters": [
          {
            "name": "x-api-version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "example": "2022-01-24"
            },
            "description": "Optional API version date to pin behavior."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddressValidationParams"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AddressValidationResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized \u2014 missing or invalid API token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable entity \u2014 validation error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests \u2014 rate limited.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/validation": {
      "get": {
        "tags": [
          "Validation"
        ],
        "summary": "Validate a VAT number",
        "operationId": "validateVat",
        "description": "Validates an existing VAT identification number against the EU VIES service.",
        "parameters": [
          {
            "name": "vat",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "VAT identification number to validate."
          },
          {
            "name": "x-api-version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "example": "2022-01-24"
            },
            "description": "Optional API version date to pin behavior."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized \u2014 missing or invalid API token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests \u2014 rate limited.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/summary_rates": {
      "get": {
        "tags": [
          "Rates"
        ],
        "summary": "Summarize tax rates for all regions",
        "operationId": "summaryRates",
        "description": "Retrieves minimum and average sales tax rates by region.",
        "parameters": [
          {
            "name": "x-api-version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "example": "2022-01-24"
            },
            "description": "Optional API version date to pin behavior."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SummaryRatesResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized \u2014 missing or invalid API token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests \u2014 rate limited.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "TaxJar API token. Send as `Authorization: Bearer <token>`. (Legacy `Authorization: Token token=\"<token>\"` is also accepted.)"
      }
    },
    "schemas": {
      "Category": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Name of the tax category."
          },
          "product_tax_code": {
            "type": "string",
            "description": "TaxJar product tax code."
          },
          "description": {
            "type": "string",
            "description": "Description of the tax category."
          }
        }
      },
      "CategoriesResponse": {
        "type": "object",
        "properties": {
          "categories": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Category"
            }
          }
        }
      },
      "Rate": {
        "type": "object",
        "properties": {
          "zip": {
            "type": "string",
            "description": "Postal code for the location (US)."
          },
          "country": {
            "type": "string",
            "description": "Country code."
          },
          "country_rate": {
            "type": "string",
            "description": "Country sales tax rate (international)."
          },
          "state": {
            "type": "string",
            "description": "State/region code (US)."
          },
          "state_rate": {
            "type": "string",
            "description": "State sales tax rate."
          },
          "county": {
            "type": "string",
            "description": "County name (US)."
          },
          "county_rate": {
            "type": "string",
            "description": "County sales tax rate."
          },
          "city": {
            "type": "string",
            "description": "City name (US)."
          },
          "city_rate": {
            "type": "string",
            "description": "City sales tax rate."
          },
          "combined_district_rate": {
            "type": "string",
            "description": "Aggregate special-district sales tax rate."
          },
          "combined_rate": {
            "type": "string",
            "description": "Overall combined sales tax rate for the location."
          },
          "freight_taxable": {
            "type": "boolean",
            "description": "Whether freight/shipping is taxable at this location."
          },
          "name": {
            "type": "string",
            "description": "Region name (international)."
          },
          "standard_rate": {
            "type": "string",
            "description": "Standard VAT/GST rate (international)."
          },
          "reduced_rate": {
            "type": "string",
            "description": "Reduced VAT rate (international)."
          },
          "super_reduced_rate": {
            "type": "string",
            "description": "Super-reduced VAT rate (international)."
          },
          "parking_rate": {
            "type": "string",
            "description": "Parking VAT rate (international)."
          },
          "distance_sale_threshold": {
            "type": "string",
            "description": "Distance-selling threshold (international)."
          }
        },
        "description": "Rate fields vary by country; US responses use state/county/city/combined, international responses use country/standard/reduced rates."
      },
      "RatesResponse": {
        "type": "object",
        "properties": {
          "rate": {
            "$ref": "#/components/schemas/Rate"
          }
        }
      },
      "NexusAddress": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique identifier of the nexus address."
          },
          "country": {
            "type": "string"
          },
          "zip": {
            "type": "string"
          },
          "state": {
            "type": "string"
          },
          "city": {
            "type": "string"
          },
          "street": {
            "type": "string"
          }
        },
        "description": "A location where the seller has nexus."
      },
      "TaxLineItemParam": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique identifier of the line item within the order."
          },
          "quantity": {
            "type": "integer",
            "description": "Quantity of the item. Defaults to 1."
          },
          "product_tax_code": {
            "type": "string",
            "description": "TaxJar product tax code; omit for fully taxable."
          },
          "unit_price": {
            "type": "number",
            "description": "Unit price in the order currency."
          },
          "discount": {
            "type": "number",
            "description": "Total discount (unit price times quantity) for this line item."
          }
        },
        "required": [
          "unit_price"
        ]
      },
      "TaxParams": {
        "type": "object",
        "properties": {
          "from_country": {
            "type": "string",
            "description": "Two-letter ISO country code of the origin/ship-from location."
          },
          "from_zip": {
            "type": "string",
            "description": "Postal code of the ship-from location."
          },
          "from_state": {
            "type": "string",
            "description": "Two-letter ISO region code of the ship-from location."
          },
          "from_city": {
            "type": "string",
            "description": "City of the ship-from location."
          },
          "from_street": {
            "type": "string",
            "description": "Street address of the ship-from location."
          },
          "to_country": {
            "type": "string",
            "description": "Two-letter ISO country code of the destination/ship-to location."
          },
          "to_zip": {
            "type": "string",
            "description": "Postal code of the ship-to location. Required when to_country is US."
          },
          "to_state": {
            "type": "string",
            "description": "Two-letter ISO region code of the ship-to location. Required when to_country is US or CA."
          },
          "to_city": {
            "type": "string",
            "description": "City of the ship-to location."
          },
          "to_street": {
            "type": "string",
            "description": "Street address of the ship-to location."
          },
          "amount": {
            "type": "number",
            "description": "Total amount of the order, excluding shipping. Required unless line_items is provided."
          },
          "shipping": {
            "type": "number",
            "description": "Total shipping amount for the order."
          },
          "customer_id": {
            "type": "string",
            "description": "Unique identifier of a given customer (for exemptions)."
          },
          "exemption_type": {
            "type": "string",
            "description": "Type of exemption.",
            "enum": [
              "wholesale",
              "government",
              "marketplace",
              "other",
              "non_exempt"
            ]
          },
          "nexus_addresses": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/NexusAddress"
            },
            "description": "Seller nexus locations (recommended for accuracy)."
          },
          "line_items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TaxLineItemParam"
            },
            "description": "Line items used for the calculation. Required unless amount is provided."
          }
        },
        "required": [
          "to_country",
          "shipping"
        ],
        "anyOf": [
          {
            "required": [
              "amount"
            ]
          },
          {
            "required": [
              "line_items"
            ]
          }
        ],
        "allOf": [
          {
            "if": {
              "properties": {
                "to_country": {
                  "const": "US"
                }
              },
              "required": [
                "to_country"
              ]
            },
            "then": {
              "required": [
                "to_zip"
              ]
            }
          },
          {
            "if": {
              "properties": {
                "to_country": {
                  "enum": [
                    "US",
                    "CA"
                  ]
                }
              },
              "required": [
                "to_country"
              ]
            },
            "then": {
              "required": [
                "to_state"
              ]
            }
          }
        ]
      },
      "TaxBreakdownLineItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "taxable_amount": {
            "type": "number"
          },
          "tax_collectable": {
            "type": "number"
          },
          "combined_tax_rate": {
            "type": "number"
          },
          "state_taxable_amount": {
            "type": "number"
          },
          "state_sales_tax_rate": {
            "type": "number"
          },
          "state_amount": {
            "type": "number"
          },
          "county_taxable_amount": {
            "type": "number"
          },
          "county_tax_rate": {
            "type": "number"
          },
          "county_amount": {
            "type": "number"
          },
          "city_taxable_amount": {
            "type": "number"
          },
          "city_tax_rate": {
            "type": "number"
          },
          "city_amount": {
            "type": "number"
          },
          "special_district_taxable_amount": {
            "type": "number"
          },
          "special_tax_rate": {
            "type": "number"
          },
          "special_district_amount": {
            "type": "number"
          }
        }
      },
      "TaxBreakdown": {
        "type": "object",
        "properties": {
          "taxable_amount": {
            "type": "number"
          },
          "tax_collectable": {
            "type": "number"
          },
          "combined_tax_rate": {
            "type": "number"
          },
          "state_taxable_amount": {
            "type": "number"
          },
          "state_tax_rate": {
            "type": "number"
          },
          "state_tax_collectable": {
            "type": "number"
          },
          "county_taxable_amount": {
            "type": "number"
          },
          "county_tax_rate": {
            "type": "number"
          },
          "county_tax_collectable": {
            "type": "number"
          },
          "city_taxable_amount": {
            "type": "number"
          },
          "city_tax_rate": {
            "type": "number"
          },
          "city_tax_collectable": {
            "type": "number"
          },
          "special_district_taxable_amount": {
            "type": "number"
          },
          "special_tax_rate": {
            "type": "number"
          },
          "special_district_tax_collectable": {
            "type": "number"
          },
          "shipping": {
            "type": "object",
            "properties": {},
            "description": "Shipping breakdown (same rate fields as above)."
          },
          "line_items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TaxBreakdownLineItem"
            }
          }
        }
      },
      "Jurisdictions": {
        "type": "object",
        "properties": {
          "country": {
            "type": "string"
          },
          "state": {
            "type": "string"
          },
          "county": {
            "type": "string"
          },
          "city": {
            "type": "string"
          }
        }
      },
      "Tax": {
        "type": "object",
        "properties": {
          "order_total_amount": {
            "type": "number",
            "description": "Total amount of the order."
          },
          "shipping": {
            "type": "number",
            "description": "Total shipping amount."
          },
          "taxable_amount": {
            "type": "number",
            "description": "Amount of the order that is taxable."
          },
          "amount_to_collect": {
            "type": "number",
            "description": "Total sales tax to collect."
          },
          "rate": {
            "type": "number",
            "description": "Overall sales tax rate applied."
          },
          "has_nexus": {
            "type": "boolean",
            "description": "Whether the seller has nexus for the order, based on nexus addresses or configured locations."
          },
          "freight_taxable": {
            "type": "boolean",
            "description": "Whether shipping is taxable for the order."
          },
          "tax_source": {
            "type": "string",
            "description": "Origin of the tax calculation (e.g. destination, origin).",
            "nullable": true
          },
          "exemption_type": {
            "type": "string",
            "description": "Exemption type applied, if any.",
            "nullable": true
          },
          "jurisdictions": {
            "$ref": "#/components/schemas/Jurisdictions"
          },
          "breakdown": {
            "$ref": "#/components/schemas/TaxBreakdown"
          }
        }
      },
      "TaxResponse": {
        "type": "object",
        "properties": {
          "tax": {
            "$ref": "#/components/schemas/Tax"
          }
        }
      },
      "OrderLineItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "quantity": {
            "type": "integer"
          },
          "product_identifier": {
            "type": "string",
            "description": "Product SKU/identifier."
          },
          "description": {
            "type": "string"
          },
          "product_tax_code": {
            "type": "string"
          },
          "unit_price": {
            "type": "number"
          },
          "discount": {
            "type": "number"
          },
          "sales_tax": {
            "type": "number"
          }
        }
      },
      "OrderParams": {
        "type": "object",
        "properties": {
          "transaction_id": {
            "type": "string",
            "description": "Unique identifier of the given order transaction."
          },
          "transaction_date": {
            "type": "string",
            "description": "Date/time the transaction was originally recorded (ISO 8601)."
          },
          "provider": {
            "type": "string",
            "description": "Transaction provider. Defaults to 'api'."
          },
          "exemption_type": {
            "type": "string",
            "description": "Exemption type.",
            "enum": [
              "wholesale",
              "government",
              "marketplace",
              "other",
              "non_exempt"
            ]
          },
          "from_country": {
            "type": "string",
            "description": "Two-letter ISO country code of the origin/ship-from location."
          },
          "from_zip": {
            "type": "string",
            "description": "Postal code of the ship-from location."
          },
          "from_state": {
            "type": "string",
            "description": "Two-letter ISO region code of the ship-from location."
          },
          "from_city": {
            "type": "string",
            "description": "City of the ship-from location."
          },
          "from_street": {
            "type": "string",
            "description": "Street address of the ship-from location."
          },
          "to_country": {
            "type": "string",
            "description": "Two-letter ISO country code of the destination/ship-to location."
          },
          "to_zip": {
            "type": "string",
            "description": "Postal code of the ship-to location."
          },
          "to_state": {
            "type": "string",
            "description": "Two-letter ISO region code of the ship-to location."
          },
          "to_city": {
            "type": "string",
            "description": "City of the ship-to location."
          },
          "to_street": {
            "type": "string",
            "description": "Street address of the ship-to location."
          },
          "amount": {
            "type": "number",
            "description": "Total amount of the order with shipping, excluding sales tax."
          },
          "shipping": {
            "type": "number",
            "description": "Total shipping amount for the order."
          },
          "sales_tax": {
            "type": "number",
            "description": "Total sales tax collected for the order."
          },
          "customer_id": {
            "type": "string",
            "description": "Unique identifier of the customer for the transaction."
          },
          "line_items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OrderLineItem"
            }
          }
        },
        "required": [
          "transaction_id",
          "transaction_date",
          "to_country",
          "amount",
          "shipping",
          "sales_tax"
        ]
      },
      "Order": {
        "type": "object",
        "properties": {
          "transaction_id": {
            "type": "string"
          },
          "user_id": {
            "type": "integer"
          },
          "transaction_date": {
            "type": "string"
          },
          "transaction_reference_id": {
            "type": "string",
            "nullable": true
          },
          "provider": {
            "type": "string"
          },
          "exemption_type": {
            "type": "string",
            "nullable": true
          },
          "from_country": {
            "type": "string",
            "description": "Two-letter ISO country code of the origin/ship-from location."
          },
          "from_zip": {
            "type": "string",
            "description": "Postal code of the ship-from location."
          },
          "from_state": {
            "type": "string",
            "description": "Two-letter ISO region code of the ship-from location."
          },
          "from_city": {
            "type": "string",
            "description": "City of the ship-from location."
          },
          "from_street": {
            "type": "string",
            "description": "Street address of the ship-from location."
          },
          "to_country": {
            "type": "string",
            "description": "Two-letter ISO country code of the destination/ship-to location."
          },
          "to_zip": {
            "type": "string",
            "description": "Postal code of the ship-to location."
          },
          "to_state": {
            "type": "string",
            "description": "Two-letter ISO region code of the ship-to location."
          },
          "to_city": {
            "type": "string",
            "description": "City of the ship-to location."
          },
          "to_street": {
            "type": "string",
            "description": "Street address of the ship-to location."
          },
          "amount": {
            "type": "number"
          },
          "shipping": {
            "type": "number"
          },
          "sales_tax": {
            "type": "number"
          },
          "customer_id": {
            "type": "string",
            "nullable": true
          },
          "line_items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OrderLineItem"
            }
          }
        }
      },
      "OrderResponse": {
        "type": "object",
        "properties": {
          "order": {
            "$ref": "#/components/schemas/Order"
          }
        }
      },
      "OrdersListResponse": {
        "type": "object",
        "properties": {
          "orders": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Array of transaction_id strings."
          }
        }
      },
      "RefundParams": {
        "type": "object",
        "properties": {
          "transaction_id": {
            "type": "string",
            "description": "Unique identifier of the given refund transaction."
          },
          "transaction_reference_id": {
            "type": "string",
            "description": "transaction_id of the original order this refund is for."
          },
          "transaction_date": {
            "type": "string",
            "description": "Date/time the refund was recorded (ISO 8601)."
          },
          "provider": {
            "type": "string",
            "description": "Transaction provider. Defaults to 'api'."
          },
          "exemption_type": {
            "type": "string",
            "enum": [
              "wholesale",
              "government",
              "marketplace",
              "other",
              "non_exempt"
            ]
          },
          "from_country": {
            "type": "string",
            "description": "Two-letter ISO country code of the origin/ship-from location."
          },
          "from_zip": {
            "type": "string",
            "description": "Postal code of the ship-from location."
          },
          "from_state": {
            "type": "string",
            "description": "Two-letter ISO region code of the ship-from location."
          },
          "from_city": {
            "type": "string",
            "description": "City of the ship-from location."
          },
          "from_street": {
            "type": "string",
            "description": "Street address of the ship-from location."
          },
          "to_country": {
            "type": "string",
            "description": "Two-letter ISO country code of the destination/ship-to location."
          },
          "to_zip": {
            "type": "string",
            "description": "Postal code of the ship-to location."
          },
          "to_state": {
            "type": "string",
            "description": "Two-letter ISO region code of the ship-to location."
          },
          "to_city": {
            "type": "string",
            "description": "City of the ship-to location."
          },
          "to_street": {
            "type": "string",
            "description": "Street address of the ship-to location."
          },
          "amount": {
            "type": "number",
            "description": "Total amount of the refund with shipping, excluding sales tax (negative)."
          },
          "shipping": {
            "type": "number",
            "description": "Total shipping amount for the refund (negative)."
          },
          "sales_tax": {
            "type": "number",
            "description": "Total sales tax refunded (negative)."
          },
          "customer_id": {
            "type": "string"
          },
          "line_items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OrderLineItem"
            }
          }
        },
        "required": [
          "transaction_id",
          "transaction_reference_id",
          "transaction_date",
          "to_country",
          "amount",
          "shipping",
          "sales_tax"
        ]
      },
      "Refund": {
        "type": "object",
        "properties": {
          "transaction_id": {
            "type": "string"
          },
          "user_id": {
            "type": "integer"
          },
          "transaction_date": {
            "type": "string"
          },
          "transaction_reference_id": {
            "type": "string"
          },
          "provider": {
            "type": "string"
          },
          "exemption_type": {
            "type": "string",
            "nullable": true
          },
          "from_country": {
            "type": "string",
            "description": "Two-letter ISO country code of the origin/ship-from location."
          },
          "from_zip": {
            "type": "string",
            "description": "Postal code of the ship-from location."
          },
          "from_state": {
            "type": "string",
            "description": "Two-letter ISO region code of the ship-from location."
          },
          "from_city": {
            "type": "string",
            "description": "City of the ship-from location."
          },
          "from_street": {
            "type": "string",
            "description": "Street address of the ship-from location."
          },
          "to_country": {
            "type": "string",
            "description": "Two-letter ISO country code of the destination/ship-to location."
          },
          "to_zip": {
            "type": "string",
            "description": "Postal code of the ship-to location."
          },
          "to_state": {
            "type": "string",
            "description": "Two-letter ISO region code of the ship-to location."
          },
          "to_city": {
            "type": "string",
            "description": "City of the ship-to location."
          },
          "to_street": {
            "type": "string",
            "description": "Street address of the ship-to location."
          },
          "amount": {
            "type": "number"
          },
          "shipping": {
            "type": "number"
          },
          "sales_tax": {
            "type": "number"
          },
          "customer_id": {
            "type": "string",
            "nullable": true
          },
          "line_items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OrderLineItem"
            }
          }
        }
      },
      "RefundResponse": {
        "type": "object",
        "properties": {
          "refund": {
            "$ref": "#/components/schemas/Refund"
          }
        }
      },
      "RefundsListResponse": {
        "type": "object",
        "properties": {
          "refunds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "ExemptRegion": {
        "type": "object",
        "properties": {
          "country": {
            "type": "string"
          },
          "state": {
            "type": "string"
          }
        }
      },
      "CustomerParams": {
        "type": "object",
        "properties": {
          "customer_id": {
            "type": "string",
            "description": "Unique identifier of the given customer."
          },
          "exemption_type": {
            "type": "string",
            "description": "Type of customer exemption.",
            "enum": [
              "wholesale",
              "government",
              "other",
              "non_exempt"
            ]
          },
          "exempt_regions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ExemptRegion"
            }
          },
          "name": {
            "type": "string",
            "description": "Name of the customer."
          },
          "country": {
            "type": "string"
          },
          "state": {
            "type": "string"
          },
          "zip": {
            "type": "string"
          },
          "city": {
            "type": "string"
          },
          "street": {
            "type": "string"
          }
        },
        "required": [
          "customer_id",
          "exemption_type",
          "name"
        ]
      },
      "Customer": {
        "type": "object",
        "properties": {
          "customer_id": {
            "type": "string"
          },
          "exemption_type": {
            "type": "string"
          },
          "exempt_regions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ExemptRegion"
            }
          },
          "name": {
            "type": "string"
          },
          "country": {
            "type": "string"
          },
          "state": {
            "type": "string"
          },
          "zip": {
            "type": "string"
          },
          "city": {
            "type": "string"
          },
          "street": {
            "type": "string"
          }
        }
      },
      "CustomerResponse": {
        "type": "object",
        "properties": {
          "customer": {
            "$ref": "#/components/schemas/Customer"
          }
        }
      },
      "CustomersListResponse": {
        "type": "object",
        "properties": {
          "customers": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Array of customer_id strings."
          }
        }
      },
      "NexusRegion": {
        "type": "object",
        "properties": {
          "country_code": {
            "type": "string"
          },
          "country": {
            "type": "string"
          },
          "region_code": {
            "type": "string"
          },
          "region": {
            "type": "string"
          }
        }
      },
      "NexusRegionsResponse": {
        "type": "object",
        "properties": {
          "regions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/NexusRegion"
            }
          }
        }
      },
      "Address": {
        "type": "object",
        "properties": {
          "zip": {
            "type": "string"
          },
          "street": {
            "type": "string"
          },
          "state": {
            "type": "string"
          },
          "city": {
            "type": "string"
          },
          "country": {
            "type": "string"
          }
        }
      },
      "AddressValidationParams": {
        "type": "object",
        "properties": {
          "country": {
            "type": "string"
          },
          "state": {
            "type": "string"
          },
          "zip": {
            "type": "string"
          },
          "city": {
            "type": "string"
          },
          "street": {
            "type": "string"
          }
        }
      },
      "AddressValidationResponse": {
        "type": "object",
        "properties": {
          "addresses": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Address"
            }
          }
        }
      },
      "Validation": {
        "type": "object",
        "properties": {
          "valid": {
            "type": "boolean",
            "description": "Whether the VAT number is valid."
          },
          "exists": {
            "type": "boolean",
            "description": "Whether the VAT number exists."
          },
          "vies_available": {
            "type": "boolean",
            "description": "Whether the EU VIES service was available."
          },
          "vies_response": {
            "type": "object",
            "properties": {
              "country_code": {
                "type": "string"
              },
              "vat_number": {
                "type": "string"
              },
              "request_date": {
                "type": "string"
              },
              "valid": {
                "type": "boolean"
              },
              "name": {
                "type": "string"
              },
              "address": {
                "type": "string"
              }
            }
          }
        }
      },
      "ValidationResponse": {
        "type": "object",
        "properties": {
          "validation": {
            "$ref": "#/components/schemas/Validation"
          }
        }
      },
      "SummaryRateDetail": {
        "type": "object",
        "properties": {
          "label": {
            "type": "string"
          },
          "rate": {
            "type": "number"
          }
        }
      },
      "SummaryRate": {
        "type": "object",
        "properties": {
          "country_code": {
            "type": "string"
          },
          "country": {
            "type": "string"
          },
          "region_code": {
            "type": "string"
          },
          "region": {
            "type": "string"
          },
          "minimum_rate": {
            "$ref": "#/components/schemas/SummaryRateDetail"
          },
          "average_rate": {
            "$ref": "#/components/schemas/SummaryRateDetail"
          }
        }
      },
      "SummaryRatesResponse": {
        "type": "object",
        "properties": {
          "summary_rates": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SummaryRate"
            }
          }
        }
      },
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string"
          },
          "detail": {
            "type": "string"
          },
          "status": {
            "type": "integer"
          }
        },
        "description": "Standard TaxJar error envelope."
      },
      "OrderUpdateParams": {
        "type": "object",
        "properties": {
          "transaction_id": {
            "type": "string",
            "description": "Unique identifier of the given order transaction."
          },
          "transaction_date": {
            "type": "string",
            "description": "Date/time the transaction was originally recorded (ISO 8601)."
          },
          "provider": {
            "type": "string",
            "description": "Transaction provider. Defaults to 'api'."
          },
          "exemption_type": {
            "type": "string",
            "description": "Exemption type.",
            "enum": [
              "wholesale",
              "government",
              "marketplace",
              "other",
              "non_exempt"
            ]
          },
          "from_country": {
            "type": "string",
            "description": "Two-letter ISO country code of the origin/ship-from location."
          },
          "from_zip": {
            "type": "string",
            "description": "Postal code of the ship-from location."
          },
          "from_state": {
            "type": "string",
            "description": "Two-letter ISO region code of the ship-from location."
          },
          "from_city": {
            "type": "string",
            "description": "City of the ship-from location."
          },
          "from_street": {
            "type": "string",
            "description": "Street address of the ship-from location."
          },
          "to_country": {
            "type": "string",
            "description": "Two-letter ISO country code of the destination/ship-to location."
          },
          "to_zip": {
            "type": "string",
            "description": "Postal code of the ship-to location."
          },
          "to_state": {
            "type": "string",
            "description": "Two-letter ISO region code of the ship-to location."
          },
          "to_city": {
            "type": "string",
            "description": "City of the ship-to location."
          },
          "to_street": {
            "type": "string",
            "description": "Street address of the ship-to location."
          },
          "amount": {
            "type": "number",
            "description": "Total amount of the order with shipping, excluding sales tax."
          },
          "shipping": {
            "type": "number",
            "description": "Total shipping amount for the order."
          },
          "sales_tax": {
            "type": "number",
            "description": "Total sales tax collected for the order."
          },
          "customer_id": {
            "type": "string",
            "description": "Unique identifier of the customer for the transaction."
          },
          "line_items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OrderLineItem"
            }
          }
        },
        "description": "Request body for updating an existing order transaction. The required transaction_id is supplied in the URL path; a duplicate transaction_id in the body is optional. Either an address on file or from_ parameters are required, as described in the API reference."
      },
      "RefundUpdateParams": {
        "type": "object",
        "properties": {
          "transaction_id": {
            "type": "string",
            "description": "Unique identifier of the given refund transaction."
          },
          "transaction_reference_id": {
            "type": "string",
            "description": "transaction_id of the original order this refund is for."
          },
          "transaction_date": {
            "type": "string",
            "description": "Date/time the refund was recorded (ISO 8601)."
          },
          "provider": {
            "type": "string",
            "description": "Transaction provider. Defaults to 'api'."
          },
          "exemption_type": {
            "type": "string",
            "enum": [
              "wholesale",
              "government",
              "marketplace",
              "other",
              "non_exempt"
            ]
          },
          "from_country": {
            "type": "string",
            "description": "Two-letter ISO country code of the origin/ship-from location."
          },
          "from_zip": {
            "type": "string",
            "description": "Postal code of the ship-from location."
          },
          "from_state": {
            "type": "string",
            "description": "Two-letter ISO region code of the ship-from location."
          },
          "from_city": {
            "type": "string",
            "description": "City of the ship-from location."
          },
          "from_street": {
            "type": "string",
            "description": "Street address of the ship-from location."
          },
          "to_country": {
            "type": "string",
            "description": "Two-letter ISO country code of the destination/ship-to location."
          },
          "to_zip": {
            "type": "string",
            "description": "Postal code of the ship-to location."
          },
          "to_state": {
            "type": "string",
            "description": "Two-letter ISO region code of the ship-to location."
          },
          "to_city": {
            "type": "string",
            "description": "City of the ship-to location."
          },
          "to_street": {
            "type": "string",
            "description": "Street address of the ship-to location."
          },
          "amount": {
            "type": "number",
            "description": "Total amount of the refund with shipping, excluding sales tax (negative)."
          },
          "shipping": {
            "type": "number",
            "description": "Total shipping amount for the refund (negative)."
          },
          "sales_tax": {
            "type": "number",
            "description": "Total sales tax refunded (negative)."
          },
          "customer_id": {
            "type": "string"
          },
          "line_items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OrderLineItem"
            }
          }
        },
        "description": "Request body for updating an existing refund transaction. The required transaction_id is supplied in the URL path; a duplicate transaction_id in the body is optional. Either an address on file or from_ parameters are required, as described in the API reference.",
        "required": [
          "transaction_reference_id"
        ]
      }
    }
  }
}
