> This page is for version v6.0 (default).
> For other versions, use one of these documentation indexes:
> - v6.0 (default): https://docs.zip.tax/v-6-0/llms.txt
> - v5.0: https://docs.zip.tax/v-5-0/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.zip.tax/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.zip.tax/_mcp/server.

# Calculate Cart Tax

POST https://api.zip-tax.com/merchant/cart/calculate
Content-Type: application/json

Available on Pro and Enterprise PlansCalculates sales tax per line item for one or more carts. The request body is the same for every merchant, and Ziptax routes on the merchant's compliance model.For a **TaxCloud-connected merchant**, the cart is forwarded to TaxCloud (POST /connections/\{connectionId}/carts) using the merchant's stored credentials, and TaxCloud's response is returned verbatim. Additional cart fields (items, transactionDate, destination, ...) are relayed unchanged. Requires an Enterprise plan and credentials on file; a connected merchant without valid credentials returns 404.For a **self-managed merchant** (status external\_compliance), Ziptax calculates the tax in-process with its own rate engine and no TaxCloud call. Three differences matter on that path. (1) Calculation only: nothing is persisted, connectionId is omitted from the response, and the returned cartId is a correlation token that cannot be passed to /merchant/order/create-from-cart. (2) tic uses the Ziptax taxability code vocabulary, not TaxCloud's: 10001 is shipping and 11000 is handling, while TaxCloud's shipping codes (11010-11015) and the Colorado retail delivery fee code (11098) carry no special meaning and are taxed as ordinary product codes. (3) discounts, exemption, and deliveredBySeller are rejected with 400 rather than ignored, non-USD currency and countryCode CA are rejected, and a cart is capped at 250 line items.Every other merchant transaction endpoint returns 403 for a self-managed merchant. See the Self-Managed Cart Calculation guide for the full contract.

Reference: https://docs.zip.tax/api-reference/merchant-cart-calculation/merchant-cart-calculate

## Authentication

- `X-API-KEY` header (required) — API Key authentication via header

## Request

### Body (application/json)

This endpoint expects an object.

- `items` (list of TaxCloudCart, required) — The carts to calculate tax for. Most integrations send a single cart; up to 100 carts may be calculated in one call.
- `merchantId` (string, required) — UUID of the merchant whose TaxCloud connection is used. Must be owned by the calling account. Consumed by the Ziptax layer for routing and not forwarded to TaxCloud.
- `transactionDate` (datetime, optional) — RFC3339 datetime the carts are calculated for. Defaults to the current time when omitted.

## Response

### 200

Calculated carts. For a TaxCloud-connected merchant this is TaxCloud's response relayed verbatim; for a self-managed merchant it is the Ziptax calculation, which has no connectionId, exemption, or deliveredBySeller.

- `MerchantCartCalculateResponse`

## Errors

### 400 Merchant Cart Calculate Body Bad Request Error

Bad Request

- `detail` (string, optional) — A human-readable explanation specific to this occurrence of the problem.
- `errors` (list of ErrorDetail, optional) — List of individual error details
- `instance` (string, optional) — A URI reference that identifies the specific occurrence of the problem.
- `status` (long, optional) — HTTP status code
- `title` (string, optional) — A short, human-readable summary of the problem type. This value should not change between occurrences of the error.
- `type` (string, optional, default: about:blank) — A URI reference to human-readable documentation for the error.

### 401 Merchant Cart Calculate Body Unauthorized Error

Unauthorized

- `detail` (string, optional) — A human-readable explanation specific to this occurrence of the problem.
- `errors` (list of ErrorDetail, optional) — List of individual error details
- `instance` (string, optional) — A URI reference that identifies the specific occurrence of the problem.
- `status` (long, optional) — HTTP status code
- `title` (string, optional) — A short, human-readable summary of the problem type. This value should not change between occurrences of the error.
- `type` (string, optional, default: about:blank) — A URI reference to human-readable documentation for the error.

### 403 Merchant Cart Calculate Body Forbidden Error

Forbidden

