> ## Documentation Index
> Fetch the complete documentation index at: https://developer.zamp.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Sales Tax API Quickstart

> Go from an API key to your first sales tax calculation in four steps — authenticate, calculate tax on a transaction, and post it for filing.

This quickstart takes you from an API key to a filed-ready transaction in about five minutes. It's part of the [sales tax API documentation](/) and works the same whether you're using a trial key or a production key.

<Note>
  Need a key? Get a [free 30-day trial key](/guides/trial) — no credit card or sales call — or [copy your production key](/guides/production-api-access) from your Zamp account.
</Note>

<Steps>
  <Step title="Get your API key">
    Use a [free trial key](/guides/trial) (preconfigured with all 47 remote-seller state registrations) to explore and test, or [production access](/guides/production-api-access) through your Zamp account when you're ready to go live.
  </Step>

  <Step title="Authenticate">
    Pass your API key as a bearer token in the `Authorization` header on every request. See [Authentication](/guides/authentication) for details.

    ```bash theme={null}
    curl https://api.zamp.com/transactions \
      -H "Authorization: Bearer {your-api-key}"
    ```
  </Step>

  <Step title="Calculate tax on a transaction">
    Send a transaction to [`POST /calculations`](/api-reference/calculations). The `shipToAddress` determines the taxing jurisdictions, and each line item's `productTaxCode` determines taxability — see [Tax codes](/guides/zamp-tax-codes) to find the right codes for your catalog.

    <CodeGroup>
      ```bash cURL theme={null}
      curl -X POST https://api.zamp.com/calculations \
        -H "Authorization: Bearer {your-api-key}" \
        -H "Content-Type: application/json" \
        -d '{
          "id": "123",
          "name": "INV-123",
          "transactedAt": "2023-07-01T00:00:00.000Z",
          "isResale": false,
          "discount": 2,
          "subtotal": 18,
          "shippingHandling": 5,
          "total": 23,
          "shipToAddress": {
            "line1": "120 SW 10TH AVE",
            "line2": null,
            "state": "KS",
            "city": "TOPEKA",
            "zip": "66612"
          },
          "lineItems": [
            {
              "id": "LI-123",
              "amount": 10,
              "quantity": 2,
              "discount": 0,
              "shippingHandling": 0,
              "productName": "The Ultimate Sampler",
              "productSku": "SAMPLER-100",
              "productTaxCode": "R_TPP_FOOD-BEVERAGE_HOME-CONSUMPTION"
            }
          ]
        }'
      ```

      ```javascript Node.js theme={null}
      const response = await fetch("https://api.zamp.com/calculations", {
        method: "POST",
        headers: {
          "Authorization": "Bearer {your-api-key}",
          "Content-Type": "application/json",
        },
        body: JSON.stringify({
          id: "123",
          name: "INV-123",
          transactedAt: "2023-07-01T00:00:00.000Z",
          isResale: false,
          discount: 2,
          subtotal: 18,
          shippingHandling: 5,
          total: 23,
          shipToAddress: {
            line1: "120 SW 10TH AVE",
            line2: null,
            state: "KS",
            city: "TOPEKA",
            zip: "66612",
          },
          lineItems: [
            {
              id: "LI-123",
              amount: 10,
              quantity: 2,
              discount: 0,
              shippingHandling: 0,
              productName: "The Ultimate Sampler",
              productSku: "SAMPLER-100",
              productTaxCode: "R_TPP_FOOD-BEVERAGE_HOME-CONSUMPTION",
            },
          ],
        }),
      });

      const calculation = await response.json();
      console.log(calculation.taxDue);
      ```

      ```python Python theme={null}
      import requests

      response = requests.post(
          "https://api.zamp.com/calculations",
          headers={"Authorization": "Bearer {your-api-key}"},
          json={
              "id": "123",
              "name": "INV-123",
              "transactedAt": "2023-07-01T00:00:00.000Z",
              "isResale": False,
              "discount": 2,
              "subtotal": 18,
              "shippingHandling": 5,
              "total": 23,
              "shipToAddress": {
                  "line1": "120 SW 10TH AVE",
                  "line2": None,
                  "state": "KS",
                  "city": "TOPEKA",
                  "zip": "66612",
              },
              "lineItems": [
                  {
                      "id": "LI-123",
                      "amount": 10,
                      "quantity": 2,
                      "discount": 0,
                      "shippingHandling": 0,
                      "productName": "The Ultimate Sampler",
                      "productSku": "SAMPLER-100",
                      "productTaxCode": "R_TPP_FOOD-BEVERAGE_HOME-CONSUMPTION",
                  },
              ],
          },
      )

      print(response.json()["taxDue"])
      ```
    </CodeGroup>

    The response returns the total `taxDue` plus one entry per taxing jurisdiction — state, county, and district — for each line item and for shipping. Abridged here; see the [Calculations reference](/api-reference/calculations) for the full response.

    ```json Response (abridged) theme={null}
    {
      "id": "123",
      "name": "INV-123",
      "taxDue": 1.58,
      "taxes": [
        {
          "lineItemId": "LI-123",
          "state": "KS",
          "jurisdictionCode": "KS.S.20",
          "jurisdictionName": "KANSAS",
          "jurisdictionDivision": "STATE",
          "taxableAmount": 18,
          "taxRate": 0.04,
          "taxDue": 0.72
        },
        {
          "lineItemId": "LI-123",
          "state": "KS",
          "jurisdictionCode": "KS.C.177",
          "jurisdictionName": "SHAWNEE COUNTY",
          "jurisdictionDivision": "COUNTY",
          "taxableAmount": 18,
          "taxRate": 0.0135,
          "taxDue": 0.243
        }
      ]
    }
    ```
  </Step>

  <Step title="Post the transaction for filing">
    Once the sale completes, persist it with [`POST /transactions`](/api-reference/transactions) using the same transaction shape. This is the core **calculate, then post** workflow behind every Zamp integration — calculations quote the tax, posted transactions become the returns Zamp files.
  </Step>
</Steps>

## Next steps

<CardGroup cols={2}>
  <Card title="Calculations and transactions" icon="diagram-project" href="/guides/core-workflows">
    The recommended workflows for quoting tax and recording sales.
  </Card>

  <Card title="Transaction object" icon="receipt" href="/guides/understanding-the-transaction-object">
    Every field on the object behind calculations and transactions.
  </Card>

  <Card title="Tax codes" icon="tags" href="/guides/zamp-tax-codes">
    Map your products to the right taxability rules.
  </Card>

  <Card title="Errors" icon="triangle-exclamation" href="/guides/errors">
    Status codes and error formats you'll want to handle.
  </Card>
</CardGroup>

Before going live, review [Certifying your integration](/guides/certifying-your-integration) to make sure your build handles every customer scenario.
