younifyd
Menu

Record Purchase

Log a completed order's line items — fire-and-forget

Use it in a workflow

  1. Add a step and choose the Recommendations connector.
  2. Pick the Record Purchase action (under database).
  3. Fill in the fields below, then reference the result from later steps as {{recordPurchase.response.data}}.

Fields

orderIdstringrequired

Groups this order's items together.

itemsstringrequired

Every item in this order, as a JSON array of {itemKey, quantity, price, attributes}, or a comma-separated list of item keys — one item is still a one-entry list. attributes is a JSON object of facets for that item, e.g. {"category":"snowboards"}, which lets trending scope by that facet later.

customerIdstring

Optional — leave empty for a guest checkout.

currencystring

Only meaningful when a price is set.

Examples

One item

A single-item order still goes in as a one-entry list

json
{
  "orderId": "ORD-00001",
  "items": "[{\"itemKey\":\"SNOWBOARD-POWDER\",\"quantity\":1}]"
}

Whole order at once

Every line item in one call

json
{
  "orderId": "ORD-00001",
  "items": "[{\"itemKey\":\"SNOWBOARD-POWDER\",\"quantity\":1},{\"itemKey\":\"BINDING-STRAP\",\"quantity\":1}]"
}

Need more? See the Recommendations guide for connection setup and behaviour shared by every action.