Creates a Tax Transaction from a calculation, if that calculation hasn’t expired. Calculations expire after 90 days.
Parameters
- calculationstringRequired
Tax Calculation ID to be used as input when creating the transaction.
- referencestringRequired
A custom order or sale identifier, such as ‘myOrder_123’. Must be unique across all transactions, including reversals.
- metadataobject
Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to
metadata
.
More parameters
- posted_
attimestamp The Unix timestamp representing when the tax liability is assumed or reduced, which determines the liability posting period and handling in tax liability reports. The timestamp must fall within the
tax_
and the current time, unless thedate tax_
is scheduled in advance. Defaults to the current time.date
Returns
A Tax Transaction
object.
{ "id": "tax_1NaTVd2eZvKYlo2CoOX2Nf7P", "object": "tax.transaction", "created": 1690938353, "currency": "usd", "customer": null, "customer_details": { "address": { "city": null, "country": "US", "line1": "354 Oyster Point Blvd", "line2": "", "postal_code": "94080", "state": "CA" }, "address_source": "shipping", "ip_address": null, "tax_ids": [], "taxability_override": "none" }, "line_items": { "object": "list", "data": [ { "id": "tax_li_ONDxh8JZw14sP8", "object": "tax.transaction_line_item", "amount": 1499, "amount_tax": 148, "livemode": false, "metadata": null, "product": null, "quantity": 1, "reference": "Pepperoni Pizza", "reversal": null, "tax_behavior": "exclusive", "tax_code": "txcd_40060003", "type": "transaction" } ], "has_more": false, "url": "/v1/tax/transactions/tax_1NaTVd2eZvKYlo2CoOX2Nf7P/line_items" }, "livemode": false, "metadata": null, "posted_at": 1690932566, "reference": "myOrder_123", "reversal": null, "shipping_cost": { "amount": 300, "amount_tax": 0, "tax_behavior": "exclusive", "tax_code": "txcd_92010001" }, "tax_date": 1690938353, "type": "transaction"}