- `detail` (string, optional) — A human-readable explanation specific to this occurrence of the problem.
- `errors` (list of ErrorDetail, optional) — List of individual error details
- `instance` (string, optional) — A URI reference that identifies the specific occurrence of the problem.
- `status` (long, optional) — HTTP status code
- `title` (string, optional) — A short, human-readable summary of the problem type. This value should not change between occurrences of the error.
- `type` (string, optional, default: about:blank) — A URI reference to human-readable documentation for the error.

### 404 Merchant Cart Calculate Body Not Found Error

Not Found

- `detail` (string, optional) — A human-readable explanation specific to this occurrence of the problem.
- `errors` (list of ErrorDetail, optional) — List of individual error details
- `instance` (string, optional) — A URI reference that identifies the specific occurrence of the problem.
- `status` (long, optional) — HTTP status code
- `title` (string, optional) — A short, human-readable summary of the problem type. This value should not change between occurrences of the error.
- `type` (string, optional, default: about:blank) — A URI reference to human-readable documentation for the error.

### 413 Merchant Cart Calculate Body Content Too Large Error

Request Entity Too Large

- `detail` (string, optional) — A human-readable explanation specific to this occurrence of the problem.
- `errors` (list of ErrorDetail, optional) — List of individual error details
- `instance` (string, optional) — A URI reference that identifies the specific occurrence of the problem.
- `status` (long, optional) — HTTP status code
- `title` (string, optional) — A short, human-readable summary of the problem type. This value should not change between occurrences of the error.
- `type` (string, optional, default: about:blank) — A URI reference to human-readable documentation for the error.

### 422 Merchant Cart Calculate Body Unprocessable Entity Error

Unprocessable Entity

- `detail` (string, optional) — A human-readable explanation specific to this occurrence of the problem.
- `errors` (list of ErrorDetail, optional) — List of individual error details
- `instance` (string, optional) — A URI reference that identifies the specific occurrence of the problem.
- `status` (long, optional) — HTTP status code
- `title` (string, optional) — A short, human-readable summary of the problem type. This value should not change between occurrences of the error.
- `type` (string, optional, default: about:blank) — A URI reference to human-readable documentation for the error.

### 429 Merchant Cart Calculate Body Too Many Requests Error

Too Many Requests

- `detail` (string, optional) — A human-readable explanation specific to this occurrence of the problem.
- `errors` (list of ErrorDetail, optional) — List of individual error details
- `instance` (string, optional) — A URI reference that identifies the specific occurrence of the problem.
- `status` (long, optional) — HTTP status code
- `title` (string, optional) — A short, human-readable summary of the problem type. This value should not change between occurrences of the error.
- `type` (string, optional, default: about:blank) — A URI reference to human-readable documentation for the error.

### 500 Merchant Cart Calculate Body Internal Server Error

Internal Server Error

- `detail` (string, optional) — A human-readable explanation specific to this occurrence of the problem.
- `errors` (list of ErrorDetail, optional) — List of individual error details
- `instance` (string, optional) — A URI reference that identifies the specific occurrence of the problem.
- `status` (long, optional) — HTTP status code
- `title` (string, optional) — A short, human-readable summary of the problem type. This value should not change between occurrences of the error.
- `type` (string, optional, default: about:blank) — A URI reference to human-readable documentation for the error.

### 502 Merchant Cart Calculate Body Bad Gateway Error

Bad Gateway

- `detail` (string, optional) — A human-readable explanation specific to this occurrence of the problem.
- `errors` (list of ErrorDetail, optional) — List of individual error details
- `instance` (string, optional) — A URI reference that identifies the specific occurrence of the problem.
- `status` (long, optional) — HTTP status code
- `title` (string, optional) — A short, human-readable summary of the problem type. This value should not change between occurrences of the error.
- `type` (string, optional, default: about:blank) — A URI reference to human-readable documentation for the error.

### 504 Merchant Cart Calculate Body Gateway Timeout Error

Gateway Timeout

