Skip to main content

For AI agents

An AI assistant can build a cart here through a small JSON API: find products, create a cart, add or change lines, then send the shopper one link. Opening it makes the cart theirs, and the assistant keeps editing it while they look. The shopper reviews and pays on this site. The assistant never checks out.

1. Find products

Search the catalog with a plain GET:

https://jetblanks.com/agents/catalog.json?q=gildan+heavy+cotton

The response lists up to 10 matching products. Each carries the product slug, name, brand, style number, and its colors; each color lists the sizes in stock right now, with unit count and price in USD per size. Quote from the size's own price: larger sizes often cost more. Narrow the query instead of paging, there is no page parameter.

{ "query": "gildan heavy cotton",
  "products": [ {
    "slug": "gildan-G500", "name": "Heavy Cotton T-Shirt",
    "brand": "Gildan", "style_number": "G500",
    "colors": [ {
      "slug": "black", "name": "Black",
      "sizes_in_stock": {
        "M":   { "units": 460, "price": "4.25" },
        "2XL": { "units": 97,  "price": "5.75" }
      }
    } ]
  } ] }

2. Create a cart

One POST with no body and no auth gives you an empty cart, the token that controls it, and the link you will hand the shopper at the end.

curl -X POST https://jetblanks.com/agents/cart
{ "token": "…",
  "handoff_url": "https://jetblanks.com/agent-cart?token=%E2%80%A6",
  "items": [], "item_count": 0, … }

Every cart request from here on carries the token as Authorization: Bearer <token>. It reaches only this cart, never a payment method or an address. Keep the handoff_url for step 5.

3. Read the cart

curl https://jetblanks.com/agents/cart \
  -H "Authorization: Bearer $TOKEN"

Returns the current lines (slug, color, size, quantity, unit and line price), the totals, a checkout_url where the shopper reviews and pays, and the handoff_url while the cart still has no owner.

4. Add, change, or remove lines

PUT a list of lines. Each quantity is the number you want that line to end at: a new line is added, an existing one is set to that number (up or down), and 0 removes it. One call does all three. Copy slugs, color slugs, and size codes exactly as the catalog JSON returns them.

curl -X PUT https://jetblanks.com/agents/cart \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"items":[
    {"slug":"gildan-G500","color":"black","size":"M","quantity":12},
    {"slug":"gildan-G500","color":"black","size":"L","quantity":0}
  ]}'

The response is the updated cart plus a results list saying what happened to each line: added, changed, removed, unchanged, or skipped (a colour or size the product doesn't carry). A line whose slug isn't in the catalog is left out of the cart and of the results entirely. Send at most 100 lines per call; a repeated line keeps its last quantity. Quantities cap at live stock and at 99 units per line, and a raise that stock can't fill leaves the line where it was rather than shrinking it; a cart holds up to 50 distinct lines.

5. Hand the cart to the shopper

Send the shopper the handoff_url from step 2. When they open it, the cart becomes theirs: at once if their own cart is empty, otherwise after they choose whether to add your lines to what they have or replace it. From then on your token edits the cart they see, so they can keep asking you for changes and refresh the cart page to see them. They can disconnect you from the cart at any time.

Once a signed-in shopper takes the cart, the link stops working for anyone else. Tell the shopper to open it themselves rather than forwarding it.

Good to know

A cart can total up to $1,000 before tax, and standard shipping is free from $50. Bulk discounts apply automatically in the cart, so a bigger cart usually means a lower unit price than the catalog JSON quotes. A cart nobody has taken over is cleared after 30 days without changes. Claude Cowork can call these endpoints directly; in ChatGPT Work add them as a custom connector.

Something unclear, or an endpoint misbehaving? Email us: support@jetblanks.com.