shippingTaxPreview
Requires an authenticated session.
Returns the tax a new document would charge on a shipping amount, under the organization's "Apply tax on shipping charge" setting. Saves nothing. Use it to preview a document total.
Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.
Example:
- GraphQL
- cURL
query ShippingTaxPreview($input: ShippingTaxPreviewInput!) {
shippingTaxPreview(input: $input) {
taxAmount
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "query ShippingTaxPreview($input: ShippingTaxPreviewInput!) {\n shippingTaxPreview(input: $input) {\n taxAmount\n }\n}",
"variables": {
"input": {
"currency": "string",
"shippingAmount": 0
}
}
}
EOF
Variables:
{
"input": {
"currency": "string",
"shippingAmount": 0
}
}
Response:
{
"data": {
"shippingTaxPreview": {
"taxAmount": 0
}
}
}
shippingTaxPreview(
input: ShippingTaxPreviewInput!
): ShippingTaxPreview!
Arguments
shippingTaxPreview.input ● ShippingTaxPreviewInput! non-null input
The shipping charge, its currency and the tax method.
Type
ShippingTaxPreview object
The tax a new document would charge on its shipping, under the organization's "Apply tax on shipping charge" setting.