- Buyer perspective
Adding line items
Viewing my orders
If you do not remember your order ID, buyer users can view their orders using the My Orders resource. This returns a list of orders where the currently authenticated user is the FromUser.
Creating a line item
Now that you can browse products available to your buyer user and know the direction and ID of the order you are working with, you can add a line item to the order.
See OrderCloud Line items for more information.
The response looks like this:
Line item response model
Like the buyer product model, the line item includes a sub-object for the Product attached to it. This is not a buyer product with a full price schedule. Pricing information appears at the root of the line item model.
Note: Because a
Quantityof two was added, the API automatically calculatesUnitPrice,LineTotal, andLineSubtotal.
Use these line item properties to display cost in a shopping cart because the price schedule is only one component in calculating the actual purchase price.
If a product spec for "shirt size" incurs a price markup of $2.00, the new unit price would be $12.00.
If any applicable line item promotions exist, PromotionDiscount and LineSubtotal might be affected. For example, if a BOGO offer is applied to the product, the second unit would be free, bringing the subtotal back down to $10.00.
See Line item-level promotions for more information.
Retrieve the order
After adding a line item, retrieve the order again to see how it has changed. Use the example at the top of this guide. The response now looks like this:
The order's LineItemCount, Subtotal, and Total have changed.