POST
/
calculate
curl --request POST \
  --url https://base_url/api/v1/calculate \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "corporation_id": "b6d009b0-d174-463f-b030-94643c28e209",
  "transaction_date": "2023-12-25",
  "transaction_currency": "USD",
  "transaction_type": "SALE",
  "discount": 0.99,
  "addresses": {
    "ship_to": {
      "address_line_1": "1776 Main St",
      "address_line_2": "Apt. #123",
      "address_line_3": "<string>",
      "postal_code": "90401",
      "city": "Santa Monica",
      "state": "CA",
      "country": "US"
    },
    "ship_from": {
      "address_line_1": "1776 Main St",
      "address_line_2": "Apt. #123",
      "address_line_3": "<string>",
      "postal_code": "90401",
      "city": "Santa Monica",
      "state": "CA",
      "country": "US"
    }
  },
  "customer_details": {
    "customer_id": "<string>"
  },
  "line_items": {
    "items": [
      {
        "line_number": 2,
        "product_taxability_code": "TPP",
        "quantity": 1.01,
        "amount": 1,
        "discount": 1,
        "product_id": "<string>"
      }
    ]
  }
}'
{
  "data": {
    "corporation_id": "b6d009b0-d174-463f-b030-94643c28e209",
    "transaction_date": "2023-12-25",
    "transaction_currency": "USD",
    "discount": 0.99,
    "customer_details": {
      "customer_id": "<string>"
    },
    "tax_currency": "USD",
    "addresses": {
      "ship_from": {
        "address_line_1": "1776 Main St",
        "address_line_2": "Apt. #123",
        "address_line_3": "<string>",
        "postal_code": "90401",
        "city": "Santa Monica",
        "state": "CA",
        "country": "US"
      },
      "ship_to": {
        "address_line_1": "1776 Main St",
        "address_line_2": "Apt. #123",
        "address_line_3": "<string>",
        "postal_code": "90401",
        "city": "Santa Monica",
        "state": "CA",
        "country": "US"
      }
    },
    "line_items": [
      {
        "amount": 123,
        "taxable_amount": 123,
        "quantity": 123,
        "tax_code": "<string>",
        "product_id": "<string>",
        "effective_tax_rate": 123,
        "tax_breakdown": [
          {
            "jurisdiction": "California",
            "jurisdiction_type": "STATE",
            "rate": 6.25
          }
        ],
        "total_tax_due": 1.03
      }
    ]
  },
  "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
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.

Example:

"USD"

transaction_type
enum<string>
required

Type of the transaction (sale or refund).

Available options:
SALE,
REFUND
addresses
object
required

The addresses for this transaction, including shipping origin and destination. If destination address is not set, we will attempt to extract it from the linked customer. If a customer is not linked, or if the linked customer does not have a shipping address, the tax calculation will fail.

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

Response

200
application/json
Successful tax calculation
data
object
message
string
Example:

"Successfully calculated tax."