addArticle

Purpose:

Used to create an item for the goodsList.

Return value:

An array containing information about the specified item. Used in the goodsList array for the addTransaction, reserveAmount and activateReservation function.

or

Throws an exception with error code and error message.

Code examples

Please note that you can find more code examples in our API-files which you will find under Download API in the left menu.

Input data:

Variable Type Description
Required qtyintegerQuantity of the articles
Required
if title is
not used
artnostringArticle number
Required
if artno is not used
titlestringArticle title
Required pricefloat/doubleThe articles price, excluding VAT, ex. 9.95(€) or 12O(SEK). We recommend always to send in the price incl VAT by using the flag KRED_INC_VAT (value: 32).

Please note!
With KRED_PRINT the price is calculated per qty unit i.e. per 1/1000, 1/100 or 1/10 of the goods.

This is useful for goods measured in meters or kilograms, rather than number of items.
Required vatinteger/floatVAT in percent
discountinteger/floatDiscount in percent

Please note!
You cannot set discounts on a fee (see flag 8 or 16)
flagsintegerKRED_PRINT_1000 (value: 1) – qty measured in 1/1000s.

KRED_PRINT_100 (value: 2) – qty measured in 1/100s.

KRED_PRINT_10 (value: 4) – qty measured in 1/10s.

KRED_IS_SHIPMENT (value: 8) – Indicates that the item is a shipment fee.

KRED_IS_HANDLING (value: 16) – Indicates that the item is a handling fee.

KRED_INC_VAT (value: 32) – Send the prices including VAT