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).
Body
Public API transaction request model.
Tax calculation always happens immediately for public API requests. Does not expose the calculate_tax parameter.
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"
Date and time for the tax calculation. Timezone is required for better accuracy. Use the ISO 8601 format. e.g: 2024-03-15T12:00:00Z. If not provided, the current UTC date and time will be used.
"2024-03-15T12:00:00Z"
Response
Successful Response
Transaction response model.
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"
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"
Date and time for the tax calculation. Timezone is required for better accuracy. Use the ISO 8601 format. e.g: 2024-03-15T12:00:00Z. If not provided, the current UTC date and time will be used.
"2024-03-15T12:00:00Z"