Optimizely Carts API
The Carts API from Optimizely — 8 operation(s) for carts.
Operations 18
Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay
GET
/api/v1/carts/{cartId}/promotions
List promotions applied to a cart · Promotions V1 get collection async
#
Ask an LLM
“Which promotions are currently applied to a shopper's cart?”
“Can I see every promo code that has been used on a cart?”
Tell an agent
List the promotions applied to cart {cartId}.
Show all promo codes on cart {cartId}.
POST
/api/v1/carts/{cartId}/promotions
Apply a promotion code to a cart · Promotions V1 post async
#
Ask an LLM
“How do I apply a promo code to a customer's cart?”
“What happens when I add a promotion code that doesn't qualify for the cart?”
Tell an agent
Apply promo code {promotionCode} to cart {cartId}.
Add promotion code {promotionCode} to cart {cartId} for order line {orderLineId}.
DELETE
/api/v1/carts/{cartId}/promotions
Remove all promotions from a cart · Promotions V1 delete collection async
#
Ask an LLM
“How do I strip every promo code off a cart at once?”
“Can I clear all applied promotions from a cart in one call?”
Tell an agent destructive · confirm first
Remove all promotions from cart {cartId}.
Clear every applied promo code on cart {cartId}.
GET
/api/v1/carts/{cartId}/promotions/{promotionId}
Get one promotion applied to a cart · Promotions V1 get async
#
Ask an LLM
“What discount amount did a specific promotion give on a cart?”
“Can I look up a single promotion that was applied to a cart?”
Tell an agent
Get promotion {promotionId} on cart {cartId}.
Show how much promotion {promotionId} took off cart {cartId}.
DELETE
/api/v1/carts/{cartId}/promotions/{promotionId}
Remove one promotion from a cart · Promotions V1 delete async
#
Ask an LLM
“How do I remove just one promo code from a cart and keep the others?”
“Can a single applied promotion be taken off a shopper's cart?”
Tell an agent destructive · confirm first
Remove promotion {promotionId} from cart {cartId}.
Take promo {promotionId} off cart {cartId} but leave the other promotions.
Ask an LLM
“How do I find all carts for a particular bill-to account?”
“Can I filter carts by status and date range?”
Tell an agent
List carts with status {status}.
Show carts for bill-to {billToId} created between {fromDate} and {toDate}.
Ask an LLM
“How do I start a new cart for a customer's bill-to and ship-to addresses?”
“Can I create a cart tied to a VMI location?”
Tell an agent
Create a new cart for bill-to {billToId} and ship-to {shipToId}.
Start a cart for VMI location {vmiLocationId} with notes {notes}.
Ask an LLM
“What's the grand total, tax and shipping on a specific cart?”
“Can I check whether a cart is ready to check out?”
Tell an agent
Get cart {cartId}.
Show the totals and status of cart {cartId}.
Ask an LLM
“How do I throw away an entire cart?”
“Can I delete a saved cart that's no longer needed?”
Tell an agent destructive · confirm first
Delete cart {cartId}.
Discard cart {cartId} entirely.
Ask an LLM
“How do I set the PO number and shipping method on a cart?”
“Can I submit a cart by changing its status?”
Tell an agent
Set PO number {poNumber} on cart {cartId}.
Change the status of cart {cartId} to {status}.
GET
/api/v1/carts/{cartId}/cartlines
List the line items in a cart · Cart lines V1 get collection async
#
Ask an LLM
“What products are in a customer's cart right now?”
“Can I page through the line items of a large cart?”
Tell an agent
List the lines in cart {cartId}.
Show page {page} of cart {cartId} line items.
Ask an LLM
“How do I add a product with a quantity to a cart?”
“Can I add an item to a cart with a line note?”
Tell an agent
Add {qtyOrdered} of product {productId} to cart {cartId}.
Put product {productId} in cart {cartId} with quantity {qtyOrdered} and note {notes}.
DELETE
/api/v1/carts/{cartId}/cartlines
Empty all lines from a cart · Cart lines V1 delete cart lines async
#
Ask an LLM
“How do I empty a cart without deleting the cart itself?”
“Can I remove every line item from a cart at once?”
Tell an agent destructive · confirm first
Empty all line items from cart {cartId}.
Remove every product line from cart {cartId} but keep the cart.
GET
/api/v1/carts/{cartId}/cartlines/{cartLineId}
Get one line item in a cart · Cart lines V1 get async
#
Ask an LLM
“What price and availability does one cart line show?”
“Can I look up a single line item in a cart?”
Tell an agent
Get line {cartLineId} in cart {cartId}.
Show pricing for cart line {cartLineId} of cart {cartId}.
DELETE
/api/v1/carts/{cartId}/cartlines/{cartLineId}
Remove one line item from a cart · Cart lines V1 delete async
#
Ask an LLM
“How do I remove one product from a cart?”
“Can I delete a single cart line and leave the rest?”
Tell an agent destructive · confirm first
Remove line {cartLineId} from cart {cartId}.
Delete cart line {cartLineId} in cart {cartId}.
PATCH
/api/v1/carts/{cartId}/cartlines/{cartLineId}
Change quantity or notes on a cart line · Cart lines V1 patch async
#
Ask an LLM
“How do I change the quantity of an item already in the cart?”
“Can I update the note or cost code on an existing cart line?”
Tell an agent
Change cart line {cartLineId} in cart {cartId} to quantity {qtyOrdered}.
Set the cost code on existing line {cartLineId} of cart {cartId} to {costCode}.
POST
/api/v1/carts/{cartId}/cartlines/batch
Add several products to a cart at once · Cart lines V1 post collection async
#
Ask an LLM
“How do I bulk add many products to a cart in a single request?”
“What tells me if not every item in a batch made it into the cart?”
Tell an agent
Batch add these lines {cartLines} to cart {cartId}.
Add multiple products {cartLines} to cart {cartId} in one request.
POST
/api/v1/carts/{cartId}/cartlines/wishlist/{wishListId}
Add a wish list's items to a cart · Cart lines V1 post wish list async
#
Ask an LLM
“How do I move everything from a wish list into a cart?”
“Can a shared list's items be added to the cart in one step?”
Tell an agent
Add all items from wish list {wishListId} to cart {cartId}.
Copy wish list {wishListId} into cart {cartId}.