- `detail` (string, optional) — A human-readable explanation specific to this occurrence of the problem.
- `errors` (list of ErrorDetail, optional) — List of individual error details
- `instance` (string, optional) — A URI reference that identifies the specific occurrence of the problem.
- `status` (long, optional) — HTTP status code
- `title` (string, optional) — A short, human-readable summary of the problem type. This value should not change between occurrences of the error.
- `type` (string, optional, default: about:blank) — A URI reference to human-readable documentation for the error.

## Types

### TaxCloudCart

- `currency` (TaxCloudCurrency, required) — The currency the line-item prices are denominated in.
- `customerId` (string, required) — Your identifier for the customer in your own system. Used to match exemption certificates and order history.
- `destination` (TaxCloudAddress, required) — The ship-to (destination) address of the sale. Tax is generally calculated for this address in destination-sourced states.
- `lineItems` (list of TaxCloudCartItem, required) — The line items in the cart. Tax is calculated per item and returned per item in the response.
- `origin` (TaxCloudAddress, required) — The ship-from (origin) address of the sale. Used together with destination to determine sourcing and the applicable jurisdictions.
- `cartId` (string, optional) — Your identifier for this cart. If omitted, TaxCloud generates one and returns it in the response; either way, pass it to /merchant/order/create-from-cart to capture the cart as an order.
- `deliveredBySeller` (boolean, optional) — Whether the seller delivers the order directly (own vehicles) rather than via common carrier. Affects taxability of delivery charges in some states.
- `discounts` (TaxCloudDiscounts, optional) — Line-item and order-level discounts to apply. If omitted, prices are used as is.
- `exemption` (TaxCloudExemption, optional) — Exemption information for the customer. When the customer is exempt, calculated tax is zero for exempt jurisdictions.

### CartCalculateResponseBody

- `connectionId` (string, required) — The TaxCloud connection the calculation ran under.
- `items` (list of TaxCloudCartResponse, optional) — One calculated cart per submitted cart, in the same order, with per-line-item tax rates and amounts.
- `transactionDate` (datetime, optional) — RFC3339 datetime the carts were calculated for.

### SelfManagedCartCalculateResponseBody

- `items` (list of SelfManagedCartResponse, optional) — One calculated cart per submitted cart, in the same order, with per-line-item tax rates and amounts.

### ErrorDetail

- `location` (string, optional) — Where the error occurred, e.g. 'body.items[3].tags' or 'path.thing-id'
- `message` (string, optional) — Error message text
- `value` (any, optional) — The value at the given location

### TaxCloudCurrency

- `currencyCode` (enum, optional, default: USD) — ISO 4217 currency code the line-item prices are denominated in. USD or CAD. Defaults to USD when omitted.
  - Allowed values: `USD`, `CAD`

### TaxCloudAddress

- `city` (string, required) — City or post-town of the address.
- `line1` (string, required) — First line of the address: street number and name, PO Box, or building. Values longer than 50 characters are automatically truncated by TaxCloud.
- `state` (string, required) — State, province, or other large territorial division, as a two-letter abbreviation (e.g. MN, CA, ON).
- `zip` (string, required) — Postal or ZIP code. Five-digit (55401) and ZIP+4 (55401-2427) formats are accepted for US addresses.
- `countryCode` (enum, optional, default: US) — ISO 3166-1 alpha-2 country code of the address. US (United States) or CA (Canada). Defaults to US when omitted.
  - Allowed values: `US`, `CA`
- `line2` (string, optional) — Second line of the address, if any (e.g. apartment, suite, or unit number). Values longer than 50 characters are automatically truncated by TaxCloud.

### TaxCloudCartItem

