Unidy Docs

Transactions and line items

Find payload fields for transactions and their line items, including deletion events.

See the event catalogue for subscription triggers and Envelope and timing for the shared webhook fields.

Transaction events

transaction.created and transaction.updated carry a transaction snapshot, including addresses and line_items. They are not filtered by a service on the webhook subscription.

GroupFields and wire types
Identifiersid, user_id, transaction_category_id (UUID strings); external_id, reference, source_platform; source_channel_id (string or null).
Statusstate, order_type, financial_status, fulfillment_status, cancel_reason (strings, nullable where unset). Interpret each status for its own purpose.
Payment referencescurrency, payment_method, payment_provider_ref, coupon_code, invoice_number (strings or null).
Amountstotal, subtotal, total_discount, total_paid, total_refunded, total_shipping, total_tax, exchange_rate (numbers or null).
Tax and classificationprices_include_tax, tax_exempt (booleans); tags (array of strings).
Notes and metadatacustomer_note, staff_note (strings or null); platform_metadata (JSON or null).
Datesplaced_at, cancelled_at, completed_at, created_at, updated_at (timestamps, nullable where unset).
Related databilling_address, shipping_address (objects or null); line_items (array).

Each address object contains salutation, first_name, last_name, company_name, address_line_1, address_line_2, city, postal_code, country_code, and phone_number; values can be null. Nested line items use the fields in the next section, except that the parent transaction_id is supplied only on standalone line-item event objects.

A transaction update may reflect line-item changes. Use the snapshot to reconcile the aggregate; do not assume an update means only a payment status changed. Notes and metadata may contain information intended for staff, so choose explicitly what your consumer forwards or exposes.

Transaction state values are open, partially_paid, paid, partially_refunded, refunded, and cancelled. A .updated event has the same full-object shape as .created; compare its updated_at with the version you stored, while allowing for asynchronous snapshots and out-of-order delivery. platform_metadata and each line item's metadata can be absent, null, or vary by source platform. Neither is a fixed set of Shopify or other provider keys.

transaction.deleted contains only id and user_id. The user ID can be null if the related user cannot be resolved during pre-deletion serialization. There are no addresses, line items, totals, or external-platform identifiers in this deletion payload.

Transaction line-item events

transaction_line_item.created and .updated carry transaction_line_item with these fields:

GroupFields and wire types
Identifiersid, transaction_id (UUID strings); external_id (string or null); external_product_id (string); seller_id (string or null).
Descriptionname, sku, variant, category, item_type, staff_note (strings, nullable where unset).
Quantity and orderquantity (integer); position (integer or null).
Amountsunit_price, total_price (numbers); total_discount, total_tax, tax_rate (numbers or null).
Additional datametadata (JSON or null).

Example transaction_line_item value:

json
{
  "id": "8e1ab455-0a1d-486b-a5f5-24b4b838d882",
  "transaction_id": "9431557b-cfcf-4a98-bc57-c7dbeef2c817",
  "external_id": "order-42-item-1",
  "external_product_id": "product-7",
  "seller_id": null,
  "name": "Example item",
  "sku": "EXAMPLE-7",
  "variant": null,
  "category": null,
  "item_type": null,
  "staff_note": null,
  "quantity": 2,
  "position": 1,
  "unit_price": 10.0,
  "total_price": 20.0,
  "total_discount": null,
  "total_tax": null,
  "tax_rate": null,
  "metadata": {}
}

transaction_line_item.deleted contains only id and transaction_id, as shown in the envelope example. Line-item payloads do not include created_at or updated_at. Store the parent relationship when applying them, and use a current transaction fetch when you need to reconcile its complete set of items.

Was this page helpful?