Unidy Docs

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

TaskSurface
Import, create, partially update, delete or search transactions; manage individual line itemsREST 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 historySDK HTTP API, using Authorization: Bearer YOUR_SDK_API_KEY and X-ID-Token: CUSTOMER_ID_TOKEN.
Occasional support correctionAuthorized dashboard transaction tools. Use an API pipeline for recurring ingestion.
React to changesBrand-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 fieldMeaning
idUnidy public transaction UUID, assigned on create; use in resource URLs and webhook correlation.
external_idRequired. Stable source order identifier.
referenceRequired. Customer-visible order/reference number.
source_platformRequired. Source name such as shopify, woocommerce, plenigo or your platform.
source_channel_idOptional channel/store identifier, part of the business key.
invoice_numberOptional accounting reference.
user_id, transaction_category_idPublic customer and category UUIDs.
Lifecycle fieldMeaning
stateRequired. Authoritative lifecycle value from the state table below.
financial_statusSource's payment vocabulary, such as authorized; independent of the state enum.
fulfillment_statusSource's fulfillment vocabulary, such as partial.
placed_atRequired. Source order time, distinct from creation in Unidy.
completed_atOptional completion/terminal time.
cancelled_at, cancel_reasonCancellation time and free-form explanation.
created_at, updated_atUnidy record timestamps.
Money fieldMeaning
currencyISO 4217 currency code such as EUR.
total, subtotalTotal amount and subtotal before tax, shipping and discounts.
total_tax, total_shipping, total_discountTax, shipping and discount totals.
total_paid, total_refundedAmount received and amount refunded.
exchange_rateOptional recorded exchange rate for non-base-currency amounts.
prices_include_tax, tax_exemptTax interpretation flags, defaulting to false.
Payment and annotation fieldMeaning
payment_methodSource payment method such as credit_card, paypal or sepa.
payment_provider_refPayment-provider reference.
coupon_codeApplied coupon.
tagsArray of classification strings.
customer_note, staff_noteCheckout and staff notes. Current customer API responses include staff notes; do not store confidential content here.
order_typeSource-defined type such as online or pos.
platform_metadataJSON object for platform-specific data.

States

StateIntended meaning
openOrder placed without payment recorded. Send an explicit state as required by the create schema rather than relying on a historical default.
partially_paidSome payment received with a remaining balance.
paidFully paid.
partially_refundedA partial refund.
refundedFull refund.
cancelledCancelled 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:

FieldMeaning
salutationmr, mrs or mx when provided.
first_name, last_name, company_nameAddressee and company.
address_line_1, address_line_2Street/address lines.
city, postal_codeLocality and postal code.
country_codeISO 3166-1 alpha-2 code such as DE.
phone_numberContact phone number.

Line items

line_items is an embedded array. Required fields below apply to a newly created item.

FieldMeaning
idCurrent public line-item UUID. Older examples used numeric IDs; do not send those as current resource IDs.
external_idOptional stable line identifier, unique within its transaction; useful for repeatable upserts.
nameRequired. Product or charge label.
quantityRequired. Integer quantity.
external_product_idRequired. Source product identifier.
unit_price, total_priceRequired. Per-unit and line total amounts.
sku, variantStock-keeping identifier and variant description.
category, item_typeFree-form category/type such as physical, digital or service.
position, seller_idDisplay order and marketplace seller reference.
staff_note, metadataNote and provider JSON; the note can be returned to customers.
total_discount, total_tax, tax_ratePer-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.

json
{
  "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_paid and total_refunded rather than blindly replacing unchanged data.
  • Customer order history: list the authenticated customer's transactions through the SDK API, for example sorted by placed_at descending. The response includes line items and addresses, so a detail screen can often reuse that record. Handle pagination, filtering and 404 as 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.

Was this page helpful?