Skip to content

Line Items, Tax & Order Details

When you create a checkout session, you can pass full itemized details. Genius Checkout uses them in four places:

  1. The checkout page (so the customer sees what they're paying for)
  2. The success page and downloadable receipt
  3. The payment gateway (PowerTranz TaxAmount field, etc.)
  4. Webhook payloads (so your backend can match on metadata.order_id, etc.)

Example

json
{
  "line_items": [
    { "name": "Island Rum Cake", "quantity": 2, "unit_amount": 2500, "description": "750g" },
    { "name": "Shipping", "quantity": 1, "unit_amount": 1500 }
  ],
  "subtotal": 6500,
  "tax_name": "GCT",
  "tax_rate": 0.15,
  "tax_amount": 975,
  "amount": 7475
}

Field reference

FieldTypeDescription
line_items[].namestringItem name shown on checkout and receipt
line_items[].quantityintegerHow many
line_items[].unit_amountintegerPer-unit price in the smallest currency unit (cents)
line_items[].descriptionstringOptional detail line under the item name
subtotalintegerSum of line items before tax (cents)
tax_namestringLabel like GCT, VAT, Sales Tax
tax_ratenumberDecimal (0.15 = 15%) — used for display
tax_amountintegerPre-computed tax in cents — what's actually charged
amountintegerTotal charged (cents). Should equal subtotal + tax_amount.

Validation

amount is the source of truth for the charge. subtotal + tax_amount is shown to the customer. If they don't match exactly, the customer sees the breakdown but is charged amount — keep them consistent unless you have a reason not to.

Common patterns

No tax

Omit tax_name, tax_rate, tax_amount. amount should equal subtotal.

Tax included in price

Some Caribbean jurisdictions include VAT in the displayed price. Set tax_name and tax_amount to communicate the embedded tax to the gateway, but compute amount to match the price the customer expects.

Subscription with one-off setup fee

Pass two line items — Setup fee and First month subscription. The token created from the charge can be used for renewals at just the recurring amount. See Tokenization.

Released under the proprietary Genius Checkout license.