# Calculated tax

Webhooks provide merchants with instant notifications when the Solidgate tax solution calculates the tax amount of the transaction. These notifications allow merchants to notify users about paid taxes or to save tax information in real-time on the merchant’s side.
It delivers key tax details, such as calculated amounts and tax type breakdowns, ensuring accurate and automated tax application for transactions.
Duplicate webhook events can occur. Implement idempotency on your end to avoid processing the same event twice.

Endpoint: POST CalculatedTax
Version: 1.0.0
Security: merchant, signature

## Security:

  - `merchant` (unknown)
    apiKey in header merchant

  - `signature` (unknown)
    apiKey in header signature

## Header parameters:

  - `merchant` (string, required)

  - `signature` (string, required)

  - `solidgate-event-id` (string, required)
    Unique event identifier.

  - `solidgate-event-created-at` (string, required)
    Event creation time in UTC as ISO 8601 with milliseconds.

  - `solidgate-event-type` (string, required)
    Event type, indicating the specific event that occurred.

## Request fields (application/json):

  - `order_id` (string)
    Unique order identifier, which can be used to find the payment.
For the first payment, the identifier is defined by the merchant.For recurring subscription-based payments, it is generated by the Solidgate subscription service.
    Example: 923bb4e6-4a5f-41ec-81fb-28eb8a152e55

  - `product_id` (string)
    Unique product identifier.
Can be absent for payments without product_id.

  - `total_amount` (integer)
    Payment total amount in the smallest currency unit.
It is negative if the action is not sale, chargeback_reversed, or rdr_reversed.

  - `currency` (string)
    Currency used to initiate the payment by the merchant. Three-letter ISO-4217 currency code.

  - `action` (string)
    Action of a transaction involving tax calculation.
For all action types except sale, chargeback_reversed, and rdr_reversed, the calculation amounts will be negative.
    Enum: "sale", "refund", "chargeback", "rdr", "chargeback_reversed", "rdr_reversed", "paypal_dispute"

  - `payment_category` (string)
    Payment method used to process the payment.
    Enum: "card-payment", "apm-payment"

  - `transaction_date` (string)
    Datetime when the payment was created.

  - `tax_included` (boolean)
    Indicates type of the tax.

  - `tax` (object)
    Information related to the tax calculation.
It is absent if the tax calculation fails.

  - `tax.tax_amount` (integer)
    Amount of the tax calculated.
It is negative if the action is not sale, chargeback_reversed, or rdr_reversed.

  - `tax.taxable_amount` (integer)
    Taxable amount of the transaction before tax.
It is negative if the action is not sale, chargeback_reversed, or rdr_reversed.

  - `tax.rate` (number)
    Tax rate used for the tax calculation.

  - `tax.currency` (string)
    Currency in which the tax was calculated. Three-letter ISO-4217 currency code.
Some locations only accept tax in their native currency.

  - `tax.location` (object)
    Information about the cardholder's location.

  - `tax.location.country` (string)
    Country code where the tax applies, specified using an ISO 3166-1 alpha-3 code.

  - `tax.location.state` (string)
    Name of the tax jurisdiction state.
It is filled if the country is the USA or Canada. Otherwise, it is absent.

  - `tax.legal_entity` (string)
    Name of the Legal entity for tax submission.

  - `tax.jurisdictions` (array)
    Breakdown of tax by jurisdiction, in the order returned by the tax provider.
The breakdown is provided by the provider that calculated the transaction tax. The number and structure of rows can vary between providers for the same address. This happens, for example, in some US ZIP codes and in some Canadian HST provinces.An empty array indicates that no breakdown is available.

  - `tax.jurisdictions.tax_rate` (number)
    Jurisdiction tax rate, in percent.
    Example: 9.975

  - `tax.jurisdictions.taxable_amount` (integer)
    Amount subject to tax in the jurisdiction, in the smallest currency unit.
It is negative if the action is not sale, chargeback_reversed, or rdr_reversed.
    Example: 4783

  - `tax.jurisdictions.tax_amount` (integer)
    Tax amount of the jurisdiction, in the smallest currency unit.
It is negative if the action is not sale, chargeback_reversed, or rdr_reversed.
    Example: 477

  - `tax.jurisdictions.jurisdiction` (string)
    Name of the jurisdiction that applies the tax, in uppercase. For example, a state, province, county, or city.
If type is country, it is the 3-letter country code (ISO 3166-1 alpha-3), the same as location.country.
    Example: QUEBEC

  - `tax.jurisdictions.type` (string)
    Jurisdiction level.
The value depends on the tax provider. For example, a Canadian province can be state or province.
    Enum: "country", "state", "province", "county", "city", "district", "special_purpose_district", "territory", "borough", "township", "parish", "trade_block", "transit_district", "local_improvement_district", "apo", "fpo"

  - `tax.jurisdictions.tax_name` (string)
    Tax name.
Multiple rows can have the same tax_name. For example, when county and city taxes use the same name.
    Example: QST

  - `no_tax_reason` (string)
    Reason for no tax calculated.
It is absent if the tax calculation is successful.

## Request examples:

  - `Calculated tax` (unknown)

  - `Calculated tax in Canada` (unknown)

## Response 2XX:

  - `2XX` (unknown)
    Return any 2XX status to confirm successful data receipt

