Create transaction
This endpoint allows you to create a transaction. The transaction includes details about the sale, discounts, line items, tax configurations, and locations. You can also pass a unique transaction reference to help with identification and deduplication.
Unique reference_id
Each reference_id must be unique in your account. If a transaction with that reference_id already exists, the request is refused with 400, and nothing is saved:
400 when the first request was saved. In that case, read the saved transaction with GET /transactions/by_reference_id/{reference_id} instead of treating the retry as a failure.
Validation
The request is refused with422, and nothing is saved, when:
currencyis one we do not support. See currency support.parent_transaction_idis not one of your transactions.- Any value contains a NUL character (
\u0000).
Authorizations
Body
Public API transaction request model.
Tax calculation always happens immediately for public API requests. Does not expose the calculate_tax parameter.
Status of the transaction. Draft will exist for 24hrs
draft, finalized, void, filed "draft"
"finalized"
"void"
"filed"
The currency of the transaction. Defaults to USD. The currency must be a valid ISO 4217 currency code.
3"USD"
Amount of discount applied to the transaction. Amount is expressed in the currency of the transaction and in denominations of the smallest unit of the currency, such as cents for USD. e.g: "100" would be 100 cents or $1.00 in a USD transaction.
"100"
Amount of discount applied to the vendor in the transaction. Most of the time, you should use the discount_amount field instead. Unlike discount_amount, this discount is funded by the vendor and typically does not reduce the taxable base of the transaction. Amount is expressed in the currency of the transaction and in denominations of the smallest unit of the currency, such as cents for USD. e.g: "100" would be 100 cents or $1.00 in a USD transaction.
"100"
List of line items for an invoice or transaction. Required for sale transactions, optional for credits. A credit transaction without line_items will be assumed to be a full refund of the invoice.
Taxwire ID of the parent transaction. Used for credits on previous invoices.
"txn_123"
Reference number for the transaction for your internal use.
"INV-123"
Reference number for the parent transaction. Used for credits on previous invoices.
"INV-123"
Type of the transaction
sale, credit "sale"
"credit"
Amount of tax used in reality for the transaction. Amount is expressed in the currency of the transaction and in denominations of the smallest unit of the currency, such as cents for USD. e.g: 100 would be 100 cents or $1.00 in a USD transaction.
"100"
Response
Successful Response
Transaction response model.
Unique identifier for the transaction
"txn_123"
Date at which the transaction record was created
Date at which the transaction record was last updated
Amount of tax collected to be reported, filed, and remitted. Defaults to tax_amount if provided, otherwise the tax recorded as collected on the transaction, otherwise tax_calculation.tax_amount. The collected tax can differ from tax_calculation.tax_amount, e.g. after a finalized transaction is recalculated, or on a credit limited to its parent's remaining tax
"100"
Source of the filing tax amount. Defaults to provided if a tax_amount is provided, otherwise calculated, including when the amount is the tax recorded as collected
provided, calculated "provided"
"calculated"
Status of the transaction. Draft will exist for 24hrs
draft, finalized, void, filed "draft"
"finalized"
"void"
"filed"
Tax calculation for the transaction
The currency of the transaction. Defaults to USD. The currency must be a valid ISO 4217 currency code.
3"USD"
Amount of discount applied to the transaction. Amount is expressed in the currency of the transaction and in denominations of the smallest unit of the currency, such as cents for USD. e.g: "100" would be 100 cents or $1.00 in a USD transaction.
"100"
Amount of discount applied to the vendor in the transaction. Most of the time, you should use the discount_amount field instead. Unlike discount_amount, this discount is funded by the vendor and typically does not reduce the taxable base of the transaction. Amount is expressed in the currency of the transaction and in denominations of the smallest unit of the currency, such as cents for USD. e.g: "100" would be 100 cents or $1.00 in a USD transaction.
"100"
List of line items for an invoice or transaction. Required for sale transactions, optional for credits. A credit transaction without line_items will be assumed to be a full refund of the invoice.
ID of the parent transaction. Used for credits on previous invoices.
"txn_123"
Reference number for the transaction for your internal use.
"INV-123"
Type of the transaction
sale, credit "sale"
"credit"
Amount of tax passed in the request: the amount provided. Amount is expressed in the currency of the transaction and in denominations of the smallest unit of the currency, such as cents for USD. e.g: 100 would be 100 cents or $1.00 in a USD transaction.
"100"