Skip to main content
POST
/
calculate
{
  "corporation_id": "b6d009b0-d174-463f-b030-94643c28e209",
  "transaction_date": "2023-12-25",
  "transaction_currency": "USD",
  "transaction_type": "SALE",
  "discount": 0,
  "addresses": {
    "ship_to": {
      "address_line_1": "1776 Main St",
      "address_line_2": "Apt. #123",
      "postal_code": "90401",
      "city": "Santa Monica",
      "state": "CA",
      "country": "US"
    },
    "ship_from": {
      "address_line_1": "1776 Main St",
      "address_line_2": "Apt. #123",
      "postal_code": "90401",
      "city": "Santa Monica",
      "state": "CA",
      "country": "US"
    }
  },
  "customer_details": {
    "customer_id": "customer_123"
  },
  "line_items": {
    "items": [
      {
        "line_number": 1,
        "product_taxability_code": "TPP",
        "quantity": 1,
        "amount": 100.00,
        "discount": 0,
        "product_id": "prod_123"
      }
    ]
  }
}
{
  "data": {
    "id": "calc_123",
    "corporation_id": "b6d009b0-d174-463f-b030-94643c28e209",
    "transaction_date": "2023-12-25",
    "transaction_currency": "USD",
    "discount": 0,
    "calculation_currency": "USD",
    "exchange_rate": 1.0,
    "total_amount": 100.00,
    "total_tax": 9.50,
    "total_due": 109.50,
    "customer_details": {
      "customer_id": "customer_123"
    },
    "tax_currency": "USD",
    "addresses": {
      "ship_from": {
        "address_line_1": "1776 Main St",
        "address_line_2": "Apt. #123",
        "postal_code": "90401",
        "city": "Santa Monica",
        "state": "CA",
        "country": "US"
      },
      "ship_to": {
        "address_line_1": "1776 Main St",
        "address_line_2": "Apt. #123",
        "postal_code": "90401",
        "city": "Santa Monica",
        "state": "CA",
        "country": "US"
      }
    },
    "line_items": [
      {
        "line_item_id": "line_123",
        "amount": 100.00,
        "taxable_amount": 100.00,
        "quantity": 1,
        "tax_code": "TPP",
        "product_id": "prod_123",
        "line_number": 1,
        "effective_tax_rate": 9.5,
        "base_tax_rate": 6.0,
        "tax_breakdown": [
          {
            "jurisdiction_name": "California",
            "jurisdiction_type": "STATE",
            "rate": 6.0,
            "base_rate": 6.0,
            "tax_class": "TAXABLE",
            "tax_class_reason": ""
          },
          {
            "jurisdiction_name": "Los Angeles County",
            "jurisdiction_type": "COUNTY",
            "rate": 2.25,
            "base_rate": 2.25,
            "tax_class": "TAXABLE",
            "tax_class_reason": ""
          },
          {
            "jurisdiction_name": "Santa Monica",
            "jurisdiction_type": "CITY",
            "rate": 1.25,
            "base_rate": 1.25,
            "tax_class": "TAXABLE",
            "tax_class_reason": ""
          }
        ],
        "total_tax_due": 9.50
      }
    ]
  },
  "message": "Successfully calculated tax."
}

Documentation Index

Fetch the complete documentation index at: https://docs.commenda.io/llms.txt

Use this file to discover all available pages before exploring further.