- `index` (long, required) — Zero-based position of the item within the cart. Each line item must have a unique index.
- `itemId` (string, required) — Your unique identifier for the line item (e.g. SKU or line reference). Used to match line items in later order, refund, and discount operations.
- `price` (double, required) — Unit price of the item, in the cart's currency. When discounts are provided, this must be the pre-discount (original) price; tax is calculated on the discounted amount. Self-managed merchants only: both the unit price and the extended price (price * quantity) must be at most 1e12.
- `quantity` (double, required) — Quantity of the item. Fractional quantities are allowed. For quantities above the maximum, send a single line with quantity 1 and the extended (total) amount as the price.
- `productId` (string, optional) — Unique ID of the product in the merchant's TaxCloud product catalog (e.g. SKU). Must match an existing catalog product when provided.
- `tic` (long, optional) — Taxability Information Code (TIC) classifying the product for product-specific tax rules (e.g. 11010 for shipping). Defaults to 0 (general tangible goods) when omitted.

### TaxCloudDiscounts

- `lineItemDiscounts` (list of TaxCloudLineItemDiscount, optional) — Discounts applied to specific line items, applied before any order-level discount. Each entry must reference a valid itemId from the lineItems array.
- `orderDiscount` (TaxCloudOrderLevelDiscount, optional) — A discount applied to the entire order, applied after line-item discounts. Shipping items (TICs 11010-11015) and Colorado retail delivery fees (TIC 11098) are excluded from order-level discount calculations.

### TaxCloudExemption

- `exemptionId` (string, optional) — Identifier of an exemption certificate previously created for the customer (see /merchant/cert/create). When provided, the customer is treated as exempt and the certificate is associated with the transaction.
- `isExempt` (boolean, optional) — Whether the customer is exempt from sales tax. Assumed true when exemptionId is provided.

### TaxCloudCartResponse

- `cartId` (string, required) — Identifier of the calculated cart. Pass this to /merchant/order/create-from-cart to capture the cart as an order.
- `currency` (TaxCloudCurrency, required) — The currency the prices and tax amounts are denominated in.
- `customerId` (string, required) — Your identifier for the customer, as submitted.
- `deliveredBySeller` (boolean, required) — Whether the seller delivers the order directly, as submitted (false when omitted).
- `destination` (TaxCloudAddress, required) — The ship-to (destination) address, as submitted.
- `exemption` (TaxCloudExemption, required) — The exemption information applied to the calculation.
- `origin` (TaxCloudAddress, required) — The ship-from (origin) address, as submitted.
- `lineItems` (list of TaxCloudCartItemWithTaxResponse, optional) — The submitted line items, each with its calculated tax rate and amount.

### SelfManagedCartResponse

- `cartId` (string, required) — Identifier of the calculated cart: the cartId you submitted, or a generated one when you omitted it. Self-managed calculations are not persisted, so this identifier is for correlating the response with the request only and cannot be used with /merchant/order/create-from-cart.
- `currency` (TaxCloudCurrency, required) — The currency the prices and tax amounts are denominated in. Always USD for self-managed merchants.
- `customerId` (string, required) — Your identifier for the customer, as submitted.
- `destination` (TaxCloudAddress, required) — The ship-to (destination) address, as submitted.
- `origin` (TaxCloudAddress, required) — The ship-from (origin) address, as submitted.
- `lineItems` (list of SelfManagedCartItemWithTaxResponse, optional) — The submitted line items, each with its calculated tax rate and amount.

### TaxCloudLineItemDiscount

- `itemId` (string, required) — The itemId of the line item this discount applies to. Must match an itemId in the lineItems array.
- `type` (enum, required) — The kind of discount: 'percentage' (a fraction of the price) or 'amount' (a fixed currency amount).
  - Allowed values: `percentage`, `amount`
- `value` (double, required) — The discount value: a decimal fraction between 0 and 1 for 'percentage' (e.g. 0.1 = 10% off), or a currency amount for 'amount'. When discounts are provided, line-item prices must be pre-discount (original) prices.

### TaxCloudOrderLevelDiscount

- `type` (enum, required) — The kind of discount: 'percentage' (a fraction of the order total) or 'amount' (a fixed currency amount).
  - Allowed values: `percentage`, `amount`
- `value` (double, required) — The discount value: a decimal fraction between 0 and 1 for 'percentage', or a currency amount for 'amount'. When discounts are provided, line-item prices must be pre-discount (original) prices.

