A transaction records a completed sale. Numeral files and remits tax based on the transactions recorded in each jurisdiction and period. Create one from a calculation after the customer pays: you need the
calculation_id, which keeps the tax and accounting information tidy for filing. Record returns against it as refunds.Where transactions fit
The Transaction object
Attributes
string
The ID of the transaction,
tr_…. Store it: refunds and lookups use it.string, value is "tax.transaction"
String representing the object’s type.
string
The calculation this transaction was created from.
string
Your order ID, as sent when creating the transaction.
string
ISO 4217 currency of the transaction.
string
Currency the tax on this transaction will be filed and remitted in.
array of objects
The line items from the calculation.
string
Numeral-generated ID for this line item.
object
reference_line_item_id, reference_product_id, reference_product_name and product_tax_code, as on the calculation.array of objects
One row per taxing jurisdiction:
tax_rate, rate_type, jurisdiction_name, fee_amount, and note. Same fields as on the calculation.number
Tax on the line, in the currency’s smallest unit.
number
Line amount excluding tax.
number
Line amount including tax.
number
Quantity sold.
timestamp
Unix seconds when the sale was made. Defaults to when the transaction was created.
boolean
true if made with a test API key. Live transactions count toward your nexus totals, and Numeral files them where you’re registered and collecting.object
Key-value pairs from the request. Only present when sent.
The Transaction object
Create a transaction
Records a sale from a calculation. Because the transaction comes from a calculation, the request is short. The response includes the calculation’s line items. Try it in the API reference.Parameters
string
required
The
id of the calculation to record.string
required
Your order ID. Must be unique across your transactions.
number
When the sale was made, Unix seconds. Defaults to now.
object
Up to 50 keys, each up to 255 characters. Values must be strings of up to 255 characters.
Returns
A Transaction object.POST /tax/transactions
Response
Retrieve a transaction
Returns a transaction by itsid. Try it in the API reference.string
required
The transaction’s
id.Returns
A Transaction object.GET /tax/transactions/:id
Delete a transaction
Deletes a transaction, for example one recorded by mistake. To record a return, create a refund instead. Try it in the API reference.string
required
The transaction’s
id.Returns
The deleted object type and when it was deleted.DELETE /tax/transactions/:id
Response
The Refund object
A refund records money returned to the customer against a transaction.Attributes
string
The ID of the refund,
ref_tr_…. Store it: reversing the refund needs it.string, value is "tax.refund"
String representing the object’s type.
enum
full or partial. Returned when the refund is created.timestamp
Unix seconds when the refund was made. Defaults to when the refund was created.
boolean
true if made with a test API key.array of objects
The refunded line items. Same fields as the transaction’s line items.
The Refund object
Create a refund
Records a full or partial refund against a transaction. Try it in the API reference.Parameters
string
required
The
id of the transaction to refund.enum
required
full refunds everything. partial refunds the line_items you send.number
When the refund was made, Unix seconds. Defaults to now.
array of objects
Required for
partial refunds. Not needed for full.string
The product to refund. Numeral finds the matching line item on the original transaction by this ID.
number
Sale amount refunded on this line, excluding tax, in the currency’s smallest unit, e.g.
-200.number
Tax refunded on this line, e.g.
-14.number
Quantity refunded.
string
Your line item ID, used only for reporting.
Returns
A Refund object.POST /tax/refunds
List refunds for a transaction
Returns every refund recorded against a transaction. Try it in the API reference.string
required
The transaction’s
id.Returns
An object with arefunds array of Refund objects, without refund_type.GET /tax/transactions/:id/refunds
Response
Reverse a refund
Undoes a refund you created. Try it in the API reference.string
required
The
id of the refund to reverse.Returns
A Refund object.POST /tax/refund_reversals
Errors
Errors return anerror object with error_code, error_message, and sometimes error_meta (details such as the offending field and the expected and received types). Handle them by error_code. The request ID is in the X-Request-Id response header.Also returned:
- 404 on create when
calculation_iddoesn’t exist. - 404 on create refund when
transaction_iddoesn’t exist.
400