Request:
curl --request POST \\
--url API_URL/api/orders/calculate/ \\
--header 'Accept: application/json' \\
--header 'Content-Type: application/json' \\
--header 'X-API-Key: {Client API Key}'
--data \\
{
"details":[{"product":INT,"quantity":INT} ...], REQUIRED
"store": 1, OPTIONAL // To be picked up at Vitau's store.
"zipcode": STRING, OPTIONAL // To be delivered to this zip code.
"coupon": STRING, OPTIONAL // Coupon code
"shipping_method": INT, OPTIONAL // Selected shipping method from the valid methods for this zip code.
...
}
Response:
Status Code: 201 Created
{
"subtotal": DOUBLE,
"shipping_price": DOUBLE,
"shipping_discount": DOUBLE,
"coupon": {
"code": STRING,
"value": DOUBLE // Between 0 and 1 is a percentage, else has a fixed value.
},
"discount":DOUBLE,
"iva":DOUBLE,
"total": DOUBLE,
"shipping_method_options":
[{
"id": INT,
"company": STRING,
"method": ENUM, [STANDARD, EXPRESS, LOCAL, DEFAULT]
"min_delivery_days": INT,
"max_delivery_days": INT,
"price": DOUBLE
}..],
"selected_shipping_method": INT, // When not included in request payload defaults to cheapest default method.
"errors": OBJECT, // Key value pairs of possible errors.
"expected_delivery_date": UTC DATETIME,
"max_delivery_date": UTC DATETIME,
"details":
[{
"product": INT,
"quantity": INT,
"subtotal": DOUBLE,
"discount": DOUBLE,
"iva":DOUBLE,
"total": DOUBLE
}...],
}