Calculate price for the given details

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

Given an order object, returns the price for that order.

Takes the subscription into account and uses the calculator defined in the subscription contract. This allows a merchant to define custom pricing strategies.

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

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
order
object Required
number
integer Required

Number of the order

Minimum1
promoCodes
Array Required

Promotion codes to apply to the order.

AnyOf
string
string
Min length1
object
object
code
string Required
Min length1
rules
Array of object Required
object

Rules to be evaluated against the given promo code. A promo code is applied when all conditions across all rules are met.

conditions
Array of object Required
object

Conditions that define when the rule is applied or not.

type
string Required
Valid values[ "ORDER_NUMBER_AFTER_APPLIED", "SUBSCRIPTION_CONTRACT_ORDER_NUMBER" ]
value
number Required
Minimum0
effect
object Required

Effect that, when applied, modifies the order price by a given value.

type
string Required
Valid values[ "AMOUNT_DISCOUNT", "PERCENTAGE_DISCOUNT" ]
value
number Required
Minimum0
delivery
object Required

Delivery ordinal details of the order

previousOrder
object Required
orderOrdinal
Array of integer
integer
Minimum1
billing
object Required

A subscription type billing schedule

Example{ "frequency": { "durationUnit": "EVERY_N_ORDER", "quantity": 1.0 } }
frequency
object Required
durationUnit
string Required
Valid values[ "EVERY_N_ORDER" ]
quantity
number Required
credit
Array of object

Credits available for the order.

object
type
string Required
value
number Required
lineItems
Array of object Required

Line items associated with the order.

object
id
string Required

The ID of the product.

quantity
number Required

Quantity of the product in the order.

category
string Required

Category of the product:

  • 'subscription' - an item is added through a contract,
  • 'add-on' - an item that is charged additionally,
  • 'gift' - a free of charge item.
Valid values[ "subscription", "add-on", "gift" ]
metadata
object

Additional metadata about the order.

defaultNumberOfRecipes
number Required
defaultNumberOfPortions
number Required
calculators
object Required
delivery

A calculator configuration used to determine the delivery price of the order.

OneOf
object
object
engine
string Required
Valid values[ "fixedBasePrice" ]
configuration
object Required

Configuration containing the base price for the order.

basePrice
number Required

The base price of the item.

object
object
engine
string Required
Valid values[ "bulkDiscountedCalculator" ]
configuration
object Required

Pricing configuration that applies discounts based on bulk order thresholds.

basePrice
number Required

The base price of the item.

bulkOrderDiscountThresholds
object Required

A map of quantity thresholds to discount values (e.g., "10": "50").

property*
string additionalProperties
object
object
engine
string Required
Valid values[ "collectionVolumeDiscountCalculator" ]
configuration
object Required

Configuration containing volume discount rules across multiple product collections.

discounts
Array of object Required

List of volume-based discount rules across collections.

object

Discount applied when volume conditions across collections are met.

collectionsVolume
Array of object Required

An array of volume records for collections.

object
collectionId
string Required

The unique identifier for the collection.

volume
number Required

The total volume associated for the collection.

discount
integer Required

Discount to apply when all collection volumes are met.

Minimum0
object
object
engine
string Required
Valid values[ "productVolumeCalculator" ]
configuration
object Required

Configuration for applying filters, such as targeting specific collections.

filters
object Required
collections
Array of string Required

List of collection identifiers to which this configuration applies.

string
volumesThresholds
object Required

Mapping of volume thresholds to corresponding pricing or discount values.

property*
number | null additionalProperties
object
object
engine
string Required
Valid values[ "mealkit" ]
configuration
object Required

Meal kit pricing map with the number of recipes as keys and the number of portions as nested keys.

property*
object additionalProperties
property*
integer additionalProperties

Price for the given number of recipes and portions.

Minimum1
subtotal

A calculator configuration used to determine the subtotal price of the order.

OneOf
object
object
engine
string Required
Valid values[ "fixedBasePrice" ]
configuration
object Required

Configuration containing the base price for the order.

basePrice
number Required

The base price of the item.

object
object
engine
string Required
Valid values[ "bulkDiscountedCalculator" ]
configuration
object Required

Pricing configuration that applies discounts based on bulk order thresholds.

basePrice
number Required

The base price of the item.

bulkOrderDiscountThresholds
object Required

A map of quantity thresholds to discount values (e.g., "10": "50").

property*
string additionalProperties
object
object
engine
string Required
Valid values[ "collectionVolumeDiscountCalculator" ]
configuration
object Required

Configuration containing volume discount rules across multiple product collections.

discounts
Array of object Required

List of volume-based discount rules across collections.

object

Discount applied when volume conditions across collections are met.

collectionsVolume
Array of object Required

An array of volume records for collections.

object
collectionId
string Required

The unique identifier for the collection.

volume
number Required

The total volume associated for the collection.

discount
integer Required

Discount to apply when all collection volumes are met.

Minimum0
object
object
engine
string Required
Valid values[ "productVolumeCalculator" ]
configuration
object Required

Configuration for applying filters, such as targeting specific collections.

filters
object Required
collections
Array of string Required

List of collection identifiers to which this configuration applies.

string
volumesThresholds
object Required

Mapping of volume thresholds to corresponding pricing or discount values.

property*
number | null additionalProperties
object
object
engine
string Required
Valid values[ "mealkit" ]
configuration
object Required

Meal kit pricing map with the number of recipes as keys and the number of portions as nested keys.

property*
object additionalProperties
property*
integer additionalProperties

Price for the given number of recipes and portions.

Minimum1
Responses
200

A successful response with the final price of the order, determined by its associated subscription contract and current phase.

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
message
string
causes
Array of object
object
message
string
metadata
Array of object
object
key
string
value
401

Invalid Authentication Credentials

Expand All
object
message
string
causes
Array of object
object
message
string
metadata
Array of object
object
key
string
value
403

Invalid Authorization Credentials

Expand All
object
message
string
causes
Array of object
object
message
string
metadata
Array of object
object
key
string
value
404

Resource Not Found

Expand All
object
message
string
causes
Array of object
object
message
string
metadata
Array of object
object
key
string
value
424

Failed Dependency

Expand All
object
message
string
causes
Array of object
object
message
string
metadata
Array of object
object
key
string
value
500

Internal Server Error

Expand All
object
message
string
causes
Array of object
object
message
string
metadata
Array of object
object
key
string
value