---
title: "Create a Transaction from a Calculation"
method: POST
path: "/v1/tax/transactions/create_from_calculation"
---

# Create a Transaction from a Calculation

`POST /v1/tax/transactions/create_from_calculation`

Creates a Tax Transaction from a calculation, if that calculation hasn’t expired. Calculations expire after 90 days.

## Response `200`

Successful response.

- TaxTransaction — A Tax Transaction records the tax collected from or refunded to your customer. Related guide: [Calculate tax in your custom payment flow](https://docs.stripe.com/tax/custom#tax-transaction)
  - `created` integer, required — Time at which the object was created. Measured in seconds since the Unix epoch.
  - `currency` string, required — Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
  - `customer` string, nullable — The ID of an existing [Customer](https://docs.stripe.com/api/customers/object) used for the resource.
  - `customer_details` TaxProductResourceCustomerDetails, required
    - `address` TaxProductResourcePostalAddress
      - `city` string, nullable — City, district, suburb, town, or village.
      - `country` string, required — Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
      - `line1` string, nullable — Address line 1, such as the street, PO Box, or company name.
      - `line2` string, nullable — Address line 2, such as the apartment, suite, unit, or building.
      - `postal_code` string, nullable — ZIP or postal code.
      - `state` string, nullable — State/province as an [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) subdivision code, without country prefix, such as "NY" or "TX".
    - `address_source` 'billing' | 'shipping', nullable — The type of customer address provided.
    - `ip_address` string, nullable — The customer's IP address (IPv4 or IPv6).
    - `tax_ids` TaxProductResourceCustomerDetailsResourceTaxId[], required — The customer's tax IDs (for example, EU VAT numbers).
      - `type` 'ad_nrt' | 'ae_trn' | 'al_tin' | 'am_tin' | 'ao_tin' | 'ar_cuit' | 'au_abn' | 'au_arn' | 'aw_tin' | 'az_tin' | 'ba_tin' | 'bb_tin' | 'bd_bin' | 'bf_ifu' | 'bg_uic' | 'bh_vat' | 'bj_ifu' | 'bo_tin' | 'br_cnpj' | 'br_cpf' | 'bs_tin' | 'by_tin' | 'ca_bn' | 'ca_gst_hst' | 'ca_pst_bc' | 'ca_pst_mb' | 'ca_pst_sk' | 'ca_qst' | 'cd_nif' | 'ch_uid' | 'ch_vat' | 'cl_tin' | 'cm_niu' | 'cn_tin' | 'co_nit' | 'cr_tin' | 'cv_nif' | 'de_stn' | 'do_rcn' | 'ec_ruc' | 'eg_tin' | 'es_cif' | 'et_tin' | 'eu_oss_vat' | 'eu_vat' | 'fo_vat' | 'gb_vat' | 'ge_vat' | 'gi_tin' | 'gn_nif' | 'hk_br' | 'hr_oib' | 'hu_tin' | 'ic_nif' | 'id_npwp' | 'il_vat' | 'in_gst' | 'is_vat' | 'it_cf' | 'jp_cn' | 'jp_rn' | 'jp_trn' | 'ke_pin' | 'kg_tin' | 'kh_tin' | 'kr_brn' | 'kz_bin' | 'la_tin' | 'li_uid' | 'li_vat' | 'lk_vat' | 'ma_vat' | 'md_vat' | 'me_pib' | 'mk_vat' | 'mr_nif' | 'mx_rfc' | 'my_frp' | 'my_itn' | 'my_sst' | 'ng_tin' | 'no_vat' | 'no_voec' | 'np_pan' | 'nz_gst' | 'om_vat' | 'pe_ruc' | 'ph_tin' | 'pl_nip' | 'py_ruc' | 'ro_tin' | 'rs_pib' | 'ru_inn' | 'ru_kpp' | 'sa_vat' | 'sg_gst' | 'sg_uen' | 'si_tin' | 'sn_ninea' | 'sr_fin' | 'sv_nit' | 'th_vat' | 'tj_tin' | 'tr_tin' | 'tw_vat' | 'tz_vat' | 'ua_vat' | 'ug_tin' | 'unknown' | 'us_ein' | 'uy_ruc' | 'uz_tin' | 'uz_vat' | 've_rif' | 'vn_tin' | 'za_vat' | 'zm_tin' | 'zw_tin', required — The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `hr_oib`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `pl_nip`, `it_cf`, `fo_vat`, `gi_tin`, `py_ruc`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `li_vat`, `lk_vat`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, `al_tin`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, `de_stn`, `ch_uid`, `tz_vat`, `uz_vat`, `uz_tin`, `md_vat`, `ma_vat`, `by_tin`, `ao_tin`, `bs_tin`, `bb_tin`, `cd_nif`, `mr_nif`, `me_pib`, `zw_tin`, `ba_tin`, `gn_nif`, `mk_vat`, `sr_fin`, `sn_ninea`, `am_tin`, `np_pan`, `tj_tin`, `ug_tin`, `zm_tin`, `kh_tin`, `aw_tin`, `az_tin`, `bd_bin`, `bj_ifu`, `et_tin`, `kg_tin`, `la_tin`, `cm_niu`, `cv_nif`, `bf_ifu`, `ic_nif`, or `unknown`
      - `value` string, required — The value of the tax ID.
    - `taxability_override` 'customer_exempt' | 'none' | 'reverse_charge', required — The taxability override used for taxation.
  - `id` string, required — Unique identifier for the transaction.
  - `line_items` object, nullable — The tax collected or refunded, by line item.
    - `data` TaxTransactionLineItem[], required — Details about each object.
      - `amount` integer, required — The line item amount in the [smallest currency unit](https://docs.stripe.com/currencies#minor-units). If `tax_behavior=inclusive`, then this amount includes taxes. Otherwise, taxes were calculated on top of this amount.
      - `amount_tax` integer, required — The amount of tax calculated for this line item, in the [smallest currency unit](https://docs.stripe.com/currencies#minor-units).
      - `id` string, required — Unique identifier for the object.
      - `livemode` boolean, required — If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
      - `metadata` object, nullable — Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
      - `object` 'tax.transaction_line_item', required — String representing the object's type. Objects of the same type share the same value.
      - `product` string, nullable — The ID of an existing [Product](https://docs.stripe.com/api/products/object).
      - `quantity` integer, required — The number of units of the item being purchased. For reversals, this is the quantity reversed.
      - `reference` string, required — A custom identifier for this line item in the transaction.
      - `reversal` TaxProductResourceTaxTransactionLineItemResourceReversal
        - `original_line_item` string, required — The `id` of the line item to reverse in the original transaction.
      - `tax_behavior` 'exclusive' | 'inclusive', required — Specifies whether the `amount` includes taxes. If `tax_behavior=inclusive`, then the amount includes taxes.
      - `tax_code` string, required — The [tax code](https://docs.stripe.com/tax/tax-categories) ID used for this resource.
      - `type` 'reversal' | 'transaction', required — If `reversal`, this line item reverses an earlier transaction.
    - `has_more` boolean, required — True if this list has another page of items after this one that can be fetched.
    - `object` 'list', required — String representing the object's type. Objects of the same type share the same value. Always has the value `list`.
    - `url` string, required — The URL where this list can be accessed.
  - `livemode` boolean, required — If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
  - `metadata` object, nullable — Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
  - `object` 'tax.transaction', required — String representing the object's type. Objects of the same type share the same value.
  - `posted_at` integer, required — The Unix timestamp representing when the tax liability is assumed or reduced.
  - `reference` string, required — A custom unique identifier, such as 'myOrder_123'.
  - `reversal` TaxProductResourceTaxTransactionResourceReversal
    - `original_transaction` string, nullable — The `id` of the reversed `Transaction` object.
  - `ship_from_details` TaxProductResourceShipFromDetails
    - `address` TaxProductResourcePostalAddress, required
      - `city` string, nullable — City, district, suburb, town, or village.
      - `country` string, required — Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
      - `line1` string, nullable — Address line 1, such as the street, PO Box, or company name.
      - `line2` string, nullable — Address line 2, such as the apartment, suite, unit, or building.
      - `postal_code` string, nullable — ZIP or postal code.
      - `state` string, nullable — State/province as an [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) subdivision code, without country prefix, such as "NY" or "TX".
  - `shipping_cost` TaxProductResourceTaxTransactionShippingCost
    - `amount` integer, required — The shipping amount in the [smallest currency unit](https://docs.stripe.com/currencies#minor-units). If `tax_behavior=inclusive`, then this amount includes taxes. Otherwise, taxes were calculated on top of this amount.
    - `amount_tax` integer, required — The amount of tax calculated for shipping, in the [smallest currency unit](https://docs.stripe.com/currencies#minor-units).
    - `shipping_rate` string — The ID of an existing [ShippingRate](https://docs.stripe.com/api/shipping_rates/object).
    - `tax_behavior` 'exclusive' | 'inclusive', required — Specifies whether the `amount` includes taxes. If `tax_behavior=inclusive`, then the amount includes taxes.
    - `tax_code` string, required — The [tax code](https://docs.stripe.com/tax/tax-categories) ID used for shipping.
  - `tax_date` integer, required — The calculation uses the tax rules and rates that are in effect at this timestamp. You can use a date up to 31 days in the past or up to 31 days in the future. If you use a future date, Stripe doesn't guarantee that the expected tax rules and rate being used match the actual rules and rate that will be in effect on that date. We deploy tax changes before their effective date, but not within a fixed window.
  - `type` 'reversal' | 'transaction', required — If `reversal`, this transaction reverses an earlier transaction.

## Other responses

- `default` — Error response.

---

[API](https://skmtc.net/stripe/apis/spec3.md) · [All operations](https://skmtc.net/stripe/apis/spec3/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/stripe/spec3/revisions/3653ad45bbec/schema)