### TaxCloudCartItemWithTaxResponse

- `index` (long, required) — Zero-based position of the item within the cart or order.
- `itemId` (string, required) — Your unique identifier for the line item, as submitted.
- `originalPrice` (double, required) — The original (pre-discount) unit price, as submitted.
- `price` (double, required) — The unit price tax was calculated on. When discounts were applied, this is the discounted unit price.
- `quantity` (double, required) — Quantity of the item.
- `tax` (TaxCloudTax, required) — The tax rate and amount calculated for this line item.
- `tic` (long, optional) — Taxability Information Code (TIC) the item was calculated under. Null when no TIC applies.

### SelfManagedCartItemWithTaxResponse

- `index` (long, required) — Zero-based position of the item within the cart, as submitted.
- `itemId` (string, required) — Your unique identifier for the line item, as submitted.
- `originalPrice` (double, required) — The original unit price. Always equal to price, because discounts are not supported for self-managed merchants.
- `price` (double, required) — The unit price tax was calculated on, as submitted. Discounts are not supported for self-managed merchants, so this is always the submitted price.
- `quantity` (double, required) — Quantity of the item, as submitted.
- `tax` (TaxCloudTax, required) — The tax rate and amount calculated for this line item. The amount is money and is rounded to two decimal places, the same precision a TaxCloud-connected cart returns; the rate keeps five decimal places.
- `tic` (long, optional) — Taxability Information Code (TIC) the item was calculated under, as submitted. Null when no TIC was supplied (general tangible goods).

### TaxCloudTax

- `amount` (double, required) — The calculated tax amount for the line item, in the transaction currency.
- `rate` (double, required) — The combined tax rate applied to the line item, as a decimal fraction (e.g. 0.08125 = 8.125%).

## Examples

**Request**

```json
{
  "items": [
    {
      "currency": {
        "currencyCode": "USD"
      },
      "customerId": "customer-453",
      "destination": {
        "city": "Irvine",
        "line1": "200 Spectrum Center Dr",
        "state": "CA",
        "zip": "92618"
      },
      "lineItems": [
        {
          "index": 0,
          "itemId": "sku-1001",
          "price": 49.99,
          "quantity": 2,
          "tic": 0
        }
      ],
      "origin": {
        "city": "San Francisco",
        "line1": "1 Market St",
        "state": "CA",
        "zip": "94105"
      },
      "cartId": "cart-2026-000123"
    }
  ],
  "merchantId": "6b3c1f5e-2a8d-4c9b-9f2e-1d7a4b6c8e10",
  "transactionDate": "2026-07-13T14:00:00Z"
}
```

**Response**

```json
{
  "connectionId": "25eb9b97-5acb-492d-b720-c03e79cf715a",
  "items": [
    {
      "cartId": "cart-2026-000123",
      "currency": {
        "currencyCode": "USD"
      },
      "customerId": "customer-453",
      "deliveredBySeller": false,
      "destination": {
        "city": "Irvine",
        "countryCode": "US",
        "line1": "200 Spectrum Center Dr",
        "state": "CA",
        "zip": "92618"
      },
      "exemption": {
        "exemptionId": null,
        "isExempt": null
      },
      "lineItems": [
        {
          "index": 0,
          "itemId": "sku-1001",
          "originalPrice": 49.99,
          "price": 49.99,
          "quantity": 2,
          "tax": {
            "amount": 7.75,
            "rate": 0.0775
          },
          "tic": 0
        }
      ],
      "origin": {
        "city": "San Francisco",
        "countryCode": "US",
        "line1": "1 Market St",
        "state": "CA",
        "zip": "94105"
      }
    }
  ],
  "transactionDate": "2026-07-13T14:00:00Z"
}
```

**SDK Code**

