Ordering for AI agents

AI assistants and agents are welcome to browse One Stop Wedding Supplies and place orders for the people they help. You use the same public API as our website, with the same prices, stock and limits. There is no sign-up and no API key.

API base: https://osws-backend.onestopweddingssupplies.com · Full description: openapi.json · Catalog: products.json

0Identify yourself

Send X-Agent-Name: YourAssistant/1.0 on every request. Orders you place are marked as placed by an agent, so our team knows how they came in. The store can pause agent orders; you then get a 403 with a message you can show the person. GET /api/checkout/status says whether the store is taking orders.

1Find products

Read the feed (refreshed every 5 minutes). Each product has its id, price in rupees and, for products with quality options, an options list with each option's id and price. Only offer products whose availability is in_stock.

curl https://osws-backend.onestopweddingssupplies.com/api/feed/products.json -H "X-Agent-Name: YourAssistant/1.0"

2Start a cart

Keep cart.session_token. It is the only key to this cart, so don't share it.

curl -X POST https://osws-backend.onestopweddingssupplies.com/api/cart -H "X-Agent-Name: YourAssistant/1.0"

3Add items

Use the option's id as variantId (leave it out for products without options). At most 10 of any one item; for larger quantities send the person to our Bulk Orders form.

curl -X POST https://osws-backend.onestopweddingssupplies.com/api/cart/SESSION_TOKEN/items \
  -H "Content-Type: application/json" -H "X-Agent-Name: YourAssistant/1.0" \
  -d '{"productId":"PRODUCT_ID","variantId":"OPTION_ID","qty":2}'

4Say who is buying

The buyer's name and 10-digit Indian mobile number, exactly as they gave them to you for this order. The phone number is how they track the order later.

curl -X POST https://osws-backend.onestopweddingssupplies.com/api/cart/SESSION_TOKEN/identify \
  -H "Content-Type: application/json" -H "X-Agent-Name: YourAssistant/1.0" \
  -d '{"name":"Asha Patel","phone":"9876543210"}'

5Check delivery and its cost

Delivery is calculated from the pincode and is never free. There is no separate Cash on Delivery fee, but the delivery charge can differ between COD and online payment, so quote with the method the person will use. codAvailable says whether Cash on Delivery can be used for this pincode.

curl -X POST https://osws-backend.onestopweddingssupplies.com/api/shipping/quote \
  -H "Content-Type: application/json" -H "X-Agent-Name: YourAssistant/1.0" \
  -d '{"sessionToken":"SESSION_TOKEN","pincode":"400001","paymentMethod":"upi"}'

6Place the order

Confirm the items, delivery charge and total with the person first. Prices and delivery are always taken from our server, never from your request.

curl -X POST https://osws-backend.onestopweddingssupplies.com/api/checkout/order \
  -H "Content-Type: application/json" -H "X-Agent-Name: YourAssistant/1.0" \
  -d '{"sessionToken":"SESSION_TOKEN","paymentMethod":"upi",
       "shippingAddress":{"name":"Asha Patel","phone":"9876543210","line1":"12 Marine Lines",
       "city":"Mumbai","state":"Maharashtra","pincode":"400001"}}'

7Follow the order

While an online payment is open, GET /api/checkout/pay/PAY_TOKEN (the t value in payUrl) gives its state: payable, paid, expired or cancelled. Check at most every 10 seconds. After that, track the order with its number and the buyer's phone.

curl -X POST https://osws-backend.onestopweddingssupplies.com/api/track-order \
  -H "Content-Type: application/json" -H "X-Agent-Name: YourAssistant/1.0" \
  -d '{"orderNumber":"ORDER_NUMBER","phone":"9876543210"}'

Limits

Limits are per IP address, per hour. Going over one returns 429: wait, don't retry in a loop.

Errors are always {"error":{"message":"…","status":…}}. The message is written for people, so you can pass it on.

Questions: contact us. Shop as a person: onestopweddingssupplies.com.