Contents
Vendre API · v1
Connect your app to your store
Create products, customers and orders in a Vendre store from your own website, mobile app or back office. Everything you create shows up in the admin straight away, with the same stock, discount and invoice rules.
Introduction
The API is JSON over HTTPS. Every request goes to one base URL, and your API key decides which store it acts on.
Base URL
https://vendre.in/api/v1- Send and receive JSON. Use
Content-Type: application/jsonon requests with a body. - Amounts are numbers in Indian rupees, e.g.
1499or24.5. - Ids are strings. Times are ISO 8601 in UTC, like
2026-11-19T10:24:00.000Z. - Successful responses wrap the result in
data; lists addpagination. - Unknown fields are rejected, so a typo in a field name is reported instead of being ignored.
Quick start
- 1
Create an API key
In your store's admin, open Settings → API keys and choose Create key. Give it a name and the permissions it needs, then copy the key. It's shown only once. Only the store owner or an admin can create keys.
- 2
Check the key works
- 3
Create your first product
Then add a customer and place an order for them. The order takes stock off, issues an invoice and appears in the admin.
Authentication
Send your key in the Authorization header of every request:
Authorization: Bearer vnd_live_…
Keep keys on your server. A key in a website's browser code or a mobile app bundle can be read by anyone, so call the API from your backend and give each app its own key. If a key leaks, revoke it in Settings → API keys; it stops working at once.
Each key has permissions per resource. Write includes read.
| Permission | Allows |
|---|---|
products:read | List and get products |
products:write | Everything in read, plus create, change and delete products |
customers:read | List and get customers |
customers:write | Everything in read, plus create, change and delete customers |
orders:read | List and get orders |
orders:write | Everything in read, plus create, change and delete orders |
Errors
Errors use standard HTTP status codes and always have the same shape. code is stable to check in your code; message is for people; fields names each field that needs fixing.
{
"error": {
"code": "validation_error",
"message": "Some fields are missing or invalid.",
"fields": {
"lines.0.quantity": "Only 3 in stock",
"phone": "Another customer already uses this mobile number."
}
}
}| Status | Code | Meaning |
|---|---|---|
| 400 | invalid_json | The body isn't valid JSON |
| 401 | missing_key · invalid_key · revoked_key | No key, a wrong key, or a revoked key |
| 403 | insufficient_scope | The key doesn't have the permission the endpoint needs |
| 404 | not_found | No such record in this store (records of other stores are never visible) |
| 409 | invalid_transition | An order can't make that status change |
| 422 | validation_error · unprocessable | A field is missing or invalid, or a business rule failed (stock, unique email…) |
| 429 | rate_limited | Too many requests; wait for Retry-After seconds |
| 500 | server_error | Something went wrong on our side; it's safe to retry |
Rate limits
Each key can make 120 requests a minute. Every response says where you stand; past the limit you get a 429 with aRetry-After header in seconds.
X-RateLimit-Limit: 120 X-RateLimit-Remaining: 117 X-RateLimit-Reset: 1795091940
Pagination
List endpoints take page (from 1) and pageSize (1–50, default 20), and return where you are. Keep requesting the next page until page reaches pageCount.
{
"data": [
"…"
],
"pagination": {
"page": 1,
"pageSize": 20,
"total": 134,
"pageCount": 7
}
}Idempotent orders
Networks drop. If a create-order request times out you can't tell whether the order was made, so send anIdempotency-Key header with a value unique to that order, such as a UUID or your own order id. If the same key arrives again, the API returns the order it already created (status 200, withIdempotency-Replayed: true) instead of making a second one. Reuse a key only to retry the same request.
Store
Check your key
/api/v1/storeAny valid keyReturns the store your API key belongs to and the permissions it has. Any valid key can call it, so it's the quickest way to confirm your setup.
Products
List products
/api/v1/productsNeeds products:readThe store's products, most recently changed first. Each item is a summary; fetch a product for its variants.
Query
page | integer | Page number, from 1 (default 1) |
pageSize | integer | Items per page, 1–50 (default 20) |
search | string | Text to search for |
status | string | draft, active or archived |
sort | string | title, createdAt or updatedAt; prefix with - for descending (default -updatedAt) |
Create a product
/api/v1/productsNeeds products:writeCreates a product. For sizes or colours, send options: a variant is created for every combination, and variants sets the price, stock and SKU of specific ones. A product without options gets a single variant from price, quantity and sku. Opening stock is recorded in the stock history.
Body
| Field | Type | Description |
|---|---|---|
titlerequired | string | Product nameUp to 150 characters |
descriptionrequired | string | HTML (p, h2-h4, strong, em, u, s, ul, ol, li, blockquote, code, pre, a) or plain text, which becomes paragraphs. Other tags are removed. Up to 5000 characters of textUp to 30000 characters |
status | string | draft is hidden from shoppers; new products default to draftOne of: draft, active, archived |
handle | string | URL part, unique in the store; made from the title when left outUp to 80 characters · Pattern ^[a-z0-9]+(?:-[a-z0-9]+)*$ |
price | number | Price in rupees. Required unless every variant has a price |
compareAtPrice | number | null | Original price, shown crossed out; must be above price |
costPerItem | number | null | What it costs you; never shown to customers |
chargeTax | boolean | Charge tax on this product (default true) |
sku | string | null | SKU for a product without variantsUp to 64 characters |
barcode | string | null | ISBN, UPC or GTIN for a product without variantsUp to 32 characters |
trackQuantity | boolean | Count stock down as orders come in (default true) |
quantity | integer | Units in stock, for a product without variants |
lowStockAt | integer | null | Show as low stock at or below this number |
continueSelling | boolean | Keep selling when stock reaches 0 (default false) |
options | array of objects | Up to 3 options, like Size and Color. A variant is created for every combinationUp to 3 items |
options[].namerequired | string | Option nameUp to 40 characters |
options[].valuesrequired | array of strings | Its values, up to 20Up to 20 items |
variants | array of objects | Price, stock and SKU for specific combinations; others keep or default their valuesUp to 100 items |
variants[].optionsrequired | array of strings | Which variant: one value per option, in option order |
variants[].price | number | Price in rupees; defaults to the product's price |
variants[].quantity | integer | Units in stock |
variants[].sku | string | null | Stock-keeping code, unique in the storeUp to 64 characters |
categoryId | string | null | Id of one of the store's categoriesUp to 64 characters |
productType | string | null | Free-text type, like ShirtUp to 60 characters |
vendor | string | null | Brand or makerUp to 60 characters |
tags | array of strings | Up to 30 tagsUp to 30 items |
physical | boolean | Needs shipping (default true) |
weight | number | null | Shipping weight, in weightUnit |
weightUnit | string | kg (default), g, lb or ozOne of: kg, g, lb, oz |
length | number | null | Package length in cm |
breadth | number | null | Package breadth in cm |
height | number | null | Package height in cm |
originCountry | string | null | Country of originUp to 56 characters |
hsCode | string | null | HS code for customs, 6 to 10 digitsUp to 12 characters |
seoTitle | string | null | Search engine titleUp to 70 characters |
seoDescription | string | null | Search engine descriptionUp to 160 characters |
422 validation_errorA field is missing or invalid, the handle or a SKU is taken, or a variant isn't a combination of the options
Get a product
/api/v1/products/{id}Needs products:readOne product with its options, variants and images.
Path
idrequired | string | The product's id |
404 not_foundNo product with this id in the store
Update a product
/api/v1/products/{id}Needs products:writeChanges only the fields you send. Send variants to change the price, stock or SKU of specific combinations; send options to reshape them (variants for removed combinations are deleted). Stock changes are recorded in the stock history.
Path
idrequired | string | The product's id |
Body
| Field | Type | Description |
|---|---|---|
title | string | Product nameUp to 150 characters |
description | string | HTML (p, h2-h4, strong, em, u, s, ul, ol, li, blockquote, code, pre, a) or plain text, which becomes paragraphs. Other tags are removed. Up to 5000 characters of textUp to 30000 characters |
status | string | draft is hidden from shoppers; new products default to draftOne of: draft, active, archived |
handle | string | URL part, unique in the store; made from the title when left outUp to 80 characters · Pattern ^[a-z0-9]+(?:-[a-z0-9]+)*$ |
price | number | Price in rupees. Required unless every variant has a price |
compareAtPrice | number | null | Original price, shown crossed out; must be above price |
costPerItem | number | null | What it costs you; never shown to customers |
chargeTax | boolean | Charge tax on this product (default true) |
sku | string | null | SKU for a product without variantsUp to 64 characters |
barcode | string | null | ISBN, UPC or GTIN for a product without variantsUp to 32 characters |
trackQuantity | boolean | Count stock down as orders come in (default true) |
quantity | integer | Units in stock, for a product without variants |
lowStockAt | integer | null | Show as low stock at or below this number |
continueSelling | boolean | Keep selling when stock reaches 0 (default false) |
options | array of objects | Up to 3 options, like Size and Color. A variant is created for every combinationUp to 3 items |
options[].namerequired | string | Option nameUp to 40 characters |
options[].valuesrequired | array of strings | Its values, up to 20Up to 20 items |
variants | array of objects | Price, stock and SKU for specific combinations; others keep or default their valuesUp to 100 items |
variants[].optionsrequired | array of strings | Which variant: one value per option, in option order |
variants[].price | number | Price in rupees; defaults to the product's price |
variants[].quantity | integer | Units in stock |
variants[].sku | string | null | Stock-keeping code, unique in the storeUp to 64 characters |
categoryId | string | null | Id of one of the store's categoriesUp to 64 characters |
productType | string | null | Free-text type, like ShirtUp to 60 characters |
vendor | string | null | Brand or makerUp to 60 characters |
tags | array of strings | Up to 30 tagsUp to 30 items |
physical | boolean | Needs shipping (default true) |
weight | number | null | Shipping weight, in weightUnit |
weightUnit | string | kg (default), g, lb or ozOne of: kg, g, lb, oz |
length | number | null | Package length in cm |
breadth | number | null | Package breadth in cm |
height | number | null | Package height in cm |
originCountry | string | null | Country of originUp to 56 characters |
hsCode | string | null | HS code for customs, 6 to 10 digitsUp to 12 characters |
seoTitle | string | null | Search engine titleUp to 70 characters |
seoDescription | string | null | Search engine descriptionUp to 160 characters |
404 not_foundNo product with this id in the store422 validation_errorA field is invalid
Delete a product
/api/v1/products/{id}Needs products:writeDeletes the product with its variants and photos. Past orders and stock history keep their copies of the product's name. To hide a product instead, set its status to archived.
Path
idrequired | string | The product's id |
404 not_foundNo product with this id in the store
Customers
List customers
/api/v1/customersNeeds customers:readThe store's customers, newest first. Search matches name, email, mobile and tags.
Query
page | integer | Page number, from 1 (default 1) |
pageSize | integer | Items per page, 1–50 (default 20) |
search | string | Text to search for |
subscribed | boolean | true for customers who agreed to marketing, false for the rest |
sort | string | name or createdAt; prefix with - for descending (default -createdAt) |
Create a customer
/api/v1/customersNeeds customers:writeAdds a customer, for example when someone signs up on your website or app. Needs an email or a mobile number; both are unique in the store. The first address is the default unless another is marked isDefault.
Body
| Field | Type | Description |
|---|---|---|
firstNamerequired | string | First nameUp to 50 characters |
lastName | string | null | Last nameUp to 50 characters |
email | string | null | Email, unique in the store. An email or a phone is requiredUp to 120 characters · Pattern ^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$ |
phone | string | null | 10-digit Indian mobile, unique in the store; +91 is optionalUp to 16 characters |
emailMarketing | boolean | Agreed to marketing emails (default false) |
smsMarketing | boolean | Agreed to SMS and WhatsApp offers (default false) |
note | string | null | Note only your team seesUp to 1000 characters |
tags | array of strings | Up to 30 tagsUp to 30 items |
password | string | Lets the customer log in to the store; at least 8 charactersUp to 128 characters |
addresses | array of objects | Up to 10 addresses. On update, this replaces the whole listUp to 10 items |
addresses[].id | string | On update: an existing address's id, to keep it. Leave out to add a new addressUp to 40 characters |
addresses[].name | string | null | Recipient; defaults to the customer's nameUp to 100 characters |
addresses[].phone | string | null | Recipient's 10-digit mobile; defaults to the customer'sUp to 16 characters |
addresses[].company | string | null | Company nameUp to 100 characters |
addresses[].line1required | string | House, building and streetUp to 150 characters |
addresses[].line2 | string | null | Area or localityUp to 150 characters |
addresses[].landmark | string | null | Nearby landmarkUp to 100 characters |
addresses[].cityrequired | string | CityUp to 80 characters |
addresses[].staterequired | string | State or union territory, full nameOne of 36 values, e.g. Andaman and Nicobar Islands, Andhra Pradesh, Arunachal Pradesh |
addresses[].pincoderequired | string | 6-digit PIN codePattern ^[1-9]\d{5}$ |
addresses[].isDefault | boolean | Use as the default address (the first address is the default otherwise) |
source | string | Where they came from (default storefront)One of: storefront, checkout, admin |
422 validation_errorA field is invalid, neither email nor phone was sent, or another customer already uses them
Get a customer
/api/v1/customers/{id}Needs customers:readOne customer with all their saved addresses.
Path
idrequired | string | The customer's id |
404 not_foundNo customer with this id in the store
Update a customer
/api/v1/customers/{id}Needs customers:writeChanges only the fields you send. addresses, when sent, is the full new list: include an existing address's id to keep it, and addresses you leave out are removed. Setting a password signs the customer out of other devices.
Path
idrequired | string | The customer's id |
Body
| Field | Type | Description |
|---|---|---|
firstName | string | First nameUp to 50 characters |
lastName | string | null | Last nameUp to 50 characters |
email | string | null | Email, unique in the store. An email or a phone is requiredUp to 120 characters · Pattern ^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$ |
phone | string | null | 10-digit Indian mobile, unique in the store; +91 is optionalUp to 16 characters |
emailMarketing | boolean | Agreed to marketing emails (default false) |
smsMarketing | boolean | Agreed to SMS and WhatsApp offers (default false) |
note | string | null | Note only your team seesUp to 1000 characters |
tags | array of strings | Up to 30 tagsUp to 30 items |
password | string | Lets the customer log in to the store; at least 8 charactersUp to 128 characters |
addresses | array of objects | Up to 10 addresses. On update, this replaces the whole listUp to 10 items |
addresses[].id | string | On update: an existing address's id, to keep it. Leave out to add a new addressUp to 40 characters |
addresses[].name | string | null | Recipient; defaults to the customer's nameUp to 100 characters |
addresses[].phone | string | null | Recipient's 10-digit mobile; defaults to the customer'sUp to 16 characters |
addresses[].company | string | null | Company nameUp to 100 characters |
addresses[].line1required | string | House, building and streetUp to 150 characters |
addresses[].line2 | string | null | Area or localityUp to 150 characters |
addresses[].landmark | string | null | Nearby landmarkUp to 100 characters |
addresses[].cityrequired | string | CityUp to 80 characters |
addresses[].staterequired | string | State or union territory, full nameOne of 36 values, e.g. Andaman and Nicobar Islands, Andhra Pradesh, Arunachal Pradesh |
addresses[].pincoderequired | string | 6-digit PIN codePattern ^[1-9]\d{5}$ |
addresses[].isDefault | boolean | Use as the default address (the first address is the default otherwise) |
404 not_foundNo customer with this id in the store422 validation_errorA field is invalid
Delete a customer
/api/v1/customers/{id}Needs customers:writeRemoves the customer, their addresses and their store login. Their orders stay, with the name they ordered under.
Path
idrequired | string | The customer's id |
404 not_foundNo customer with this id in the store
Orders
List orders
/api/v1/ordersNeeds orders:readThe store's orders, newest first. Search matches the order number, customer name, email and mobile.
Query
page | integer | Page number, from 1 (default 1) |
pageSize | integer | Items per page, 1–50 (default 20) |
search | string | Text to search for |
status | string | to_ship, shipped, delivered, unpaid or cancelled (cancelled includes refunded) |
Create an order
/api/v1/ordersNeeds orders:writePlaces an order exactly as the admin does: stock is taken off (and locked so two orders can't sell the last item), the discount code is checked and counted, and an invoice is issued. Prices default to each variant's current price and the address to the customer's default. Send an Idempotency-Key header so a retry never creates a second order.
Headers
Idempotency-Key | string | Optional. A unique value per order, like a UUID. Repeating it returns the order it created (200, with Idempotency-Replayed: true) |
Body
| Field | Type | Description |
|---|---|---|
customerIdrequired | string | The customer placing the orderUp to 40 characters |
linesrequired | array of objects | What's ordered, up to 100 lines. Each variant onceUp to 100 items |
lines[].variantIdrequired | string | A product variant's id (a product without options has one variant)Up to 40 characters |
lines[].quantityrequired | integer | How many |
lines[].price | number | Unit price in rupees; defaults to the variant's current price |
address | object | Shipping address; defaults to the customer's default address |
address.namerequired | string | RecipientUp to 100 characters |
address.phonerequired | string | Recipient's 10-digit mobileUp to 16 characters |
address.line1required | string | House, building and streetUp to 150 characters |
address.line2 | string | null | Area or localityUp to 150 characters |
address.landmark | string | null | Nearby landmarkUp to 100 characters |
address.cityrequired | string | CityUp to 80 characters |
address.staterequired | string | State, full nameOne of 36 values, e.g. Andaman and Nicobar Islands, Andhra Pradesh, Arunachal Pradesh |
address.pincoderequired | string | 6-digit PIN codePattern ^[1-9]\d{5}$ |
saveAddress | boolean | Also save a sent address to the customer (default true; duplicates are skipped) |
shipping | number | Shipping charge in rupees (default 0) |
discountCode | string | A discount code to applyUp to 30 characters |
status | string | Starting status (default confirmed)One of: confirmed, shipped, delivered |
paid | boolean | Payment already received (default false). Can't be true with cod |
paymentMethodrequired | string | How the customer paysOne of: cod, upi, card, bank_transfer, cash |
note | string | null | Note only your team seesUp to 1000 characters |
422 validation_errorA field is invalid, a variant is out of stock (fields name the line), the discount doesn't apply, or the customer has no address and none was sent
Get an order
/api/v1/orders/{id}Needs orders:readOne order with its lines, shipping address, totals and invoice.
Path
idrequired | string | The order's id |
404 not_foundNo order with this id in the store
Change an order's status
/api/v1/orders/{id}/statusNeeds orders:writeMoves the order on: confirmed → shipped → delivered, or to cancelled or refunded. Cancelling or refunding puts the stock back, gives the discount its use back and voids or refunds the invoice. Refunding needs a paid order.
Path
idrequired | string | The order's id |
Body
| Field | Type | Description |
|---|---|---|
statusrequired | string | The new status. Refunded needs a paid orderOne of: shipped, delivered, cancelled, refunded |
404 not_foundNo order with this id in the store409 invalid_transitionThe order can't make that move, e.g. delivered → shipped
Mark an order paid
/api/v1/orders/{id}/mark-paidNeeds orders:writeRecords that a pending payment was received, for example cash on delivery. The invoice becomes paid too.
Path
idrequired | string | The order's id |
404 not_foundNo order with this id in the store409 invalid_transitionThe order is already paid, cancelled or refunded