{
  "corporation_id": "b6d009b0-d174-463f-b030-94643c28e209",
  "transaction_date": "2023-12-25",
  "transaction_currency": "USD",
  "transaction_type": "SALE",
  "discount": 0,
  "addresses": {
    "ship_to": {
      "address_line_1": "1776 Main St",
      "address_line_2": "Apt. #123",
      "postal_code": "90401",
      "city": "Santa Monica",
      "state": "CA",
      "country": "US"
    },
    "ship_from": {
      "address_line_1": "1776 Main St",
      "address_line_2": "Apt. #123",
      "postal_code": "90401",
      "city": "Santa Monica",
      "state": "CA",
      "country": "US"
    }
  },
  "customer_details": {
    "customer_id": "customer_123"
  },
  "line_items": {
    "items": [
      {
        "line_number": 1,
        "product_taxability_code": "TPP",
        "quantity": 1,
        "amount": 100.00,
        "discount": 0,
        "product_id": "prod_123"
      }
    ]
  }
}
{
  "data": {
    "id": "calc_123",
    "corporation_id": "b6d009b0-d174-463f-b030-94643c28e209",
    "transaction_date": "2023-12-25",
    "transaction_currency": "USD",
    "discount": 0,
    "calculation_currency": "USD",
    "exchange_rate": 1.0,
    "total_amount": 100.00,
    "total_tax": 9.50,
    "total_due": 109.50,
    "customer_details": {
      "customer_id": "customer_123"
    },
    "tax_currency": "USD",
    "addresses": {
      "ship_from": {
        "address_line_1": "1776 Main St",
        "address_line_2": "Apt. #123",
        "postal_code": "90401",
        "city": "Santa Monica",
        "state": "CA",
        "country": "US"
      },
      "ship_to": {
        "address_line_1": "1776 Main St",
        "address_line_2": "Apt. #123",
        "postal_code": "90401",
        "city": "Santa Monica",
        "state": "CA",
        "country": "US"
      }
    },
    "line_items": [
      {
        "line_item_id": "line_123",
        "amount": 100.00,
        "taxable_amount": 100.00,
        "quantity": 1,
        "tax_code": "TPP",
        "product_id": "prod_123",
        "line_number": 1,
        "effective_tax_rate": 9.5,
        "base_tax_rate": 6.0,
        "tax_breakdown": [
          {
            "jurisdiction_name": "California",
            "jurisdiction_type": "STATE",
            "rate": 6.0,
            "base_rate": 6.0,
            "tax_class": "TAXABLE",
            "tax_class_reason": ""
          },
          {
            "jurisdiction_name": "Los Angeles County",
            "jurisdiction_type": "COUNTY",
            "rate": 2.25,
            "base_rate": 2.25,
            "tax_class": "TAXABLE",
            "tax_class_reason": ""
          },
          {
            "jurisdiction_name": "Santa Monica",
            "jurisdiction_type": "CITY",
            "rate": 1.25,
            "base_rate": 1.25,
            "tax_class": "TAXABLE",
            "tax_class_reason": ""
          }
        ],
        "total_tax_due": 9.50
      }
    ]
  },
  "message": "Successfully calculated tax."
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
corporation_id
string
required

The unique identifier for the corporation associated with this transaction.

Example:

"b6d009b0-d174-463f-b030-94643c28e209"

transaction_date
string<date>
required

ISO 8601 formatted date string indicating date on which the transaction took place.

transaction_currency
string
required

ISO 4217 alpha-3 currency code for the transaction. If omitted, defaults to the standard currency of the ship-to country (e.g., USD for the US, CAD for Canada, GBP for the UK). When this differs from the ship-to country's default currency, amounts are automatically converted for tax calculation and converted back in the response.

Example:

"USD"

transaction_type
enum<string>
required

Type of the transaction:

  • SALE: Standard sales transaction.
  • REFUND: Refund/return transaction with negative line item amounts.
  • PURCHASE: Purchase transaction for input tax credit tracking. Line item amounts must be negative.
Available options:
SALE,
REFUND,
PURCHASE
addresses
object
required

Shipping origin and destination addresses. The ship_to field is optional when a customer_id is provided that has a default shipping address on file. The ship_from field is required for certain destination countries. All address fields are validated against country-specific requirements — query /address-requirements to check which fields are required, optional, or ignored for a given country.

customer_details
object
required

Customer details for this transaction.

line_items
object
required
discount
number

Total discount amount applied to the subtotal.

Required range: x >= 0
Example:

0.99

exemption_reason
enum<string>

Optional exemption reason to apply to the entire transaction. When provided, the transaction may be fully or partially exempt from tax based on the exemption type and applicable jurisdiction rules.

Available options:
PURPOSE_RESALE,
ENTITY_TYPE_NONPROFIT,
GOVERNMENT,
MANUFACTURER,
AGRICULTURAL,
EXEMPT_PRODUCT,
OTHER,
EXEMPT_PRODUCT

Response

Successful tax calculation

data
object
message
string
Example:

"Successfully calculated tax."