Setting the price of an item
Learn how to set the price and aggregate price of items in a Checkout or Invoice.
When describing items in a Checkout or Invoice, in addition to the required skuId
parameter, you'll also need to define the price or aggregate price.
Defining a price
In a POST
Checkout or Invoice request, the price
parameter represents the price of a single line item.
For each line item in the response, the amount
returned is derived by multiplying theprice
and quantity
supplied in the request.
Defining an aggregate price
In a POST
Checkout or Invoice request, the aggregatePrice
parameter represents the total price of one or more items, regardless of the quantity
you specify.
For each line item in the response, the amount
returned is equal to the aggregatePrice
you supplied in the request.
Use cases
To better illustrate the aggregate price concept, the following examples provide use cases where the aggregatePrice
parameter could be applied.
Example one
Let's say your website offers a price break when customers buy three or more laptop computers. This entices a shopper to purchase three laptops in one order. The customer is given a discounted price of $2,000 for the total order. That discounted price represents the aggregatePrice
. The individual unit prices are now based on that aggregatePrice
. So the effective price of each individual laptop is adjusted to approximately $667.67.
Example two
The aggregatePrice
attribute can also be useful in buy one, get one (BOGO) free scenarios. You operate a grocery delivery service and your website has a BOGO offer on cases of soda. A customer purchases two cases and the offer is applied. The aggregatePrice
is the cost of the first case of soda divided by two.
Last updated