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
totalPrice
number

The total price of the order in the currency's minor units, e.g., pence or cents.

Minimum0
Example2200
subtotalPrice
number

The price of order items after the subtotal discount is applied, excluding delivery, in the currency's minor units.

Minimum0
Example1900
deliveryPrice
number

The delivery price of the order in the currency's minor units, e.g., pence or cents.

Minimum0
Example300
totalDiscount
number

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

Minimum0
Example100
subtotalDiscount
number

The discount applied to the subtotal in the currency's minor units, excluding delivery.

Minimum0
Example100
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
formattedTotalPrice
string

The formatted price of the order with the currency symbol provided.

Example£22.00
formattedTotalDiscount
string

The formatted total discount with the currency symbol provided.

Example£1.00
formattedSubtotalDiscount
string

The formatted discount applied to the subtotal with the currency symbol provided.

Example£1.00
formattedSubtotalPrice
string

The formatted price of order items after the discount is applied, excluding delivery.

Example£19.00
formattedDeliveryPrice
string

The formatted delivery price with the currency symbol provided.

Example£3.00
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