Shopify Calc 230321
Shopify Calc 230321
POST
/#
{config_url}
POST
/#
{config_url}
Path variables
config_url
string
required
The tax_calculation url defined using the Shopify cart_line
Request headers
X-Shopify-Shop-Domain
string
required
The permanent domain of the merchant’s shop. Can be used to identify which shop is initiating the tax calculation.
X-Shopify-Request-Id
string
required
The unique request ID used to track specific requests for troubleshooting purposes.
X-Shopify-Hmac-SHA256
string
required
Token that is generated using HMAC algorithm with a SHA-256 hash of the request body encrypted with the secret of the app.
Request body
application/json
Examples
{
"idempotent_key": "bbf8e3a2485c1a07c5c964f59e651eb0",
"request": {
"datetime_created_utc": "2023-02-21T14:38:12.000Z",
"tax_included": true
},
"cart": {
"buyer_identity": {
"customer": {
"id": "gid://Shopify/Customer/1234"
},
"purchasing_company": {
"company": {
"id": "gid://Shopify/Company/1",
"vat_number": "ATU99999999"
}
},
"tax_exempt": true
},
"billing_address": {
"address1": "620 King St W",
"address2": "Unit 5",
"city": "Toronto",
"province": "Ontario",
"province_code": "ON",
"country": "Canada",
"country_code": "CA",
"zip": "M5V1M7"
},
"delivery_groups": [
{
"id": "56H1FGg6d16DFSD16gfdg",
"selected_delivery_method": {
"subtotal_amount": {
"amount": "12.5",
"currency_code": "USD"
},
"total_amount": {
"amount": "12.5",
"currency_code": "USD"
},
"delivery_method_type": "SHIPPING"
},
"origin_address": {
"address1": "620 King St W",
"address2": "Unit 5",
"city": "Toronto",
"province": "Ontario",
"province_code": "ON",
"country": "Canada",
"country_code": "CA",
"zip": "M5V1M7"
},
"delivery_address": {
"address1": "620 King St W",
"address2": "Unit 5",
"city": "Toronto",
"province": "Ontario",
"province_code": "ON",
"country": "Canada",
"country_code": "CA",
"zip": "M5V1M7"
},
"cart_lines": [
{
"id": "gid://shopify/LineItem/8BLFxjEHP5PkA1kNsb6iRKX9",
"merchandise": {
"id": "gid://Shopify/ProductVariant/1",
"type": "PRODUCT_VARIANT",
"sku": "XYZ12345",
"product": {
"id": "gid://Shopify/Product/2",
"handle": "crazy-pants",
"is_gift_card": true,
"metafields": [
{
"name": "tax_code",
"value": ""
}
]
},
"requires_shipping": true,
"weight": 12.5,
"weight_unit": "GRAMS",
"tax_exempt": true,
"metafields": [
{
"name": "tax_code",
"value": 1
}
]
},
"quantity": 5,
"cost": {
"amount_per_quantity": {
"amount": "12.5",
"currency_code": "USD"
},
"subtotal_amount": {
"amount": "12.5",
"currency_code": "USD"
},
"total_amount": {
"amount": "12.5",
"currency_code": "USD"
}
}
}
]
}
]
}
}
Responses
200
200
OK
Body
application/json
Examples
{
"idempotent_key": "bbf8e3a2485c1a07c5c964f59e651eb0",
"currency": "USD",
"delivery_group_taxes": [
{
"id": "56H1FGg6d16DFSD16gfdg",
"tax_lines": [
{
"line_id": 5487357024222,
"tax_id": 897956,
"calculated_tax": "12.5",
"calculated_tax_refundable": "12.5",
"amount_exempt": "12.5",
"amount_taxable": "12.5",
"amount_non_taxable": "12.5"
}
]
}
],
"taxes": [
{
"id": 897956,
"title": "Canada GST",
"rate": {
"type": "EXCISE_TAX",
"structure": "MEASUREMENT_BASED",
"amount": "12.5"
},
"source": {
"tax_registration": {
"code": "US-NY",
"registration_number": "1234"
},
"tax_authority": {
"code": "US-NY"
},
"tax_jurisdiction": {
"type": "CITY",
"name": "New York City",
"reporting_code": "12345"
},
"reporting_code": "12345"
}
}
],
"errors": [
{
"code": "MALFORMED_ADDRESS",
"message": "Address is not real"
}
]
}
Object
buyer_identity
billing_address
delivery_groups
Object
id
string
required
Example:
56H1FGg6d16DFSD16gfdg
selected_delivery_method
cart_delivery_option
required
origin_address
delivery_address
cart_lines
Object
subtotal_amount
money
required
total_amount
money
required
delivery_method_type
delivery_method
required
Object
id
string
required
Example:
gid://shopify/LineItem/8BLFxjEHP5PkA1kNsb6iRKX9
merchandise
One of
required
quantity
integer
required
Min:
1
Example:
5
cost
cart_line_cost
required
Object
title
string
Example:
Wooden Bowl (Custom)
type
is_gift_card
boolean
required
Example:
false
requires_shipping
boolean
Example:
true
weight
number
Example:
12.5
weight_unit
tax_exempt
boolean
required
Example:
false
Object
id
string
required
Example:
gid://Shopify/ProductVariant/1
type
sku
string
Example:
XYZ12345
product
product
required
requires_shipping
boolean
required
Example:
true
weight
number
Example:
12.5
weight_unit
tax_exempt
boolean
required
Example:
false
metafields
Object
id
string
required
Example:
gid://Shopify/Product/2
handle
string
required
Example:
crazy-pants
is_gift_card
boolean
required
Example:
false
metafields
Object
Object
address1
string
Example:
620 King St W
address2
string
Example:
Unit 5
city
string
Example:
Toronto
province
string
Example:
Ontario
province_code
string
Min length:
2
Max length:
3
Example:
ON
country
string
required
Example:
Canada
country_code
string
required
Min length:
2
Max length:
3
Example:
CA
zip
string
Example:
M5V1M7
Object
amount
currency_code
string
Min length:
3
Max length:
3
Example:
USD
Object
id
string
required
Example:
897956
title
string
required
Example:
Canada GST
rate
tax_rate
required
source
tax_line_source
required
Object
type
string
required
Enumeration:
USE_TAX
SALES_TAX
EXCISE_TAX
FEE
UNKNOWN
structure
string
required
Enumeration:
STANDARD
FLAT
QUANTITY_BASED
MEASUREMENT_BASED
amount
decimal
required
Object
tax_registration
Object
required
code
string
required
Example:
US-NY
registration_number
string
required
Example:
1234
tax_authority
Object
required
code
string
required
Example:
US-NY
tax_jurisdiction
tax_jurisdiction
required
reporting_code
string
Example:
12345
Object
type
tax_jurisdiction_type
required
name
string
required
Example:
New York City
reporting_code
string
Example:
12345