```python
import requests

url = "https://api.zip-tax.com/merchant/cart/calculate"

payload = {
    "items": [
        {
            "currency": { "currencyCode": "USD" },
            "customerId": "customer-453",
            "destination": {
                "city": "Irvine",
                "line1": "200 Spectrum Center Dr",
                "state": "CA",
                "zip": "92618"
            },
            "lineItems": [
                {
                    "index": 0,
                    "itemId": "sku-1001",
                    "price": 49.99,
                    "quantity": 2,
                    "tic": 0
                }
            ],
            "origin": {
                "city": "San Francisco",
                "line1": "1 Market St",
                "state": "CA",
                "zip": "94105"
            },
            "cartId": "cart-2026-000123"
        }
    ],
    "merchantId": "6b3c1f5e-2a8d-4c9b-9f2e-1d7a4b6c8e10",
    "transactionDate": "2026-07-13T14:00:00Z"
}
headers = {
    "X-API-KEY": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://api.zip-tax.com/merchant/cart/calculate';
const options = {
  method: 'POST',
  headers: {'X-API-KEY': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"items":[{"currency":{"currencyCode":"USD"},"customerId":"customer-453","destination":{"city":"Irvine","line1":"200 Spectrum Center Dr","state":"CA","zip":"92618"},"lineItems":[{"index":0,"itemId":"sku-1001","price":49.99,"quantity":2,"tic":0}],"origin":{"city":"San Francisco","line1":"1 Market St","state":"CA","zip":"94105"},"cartId":"cart-2026-000123"}],"merchantId":"6b3c1f5e-2a8d-4c9b-9f2e-1d7a4b6c8e10","transactionDate":"2026-07-13T14:00:00Z"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

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

func main() {

	url := "https://api.zip-tax.com/merchant/cart/calculate"

	payload := strings.NewReader("{\n  \"items\": [\n    {\n      \"currency\": {\n        \"currencyCode\": \"USD\"\n      },\n      \"customerId\": \"customer-453\",\n      \"destination\": {\n        \"city\": \"Irvine\",\n        \"line1\": \"200 Spectrum Center Dr\",\n        \"state\": \"CA\",\n        \"zip\": \"92618\"\n      },\n      \"lineItems\": [\n        {\n          \"index\": 0,\n          \"itemId\": \"sku-1001\",\n          \"price\": 49.99,\n          \"quantity\": 2,\n          \"tic\": 0\n        }\n      ],\n      \"origin\": {\n        \"city\": \"San Francisco\",\n        \"line1\": \"1 Market St\",\n        \"state\": \"CA\",\n        \"zip\": \"94105\"\n      },\n      \"cartId\": \"cart-2026-000123\"\n    }\n  ],\n  \"merchantId\": \"6b3c1f5e-2a8d-4c9b-9f2e-1d7a4b6c8e10\",\n  \"transactionDate\": \"2026-07-13T14:00:00Z\"\n}")

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

	req.Header.Add("X-API-KEY", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.zip-tax.com/merchant/cart/calculate")

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

request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"items\": [\n    {\n      \"currency\": {\n        \"currencyCode\": \"USD\"\n      },\n      \"customerId\": \"customer-453\",\n      \"destination\": {\n        \"city\": \"Irvine\",\n        \"line1\": \"200 Spectrum Center Dr\",\n        \"state\": \"CA\",\n        \"zip\": \"92618\"\n      },\n      \"lineItems\": [\n        {\n          \"index\": 0,\n          \"itemId\": \"sku-1001\",\n          \"price\": 49.99,\n          \"quantity\": 2,\n          \"tic\": 0\n        }\n      ],\n      \"origin\": {\n        \"city\": \"San Francisco\",\n        \"line1\": \"1 Market St\",\n        \"state\": \"CA\",\n        \"zip\": \"94105\"\n      },\n      \"cartId\": \"cart-2026-000123\"\n    }\n  ],\n  \"merchantId\": \"6b3c1f5e-2a8d-4c9b-9f2e-1d7a4b6c8e10\",\n  \"transactionDate\": \"2026-07-13T14:00:00Z\"\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.zip-tax.com/merchant/cart/calculate")
  .header("X-API-KEY", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"items\": [\n    {\n      \"currency\": {\n        \"currencyCode\": \"USD\"\n      },\n      \"customerId\": \"customer-453\",\n      \"destination\": {\n        \"city\": \"Irvine\",\n        \"line1\": \"200 Spectrum Center Dr\",\n        \"state\": \"CA\",\n        \"zip\": \"92618\"\n      },\n      \"lineItems\": [\n        {\n          \"index\": 0,\n          \"itemId\": \"sku-1001\",\n          \"price\": 49.99,\n          \"quantity\": 2,\n          \"tic\": 0\n        }\n      ],\n      \"origin\": {\n        \"city\": \"San Francisco\",\n        \"line1\": \"1 Market St\",\n        \"state\": \"CA\",\n        \"zip\": \"94105\"\n      },\n      \"cartId\": \"cart-2026-000123\"\n    }\n  ],\n  \"merchantId\": \"6b3c1f5e-2a8d-4c9b-9f2e-1d7a4b6c8e10\",\n  \"transactionDate\": \"2026-07-13T14:00:00Z\"\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.zip-tax.com/merchant/cart/calculate', [
  'body' => '{
  "items": [
    {
      "currency": {
        "currencyCode": "USD"
      },
      "customerId": "customer-453",
      "destination": {
        "city": "Irvine",
        "line1": "200 Spectrum Center Dr",
        "state": "CA",
        "zip": "92618"
      },
      "lineItems": [
        {
          "index": 0,
          "itemId": "sku-1001",
          "price": 49.99,
          "quantity": 2,
          "tic": 0
        }
      ],
      "origin": {
        "city": "San Francisco",
        "line1": "1 Market St",
        "state": "CA",
        "zip": "94105"
      },
      "cartId": "cart-2026-000123"
    }
  ],
  "merchantId": "6b3c1f5e-2a8d-4c9b-9f2e-1d7a4b6c8e10",
  "transactionDate": "2026-07-13T14:00:00Z"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'X-API-KEY' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.zip-tax.com/merchant/cart/calculate");
var request = new RestRequest(Method.POST);
request.AddHeader("X-API-KEY", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"items\": [\n    {\n      \"currency\": {\n        \"currencyCode\": \"USD\"\n      },\n      \"customerId\": \"customer-453\",\n      \"destination\": {\n        \"city\": \"Irvine\",\n        \"line1\": \"200 Spectrum Center Dr\",\n        \"state\": \"CA\",\n        \"zip\": \"92618\"\n      },\n      \"lineItems\": [\n        {\n          \"index\": 0,\n          \"itemId\": \"sku-1001\",\n          \"price\": 49.99,\n          \"quantity\": 2,\n          \"tic\": 0\n        }\n      ],\n      \"origin\": {\n        \"city\": \"San Francisco\",\n        \"line1\": \"1 Market St\",\n        \"state\": \"CA\",\n        \"zip\": \"94105\"\n      },\n      \"cartId\": \"cart-2026-000123\"\n    }\n  ],\n  \"merchantId\": \"6b3c1f5e-2a8d-4c9b-9f2e-1d7a4b6c8e10\",\n  \"transactionDate\": \"2026-07-13T14:00:00Z\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "X-API-KEY": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "items": [
    [
      "currency": ["currencyCode": "USD"],
      "customerId": "customer-453",
      "destination": [
        "city": "Irvine",
        "line1": "200 Spectrum Center Dr",
        "state": "CA",
        "zip": "92618"
      ],
      "lineItems": [
        [
          "index": 0,
          "itemId": "sku-1001",
          "price": 49.99,
          "quantity": 2,
          "tic": 0
        ]
      ],
      "origin": [
        "city": "San Francisco",
        "line1": "1 Market St",
        "state": "CA",
        "zip": "94105"
      ],
      "cartId": "cart-2026-000123"
    ]
  ],
  "merchantId": "6b3c1f5e-2a8d-4c9b-9f2e-1d7a4b6c8e10",
  "transactionDate": "2026-07-13T14:00:00Z"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.zip-tax.com/merchant/cart/calculate")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```