Transaction integration
Map order fields, addresses and line items and choose ingestion and customer-read APIs.
Integrate order and purchase history
A transaction represents a one-off order, purchase or refund with money totals, line items and optional billing/shipping addresses. Use a ticket for admission with a validity window and a subscription for an ongoing entitlement. A ticket purchase may require both an admission record and its order transaction; they serve different purposes.
Each transaction belongs to one customer and one transaction category. It can contain line items and at most one billing and one shipping address. Although a useful order normally contains purchased items, the API response can contain an empty line_items array; do not assume a minimum of one.
Choose the integration surface
| Task | Surface |
|---|---|
| Import, create, partially update, delete or search transactions; manage individual line items | REST V1 from a confidential backend using client credentials. Enable transactions and provision read/write/batch scopes as needed. |
| Show a signed-in customer's own order history | SDK HTTP API, using Authorization: Bearer YOUR_SDK_API_KEY and X-ID-Token: CUSTOMER_ID_TOKEN. |
| Occasional support correction | Authorized dashboard transaction tools. Use an API pipeline for recurring ingestion. |
| React to changes | Brand-configured transaction.created, transaction.updated, transaction.deleted webhooks. |
Read the customer/brand visibility caveats and staff-note exposure in the SDK guide before offering an order-history view. SDK access is customer-scoped, but it must not be assumed to add a current-brand filter.
Categories and identity
A brand administrator defines categories such as Shop Orders, Donations or Event Tickets in the dashboard. A category can be shared by multiple brands in an instance. REST V1 exposes category lookup as read-only: fetch GET /api/v1/transaction_categories, cache the intended mapping and send the public UUID as transaction_category_id. Do not attempt to create a taxonomy through V1 transaction writes.
The current deduplication key is external_id + source_platform + source_channel_id. Use the source's stable order ID and a consistent channel convention, including consistent null/blank handling. The old two-field uniqueness description is incomplete for channel-aware integrations. Single create, batch create and batch upsert have different duplicate/error behavior; see import transactions. Identity-based deduplication does not mean every request is safe to retry without reconciliation.
Transaction fields
The tables describe the V1/SDK transaction response vocabulary. Fields marked required are needed when creating a transaction, alongside a customer and category. Use the live schema for each endpoint's request body, null handling and validation.
| Identity field | Meaning |
|---|---|
id | Unidy public transaction UUID, assigned on create; use in resource URLs and webhook correlation. |
external_id | Required. Stable source order identifier. |
reference | Required. Customer-visible order/reference number. |
source_platform | Required. Source name such as shopify, woocommerce, plenigo or your platform. |
source_channel_id | Optional channel/store identifier, part of the business key. |
invoice_number | Optional accounting reference. |
user_id, transaction_category_id | Public customer and category UUIDs. |
| Lifecycle field | Meaning |
|---|---|
state | Required. Authoritative lifecycle value from the state table below. |
financial_status | Source's payment vocabulary, such as authorized; independent of the state enum. |
fulfillment_status | Source's fulfillment vocabulary, such as partial. |
placed_at | Required. Source order time, distinct from creation in Unidy. |
completed_at | Optional completion/terminal time. |
cancelled_at, cancel_reason | Cancellation time and free-form explanation. |
created_at, updated_at | Unidy record timestamps. |
| Money field | Meaning |
|---|---|
currency | ISO 4217 currency code such as EUR. |
total, subtotal | Total amount and subtotal before tax, shipping and discounts. |
total_tax, total_shipping, total_discount | Tax, shipping and discount totals. |
total_paid, total_refunded | Amount received and amount refunded. |
exchange_rate | Optional recorded exchange rate for non-base-currency amounts. |
prices_include_tax, tax_exempt | Tax interpretation flags, defaulting to false. |
| Payment and annotation field | Meaning |
|---|---|
payment_method | Source payment method such as credit_card, paypal or sepa. |
payment_provider_ref | Payment-provider reference. |
coupon_code | Applied coupon. |
tags | Array of classification strings. |
customer_note, staff_note | Checkout and staff notes. Current customer API responses include staff notes; do not store confidential content here. |
order_type | Source-defined type such as online or pos. |
platform_metadata | JSON object for platform-specific data. |
States
| State | Intended meaning |
|---|---|
open | Order placed without payment recorded. Send an explicit state as required by the create schema rather than relying on a historical default. |
partially_paid | Some payment received with a remaining balance. |
paid | Fully paid. |
partially_refunded | A partial refund. |
refunded | Full refund. |
cancelled | Cancelled order; use cancellation time/reason where available. |
Use state for lifecycle filtering/reporting and financial_status for the source's finer vocabulary. These enum values do not enforce a transition sequence or automatically calculate amounts; send the changed state and totals from your source of truth.
Billing and shipping addresses
billing_address and shipping_address use the same object shape and are null when absent. Each can contain:
| Field | Meaning |
|---|---|
salutation | mr, mrs or mx when provided. |
first_name, last_name, company_name | Addressee and company. |
address_line_1, address_line_2 | Street/address lines. |
city, postal_code | Locality and postal code. |
country_code | ISO 3166-1 alpha-2 code such as DE. |
phone_number | Contact phone number. |
Line items
line_items is an embedded array. Required fields below apply to a newly created item.
| Field | Meaning |
|---|---|
id | Current public line-item UUID. Older examples used numeric IDs; do not send those as current resource IDs. |
external_id | Optional stable line identifier, unique within its transaction; useful for repeatable upserts. |
name | Required. Product or charge label. |
quantity | Required. Integer quantity. |
external_product_id | Required. Source product identifier. |
unit_price, total_price | Required. Per-unit and line total amounts. |
sku, variant | Stock-keeping identifier and variant description. |
category, item_type | Free-form category/type such as physical, digital or service. |
position, seller_id | Display order and marketplace seller reference. |
staff_note, metadata | Note and provider JSON; the note can be returned to customers. |
total_discount, total_tax, tax_rate | Per-line discount/tax amounts and tax rate; for example 0.19 for 19%. |
On a partial transaction update, an item with id updates the existing UUID; id with _delete: true removes it. A stable external_id can identify an upsert; without either identity an item is new and repeating it can add another line. Dedicated line-item endpoints can also read/create/update/delete items. Check the current request schema and the retry guide before replaying a nested write.
Response shape and wire values
Single reads return the object directly; list entries are under results[] with pagination meta. A shortened response looks like this; the field tables describe the omitted optional fields.
{
"id": "86668c4a-4073-5e81-b892-07393d11c60d",
"user_id": "78eb9bab-c334-48fb-8d13-109f16d703fe",
"transaction_category_id": "b402f79e-30ce-4c94-b4c6-f7443ce26b4b",
"external_id": "ORDER-123",
"reference": "REF-456",
"source_platform": "commerce",
"source_channel_id": "web",
"state": "paid",
"currency": "EUR",
"total": 49.98,
"placed_at": "2026-05-21T10:30:00.000Z",
"billing_address": { "first_name": "Alex", "last_name": "Example", "country_code": "DE" },
"shipping_address": null,
"line_items": [
{
"id": "a9d23eac-d194-4c68-8e02-09141bf9a11a",
"external_id": "ORDER-123-LINE-1",
"name": "Admission",
"quantity": 2,
"external_product_id": "PRODUCT-123",
"unit_price": 24.99,
"total_price": 49.98
}
]
}Money values in these responses are JSON numbers (floats), not formatted currency strings, and optional amounts can be null. Use decimal-safe calculations in your integration. Timestamps are ISO 8601 strings with millisecond precision. line_items is always an array, possibly empty; addresses are objects or null. Transaction, customer, category and current line-item IDs are public UUIDs.
Import, live sync and customer order history
- One-time import: send batches of at most 100 records. Inspect per-item results, skipped duplicates and errors. Process sequentially or with bounded concurrency, and reconcile uncertain results before replaying a page.
- Live source sync: receive the source platform's order create/update/cancel events, map them to the stable business key, and create or update the corresponding transaction. Shopify order events are one possible source, but the SSO app itself does not grant order access. Send partial changes such as
state,total_paidandtotal_refundedrather than blindly replacing unchanged data. - Customer order history: list the authenticated customer's transactions through the SDK API, for example sorted by
placed_atdescending. The response includes line items and addresses, so a detail screen can often reuse that record. Handle pagination, filtering and404as described in the SDK guide.
Use the REST workflows for runnable ingestion examples and the SDK customer-data guide for supported filters (state, financial_status, source_platform and others) and sorting (placed_at, created_at, total). Configure brand webhook subscriptions separately and validate signature checks, duplicates and ordering before reacting to transaction events.