Guides

Line Items

Line Items  API  are used to communicate the details of a purchase to a patron.

Restrictions

  1. The price of a Line Item MUST represent the amount that a patron will pay for that Line Item, including tax and any discounts applied (e.g. price = product price * qty - discounts + tax).
Example
[
  {
    "name": "Cinema Tickets",
    "sku": "123456789",
    "qty": "2",
    "price": "3600", // 2 x $20 + $6 (15% tax) - $10 (discount)
    "tax": "15.0",
    "discount": "1000" // $10
  }
]
  1. The price for each Line Item MUST be provided in cents.
  2. The total for all Line Item prices MUST sum to the Payment Request  API  amount.
  3. The currency for each Line Item MUST be consistent with the Payment Request value.
  4. The discount for each Line Item MUST be provided in cents and is tax exclusive.
  5. A discount that applies to multiple line items may be represented as a separate line item with a negative amount.
Example
[
  {
    "name": "Cinema Tickets",
    "sku": "123456789",
    "qty": "2",
    "price": "4600" // 2 x $20 + $6 (15% tax),
    "tax": "15.0"
  },
  {
    "name": "Popcorn",
    "sku": "987654321",
    "qty": "1",
    "price": "1150", // $10 popcorn + $1.50 (15% tax)
    "tax": "15.0"
  },
  {
    "name": "Combo Discount",
    "sku": "123456789",
    "qty": "1",
    "price": "-1500", // $15 (discount)
    "tax": "15.0"
  }
]

Determining Paid For Line Items

Payments via Centrapay can be made against specific line items. This can happen because a user has specifically requested the line items they wish an asset to pay for, or because they were using an asset that can only be redeemed for a specific product, like a Centrapay Token. It’s important to communicate to the merchant which line items have been purchased via Centrapay so they are able to make educated decisions when refunding transactions or completing partial payments. This information should also be displayed to a consumer when possible. If any line items were purchased by a specific asset, they will be returned on a Payment Request  API  inside the Asset Totals  API  array. Integrators must iterate through the assetTotals array and display any line items purchased to the merchant. Line items that have been purchased via Centrapay must no longer be able to be purchased using another form of payment. This is especially important for any assets which are only redeemable against specific line items. For example, there could be a case where someone used a digital token to pay for a line item, and then a physical voucher to pay for that same line item, which would mean the second voucher could go towards purchasing something other than the intended line item.

Example
  {
    "type": "centrapay.token.main",
    "description": "Centrapay Token",
    "settlementDate": "2021-06-28T04:04:27.426Z",
    "total": {
      "amount": "450",
      "currency": "NZD"
    },
    "lineItems": [
      {
        "name": "Coffee Grounds",
        "sku": "GH1234",
        "qty": "1",
        "price": "450",
        "tax": "15.00"
      }
    ]
  }