Basket Management

You can set the basket items using secupayCheckout.setBasket(items). The parameter items is an array of JavaScript objects, each element representing a basket item.

Example with all parameters:

JavaScript
secupayCheckout.setBasket([
{
id: 1,
quantity: 1,
name: "ACME ball pen Modern Line 8050",
articleNumber: "ACM/BPMOD-8050",
ean: "4001234567893",
price: 1595,
tax: 19
},
{
id: 2,
quantity: 1,
name: "ACME pen case Modern Line",
articleNumber: "ACM/CASMOD",
ean: "4002345678907",
price: 1795,
tax: 19
}
]);

Each item is a JavaScript object, and needs to have these properties:

  • quantity;

  • article name;

  • gross unit price;

  • VAT rate.

The gross unit prices in our example are €15.95 and €17.95. The gross unit price is the price for one unit, including the value added tax (VAT).

Monetary amounts are expressed in the smallest currency unit (e. g. Euro Cent).

You can also pass:

  • your article number, or storage keeping unit (SKU);

  • the official EAN (or GTIN) of this product.

Detailed description of the objects for the basket items:

Attribute

Type

Description

id

bigint

Optional. Item ID to manage the item later.

quantity

bigint

The amount as integer.

articleNumber

string

Optional. Your internal article number, or storage keeping unit (SKU).

ean

string

Optional. The official EAN or GTIN of this product.

If your product has no EAN or GTIN, please omit this attribute. It might conflict with real GTINs that need to be evaluated by use. We need to evaluate EANs when you start a loyalty card programme to detect loyalty cards, or articles with special tax handling. We also need to evaluate EANs when you start to sell e-goods, phone charge for example.

name

string

The article name.

price

bigint

The gross unit price in the smallest currency unit (e. g. Euro Cent), and including the value-added tax (VAT).

If you pass a value of 1595 for a order in Euro, this means €15.95.

tax

bigint

The value-added tax (VAT) rate in percent.

If you pass a value of 19, this means a VAT rate of 19%.