List the items in the HP cart
Automatically list the items in the HP cart on hp.com. List the items in the HP US store (hp.com/us-en/shop) cart of this browser, as the site holds it: for each line its line id, product id (the HP part number), offer id (always null), name, seller (always HP), quantity, unit price and line price in US dollars, plus the number of items and the products total, before tax and shipping. The cart is the guest cart of the browser, so no sign-in is needed. An empty cart returns an empty list and a zero count.
Inputs
None
Output
count requiredNumber of units in the cart, all lines together.
lines requiredtotal requiredTotal of the products in US dollars, before tax and shipping.
FAQ
Remove a product from the HP cart
Remove a line from the HP US store (hp.com/us-en/shop) cart of this browser, by its line id or by the product's HP part number (from List the items in the HP cart), and return the whole cart afterwards with removed true. A product that is not in the cart is not an error: nothing changes and removed is false. Works as a guest, with no account. Nothing is paid or ordered.
Add a product to the HP cart
Add a fixed HP model (product class STO) of the HP US store (hp.com/us-en/shop) to the cart of this browser, by its link or HP part number, with a quantity from 1 to 10, and return the whole cart afterwards: each line with its line id, product id (the HP part number), offer id (always null), name, seller (always HP), quantity, unit price and line price in US dollars, plus the item count and the products total before tax and shipping. Works as a guest, with no account: lines already in the cart stay and are listed too. Nothing is paid or ordered. A customizable model (CTO), an out of stock product, an unknown part number and a link that is not an HP product page fail with an error that says so.
Get an HP product
Get one product of the HP US store (hp.com/us-en/shop) by its link or its HP part number: name, brand, price after instant savings, list price (MSRP), the savings text, currency, availability, product class (STO for a fixed model, CTO for a model you customize), GTIN, rating, review count, category path and images. An unknown part number or a link that HP answers with another page fails with an error that says so; find the product with Search HP products.
