Prices and Quantities

Make sure you familiarize yourself with the other important concepts of our API:
Products and Articles, Sync Markers
After taking the time to understand these concepts, you will much better understand the basics of our API.

Introduction

In a nutshell, prices are transmitted in cents. That means that a price of 9.95 is transmitted as a price of 995. Quantities are transmitted as integer values, with an optional decimalPlaces property that signifies the position of the decimal point. A quantity of 1.25 is transmitted with a quantity of 125 and a decimalPlaces of 2.

See below for more examples, calculations and code samples.

Contents

Prices

Let’s take a look at the following order:

The actual price of article “Colored Tie” is 19.95. This is because the price in cents is 1995. To convert from cents to the actual price, you can divide the value by 100: 1995 / 100 = 19.95. To convert from the actual price to cents, you can multiply the value by 100: 19.95 * 100 = 1995

The actual price of article “Shipping costs” is 4.95. This is because the price in cents is 495. To convert from cents to the actual price, you can divide the value by 100: 495 / 100 = 4.95. To convert from the actual price to cents, you can multiply the value by 100: 4.95 * 100 = 495

Quantities

Let’s take a look at the following order:

The actual quantity of article “Gehakt” is 0.530. This is because the quantity is 530, but the decimalPlaces is 3.

530 can also be written as 0530.0. If you take that decimal point, and shift if 3 places to the left, as indicated by the value of decimalPlaces, you get the actual quantity: 0.530.

Here is a PHP function to convert quantity and decimalPlaces to the proper decimal value.

And here is a PHP function to convert a decimal value to its quantity and decimalPlaces values.