Audience: All users (Merchants, Developers, Testers)
Environment: Sandbox / Production
If you run an ecommerce shop, chances are you want your customer to be able to see their bought items on the checkout page, before or during the payment. Helix-Pay allows you to do that easily.
- Use the
POST /paymentsendpoint as usual - Send a
line_itemsproperty as part of themetadatafield in the request body
{
"amount": 2498,
"currency": "EUR",
"description": "Order #12111",
"metadata": {
"line_items": [
{
"name": "Red T-shirt",
"price": 999,
"quantity": 1,
"description": "A basic cotton T-shirt"
},
{
"name": "Cargo Pants",
"price": 1499,
"quantity": 2,
"description": "Some nice cargo pants"
}
]
}
}Here is the definition of a line item. It is written as a Typescript interface, but it can be adapted to any programming language.
interface LineItem {
name: string;
price: number; // needs to be in the lowest denomination, same as the `amount` field
quantity: number;
description?: string; // optional
}Once you create a payment that has line items, you will see them in two places:
- In the Helix-Pay portal, as part of the corresponding payment details page
- On the Helix-Pay checkout page