Predict the order price

Prev Next
Post
/pricing/v2/predict-order-price

Given a request, return the expected price based on the pricing engine and order data. No subscription contract is necessary.

Security
HTTP
Type bearer
Header parameters
Authorization
stringRequired
Body parameters
Expand All
object
pricingCalculator
object Required
engine
string Required

The pricing calculator engine to use.

Valid values[ "\"mealkit\"" ]
Examplemealkit
configuration
object Required

Configuration for the pricing calculator.

Example{ "basePrice": 1.5 }
order
object Required
lineItems
Array of object Required

Line items associated with the order.

object
id
string Required

The ID for this resource

Min length1
type
string Required

The type of the resource

Valid values[ "\"PRODUCT\"" ]
ExamplePRODUCT
quantity
integer Required

Quantity of the product in the order.

Minimum1
meta
object

Additional information about the product.

metadata
object

Additional metadata about the order.

discount
object

Discount to apply to the order.

code
string Required
deliveryPrice
object

The delivery price of the order. Defaults to zero if not provided.

Example{ "type": "FIXED", "amount": 3.0 }
type
string Required
Valid values[ "\"FIXED\"" ]
amount
number Required
Responses
200

Price of the provided order

Expand All
object
data
object
currencyCode
string

The currency to price the order in. The currency code should be provided in the 3 letter (ISO 4217 standard)[https://www.iso.org/iso-4217-currency-codes.html].

ExampleGBP
subtotal
integer

The price of all the line items on an order, calculated by the pricing calculator, before discounts are applied, in the currency's minor units e.g. pence or cents.

Minimum0
Example1500
formattedSubtotal
string

The subtotal formatted using the currencyCode.

Example£15.00
subtotalDiscount
integer

The discount applied to the subtotal, in the currency's minor units e.g. pence or cents.

Minimum0
Example150
formattedSubtotalDiscount
string

The subtotalDiscount formatted using the currencyCode.

Example£1.50
subtotalPrice
integer

The subtotal, after discounts have been applied, in the currency's minor units e.g. pence or cents.

Minimum0
Example1350
formattedSubtotalPrice
string

The subtotalPrice formatted using the currencyCode.

Example£13.50
delivery
integer

The fee for delivering the order, before discounts are applied, in the currency's minor units e.g. pence or cents.

Minimum0
Example399
formattedDelivery
string

The delivery formatted using the currencyCode.

Example£3.99
deliveryDiscount
integer

The discount applied to the delivery, in the currency's minor units e.g. pence or cents.

Minimum0
Example100
formattedDeliveryDiscount
string

The deliveryDiscount formatted using the currencyCode.

Example£1.00
deliveryPrice
integer

The deliveryPrice, after discounts have been applied, in the currency's minor units e.g. pence or cents.

Minimum0
Example299
formattedDeliveryPrice
string

The delivery price formatted using the currencyCode.

Example£2.99
grossTotal
integer

The gross total of the order, subtotal + delivery, before discounts are applied, in the currency's minor units e.g. pence or cents.

Minimum0
Example1899
formattedGrossTotal
string

The grossTotal formatted using the currencyCode.

Example£18.99
totalDiscount
integer

The total discount applied to the order, subtotalDiscount + deliveryDiscount, in the currency's minor units e.g. pence or cents.

Minimum0
Example250
formattedTotalDiscount
string

The totalDiscount formatted using the currencyCode.

Example£2.50
totalPrice
integer

The total price of the order including discounts, grossTotal - totalDiscount, in the currency's minor units e.g. pence or cents.

Minimum0
Example1649
formattedTotalPrice
string

The totalPrice formatted using the currencyCode.

Example£16.49
400

Invalid Request

Expand All
object
errors
Array of object
object
status
number
title
string

Human-readable title for the error

description
string

Human-readable description for the error

401

Invalid Authentication Credentials

Expand All
object
errors
Array of object
object
status
number
title
string

Human-readable title for the error

description
string

Human-readable description for the error

403

Invalid Authorization Credentials

Expand All
object
errors
Array of object
object
status
number
title
string

Human-readable title for the error

description
string

Human-readable description for the error

404

Resource Not Found

Expand All
object
errors
Array of object
object
status
number
title
string

Human-readable title for the error

description
string

Human-readable description for the error

500

Internal Server Error

Expand All
object
errors
Array of object
object
status
number
title
string

Human-readable title for the error

description
string

Human-readable description for the error