API Documentation
Integrate your custom-built store with VaanijyaSetu using our REST API. Push orders, fetch products, check stock, and track shipments — all with simple HTTP calls.
Who is this for? This API is for clients with custom-built stores (not WooCommerce or Shopify). If you use WooCommerce or Shopify, use the built-in connectors in your dashboard instead.
Overview
The VaanijyaSetu API lets your custom store:
- Fetch your product catalog with wholesale prices
- Check real-time stock levels (including per-variation)
- Push customer orders directly into VaanijyaSetu
- Track order status and shipment details
All prices returned by the API are wholesale prices based on your subscription plan. You set your own selling prices on your store — VaanijyaSetu only charges you wholesale + delivery.
Authentication
All API requests require a Bearer Token sent in the Authorization header. You can find your Bearer Token in your VaanijyaSetu dashboard under API Access.
Header
Authorization: Bearer your_bearer_token_here
Keep your token secret. Never expose it in frontend JavaScript or client-side code. Always make API calls from your server backend.
Base URL
https://vaanijyasetu.com/api
All endpoints below are relative to this base URL.
Error Handling
The API uses standard HTTP status codes. Error responses include a JSON body:
| Code | Meaning |
200 | Success |
201 | Created (order placed successfully) |
401 | Unauthorized — invalid or missing token |
403 | Forbidden — no active subscription or domain mismatch |
404 | Not found — product/order doesn't exist |
409 | Conflict — duplicate order (same store_order_id) |
422 | Validation error — missing or invalid fields |
List All Products
GET
/api/products
Returns all active products with wholesale prices for your plan.
Example Request
cURL
curl -X GET https://vaanijyasetu.com/api/products \
-H "Authorization: Bearer your_token"
Example Response
JSON
{
"status": true,
"total": 42,
"data": [
{
"id": 1,
"sku": "BLV-NEW-L8MW",
"name": "New Child Cap",
"description": "...",
"category": "Kids Wear",
"stock_qty": 150,
"images": ["https://..."],
"pricing": {
"wholesale_price": 80.00,
"currency": "INR"
}
}
]
}
Get Single Product
GET
/api/products/{sku}
Returns full details for a single product, including variations and delivery charge.
Example Response
JSON
{
"success": true,
"data": {
"sku": "BLV-WOM-OM20",
"name": "Women's Blue Shoes",
"stock_qty": 63,
"has_variations": true,
"variations": [
{ "name": "Color", "values": ["red", "green", "orange"] },
{ "name": "Size", "values": ["7", "8", "9"] }
],
"variation_stocks": { "Color:red|Size:7": 10, "Color:red|Size:8": 15 },
"delivery_charge": 49.00,
"pricing": { "wholesale_price": 150.00 }
}
}
Check Stock
GET
/api/products/{sku}/stock
Quick stock check. Returns current quantity and per-variation breakdown.
Example Response
JSON
{
"success": true,
"sku": "BLV-WOM-OM20",
"stock_qty": 63,
"in_stock": true,
"has_variations": true,
"variation_stocks": {
"Color:red|Size:7": 10,
"Color:red|Size:8": 15,
"Color:green|Size:7": 5
}
}
Create Order
POST
/api/orders
Push a customer order from your store into VaanijyaSetu. You only send SKU + quantity — we calculate the wholesale cost automatically.
Tamper-proof pricing. You never send prices. The API looks up wholesale prices server-side based on your plan. The order total is always: wholesale price × quantity + delivery charge.
Request Body
| Field | Type | Required | Description |
customer.name | string | Yes | Customer full name |
customer.phone | string | Yes | Customer phone number |
customer.email | string | No | Customer email |
shipping.address | string | Yes | Full street address |
shipping.city | string | Yes | City name |
shipping.state | string | Yes | State name |
shipping.pincode | string | Yes | PIN code |
shipping.country | string | No | Default: India |
items[].sku | string | Yes | Product SKU (e.g. BLV-NEW-L8MW) |
items[].quantity | integer | Yes | Quantity ordered |
items[].variation | string | No | Variation info (e.g. "red / 7") |
store_order_id | string | No | Your store's order ID (for duplicate prevention) |
notes | string | No | Special instructions |
Example Request
cURL
curl -X POST https://vaanijyasetu.com/api/orders \
-H "Authorization: Bearer your_token" \
-H "Content-Type: application/json" \
-d '{
"customer": {
"name": "Rahul Sharma",
"phone": "9876543210",
"email": "rahul@gmail.com"
},
"shipping": {
"address": "123 MG Road, Near City Mall",
"city": "Mumbai",
"state": "Maharashtra",
"pincode": "400001"
},
"items": [
{ "sku": "BLV-NEW-L8MW", "quantity": 2 },
{ "sku": "BLV-WOM-OM20", "quantity": 1, "variation": "red / 7" }
],
"store_order_id": "MYSTORE-1234"
}'
Example Response
JSON — 201 Created
{
"success": true,
"order_number": "API-A1B2C3D4E5F6",
"subtotal": 310.00,
"delivery": 49.00,
"total": 359.00,
"items_count": 2,
"status": "awaiting_payment",
"message": "Order created. Please pay via the VaanijyaSetu dashboard."
}
After creating an order: The client logs into VaanijyaSetu, reviews the order, and pays via wallet or Razorpay. Once paid, VaanijyaSetu ships directly to the customer.
Check Order Status
GET
/api/orders/{order_number}/status
Get the current status, items, and shipment tracking for an order. You can use either the VaanijyaSetu order number or your store_order_id.
Example Response
JSON
{
"success": true,
"order_number": "API-A1B2C3D4E5F6",
"store_order_id": "MYSTORE-1234",
"status": "shipped",
"payment_status": "paid",
"total_amount": 359.00,
"tracking": {
"courier": "Delhivery",
"tracking_number": "DL1234567890",
"tracking_url": "https://www.delhivery.com/track/...",
"shipped_at": "2026-04-18T10:30:00Z"
},
"timeline": [
{ "status": "awaiting_payment", "changed_at": "..." },
{ "status": "pending", "changed_at": "..." },
{ "status": "shipped", "changed_at": "..." }
]
}
Integration Flow
Here's the recommended integration flow for custom stores:
- Setup: Register on VaanijyaSetu, subscribe to a plan, get your API credentials from the API Access page
- Sync catalog: Call
GET /api/products to fetch products. Display them on your store with your own selling prices
- Stock check: Before order placement, call
GET /api/products/{sku}/stock to verify availability
- Push orders: When a customer orders on your store, call
POST /api/orders with customer details and SKUs
- Payment: Log into VaanijyaSetu dashboard and pay for the order using wallet or Razorpay
- Track shipment: Poll
GET /api/orders/{id}/status to get tracking info and update your customer
Periodic stock sync: We recommend calling the stock check endpoint every 15-30 minutes via a cron job to keep your store's stock levels accurate. This prevents overselling.
Webhooks (Optional)
Currently, order status updates are available via polling the status endpoint. If you need real-time webhook notifications for order status changes (shipped, delivered, etc.), contact us at admin@vaanijyasetu.com to discuss a custom integration.