The Tax Transaction object
Attributes
- idstring
Unique identifier for the transaction.
- objectstring
String representing the object’s type. Objects of the same type share the same value.
- currencystring
Three-letter ISO currency code, in lowercase. Must be a supported currency.
- customer_
detailsobject The customer’s details, such as address and tax IDs.
- line_
itemsnullable objectExpandable The tax collected or refunded, by line item.
- metadatanullable object
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.
- referencestring
A custom unique identifier, such as ‘myOrder_123’.
- typeenum
If
reversal
, this transaction reverses an earlier transaction.
More attributes
- createdtimestamp
- customernullable string
- livemodeboolean
- reversalnullable object
- ship_
from_ detailsnullable object - shipping_
costnullable object - tax_
datetimestamp
Create a reversal transaction
Partially or fully reverses a previously created Transaction
.
Parameters
- modeenumRequired
If
partial
, the provided line item or shipping cost amounts are reversed. Iffull
, the original transaction is fully reversed. - original_
transactionstringRequired The ID of the Transaction to partially or fully reverse.
- referencestringRequired
A custom identifier for this reversal, such as
myOrder_123-refund_1
, which must be unique across all transactions. The reference helps identify this reversal transaction in exported tax reports. - flat_
amountintegerRequired if mode=partial and line_items nor shipping_cost provided A flat amount to reverse across the entire transaction, in the smallest currency unit in negative. This value represents the total amount to refund from the transaction, including taxes.
- line_
itemsarray of objectsRequired if mode=partial and neither shipping_cost nor flat_amount is provided The line item amounts to reverse.
- 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
- shipping_
costobjectRequired if mode=partial and neither line_items nor flat_amount is provided
Returns
A new Tax Transaction
object representing the reversal.
Create a transaction from a calculation
Creates a Tax Transaction
from a calculation.
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
.
Returns
A Tax Transaction
object.
Retrieve a transaction's line items
Retrieves the line items of a committed standalone transaction as a collection.
Parameters
- ending_
beforestring A cursor for use in pagination.
ending_before
is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting withobj_bar
, your subsequent call can includeending_before=obj_bar
in order to fetch the previous page of the list. - limitinteger
A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
- starting_
afterstring A cursor for use in pagination.
starting_after
is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending withobj_foo
, your subsequent call can includestarting_after=obj_foo
in order to fetch the next page of the list.
Returns
A list of Line Item objects if the Tax Transaction is found. Otherwise returns a ‘not found’ error.
Retrieve a transaction
Retrieves a Tax Transaction
object.
Parameters
No parameters.
Returns
A Tax Transaction
object.