Sendery
Sendery

Guides

Order confirmations and line items

Send order details and totals in a template with a Line Items block.

Configure the block

Publish an order-confirmation template. Set the Line Items block’s items variable to items and adjustments variable to adjustments. Set the subtotal text to {{ subtotal }} and total text to {{ total }}. Add {{ order_number }} to the subject or text if needed.

Send the rows

Send this JSON to POST /api/v1/emails. Item fields are fixed: name, quantity, and amount. Adjustment fields are label and amount. You can rename the two array variables in the editor, but not these row fields.

JSON
{
  "to": "[email protected]",
  "template": "order-confirmation",
  "data": {
    "order_number": "1042",
    "items": [
      {
        "name": "Notebook",
        "quantity": 2,
        "amount": "$24.00"
      }
    ],
    "adjustments": [
      {
        "label": "Tax",
        "amount": "$2.40"
      }
    ],
    "subtotal": "$24.00",
    "total": "$26.40"
  }
}

Limits and amounts

Supply 1–100 item rows and 0–20 adjustment rows. All row fields are required and accept scalar values of up to 2,000 bytes. If an adjustments variable is configured but there are no adjustments, pass []. Calculate totals and format currencies in your application; Sendery displays the supplied values.