Shopping cart object
The shopping cart object lets you optionally submit a set of properties in Create hosted checkout call to display extra information on MyCheckout hosted payment pages. This object is located under order.shoppingCart.
Basic usage
- Create an items object with an amountOfMoney and invoiceData.
- The invoiceData contains number of items, price per item and description.
- Submit the created object in the items array.
- The use of the orderLineDetails object is optional.
{
"hostedCheckoutSpecificInput": {
"variant": "264",
"locale": "en_GB"
},
"order": {
"amountOfMoney": {
"currencyCode": "EUR",
"amount": 6500
},
"customer": {
"contactDetails": {
"emailAddress": "connect@worldline.com"
},
"merchantCustomerId": "11011011",
"billingAddress": {
"countryCode": "NL"
}
},
"shoppingCart": {
"items": [
{
"amountOfMoney": {
"amount": 1500,
"currencyCode": "EUR"
},
"invoiceData": {
"nrOfItems": 1,
"pricePerItem": 1500,
"description": "Pop Band Shirt"
}
},
{
"amountOfMoney": {
"amount": 5000,
"currencyCode": "EUR"
},
"invoiceData": {
"nrOfItems": 2,
"pricePerItem": 2500,
"description": "Black Sneakers"
}
}
]
}
}
}

Additional information and non-mandatory properties you can use:
- description becomes the “Item name” displayed to the consumer.
- merchantLinenumber and merchantPagenumber are internal only and won’t be shown to the consumer.
- orderLineDetails may hold extra product/service information but is not displayed to the consumer.
| Property | Type | Required | Details |
|---|---|---|---|
| merchantLinenumber | string (5) | no | Line number for printed invoice or order of items in the cart. Should be a numeric string. |
| merchantPagenumber | string (3) | yes | Page number for printed invoice. Should be a numeric string |
| orderLineDetails | object | depends | Object containing additional information that when supplied can have a beneficial effect on the discount rates. |
The example below is used to showcase the shopping cart request snippet for the airline order with the additional properties.
{
"amountOfMoney": {
"amount": 501,
"currencyCode": "EUR"
},
"invoiceData": {
"description": "KL5630 (LAX-HNL) Flight from Los Angeles to Honolulu",
"pricePerItem": 167,
"nrOfItems": "3",
"merchantLinenumber": "3",
"merchantPagenumber": "1"
},
"orderLineDetails": {
"productCode": "KL5630",
"productName": "(LAX-HNL) Flight from Los Angeles to Honolulu",
"productPrice": 186,
"quantity": 3,
"discountAmount": 315,
"taxAmount": 258,
"lineAmountTotal": 501,
"productType": "ticket"
}
}
]
Extended usage
The basic shopping cart object can display quantities and prices, and you can also show additional details like discounts and shipping costs using the amountBreakdown array, submitted at the root of the shoppingCart object.
We offer a simplified set of amountBreakdown categories to smooth the consumer experience:
- subtotal: sum of the items in the cart
- discount: positive amounts applied as discounts
- shipping costs
- handling costs
- taxes: combined total (including AIRPORT_TAX, CONSUMPTION_TAX, DUTY, TAX, and VAT; VAT cannot be shown separately)
{
"hostedCheckoutSpecificInput": {
"variant": "264",
"locale": "en_GB"
},
"order": {
"amountOfMoney": {
"currencyCode": "EUR",
"amount": 6100
},
"customer": {
"contactDetails": {
"emailAddress": "connect@worldline.com"
},
"merchantCustomerId": "11011011",
"billingAddress": {
"countryCode": "NL"
}
},
"shoppingCart": {
"amountBreakdown": [{
"amount": 100,
"type": "HANDLING"
}, {
"amount": 500,
"type": "SHIPPING"
}, {
"amount": 1000,
"type": "DISCOUNT"
}, {
"amount": 6500,
"type": "BASE_AMOUNT"
}],
"items": [{
"amountOfMoney": {
"amount": 1500,
"currencyCode": "EUR"
},
"invoiceData": {
"nrOfItems": 1,
"pricePerItem": 1500,
"description": "Pop Band Shirt"
}
}, {
"amountOfMoney": {
"amount": 5000,
"currencyCode": "EUR"
},
"invoiceData": {
"nrOfItems": 2,
"pricePerItem": 2500,
"description": "Black Sneakers"
}
}]
}
}
}
