Authentication
API key issued by LabStack. Pass this in every request header. Your store can hold two active keys at once, so you can move to a new key before the old one is revoked. A key may have an expiry date; a request made with an expired or revoked key is refused as unauthorized. Header: ls-api-key
API for ordering medicines from your pharmacy network — serviceability, catalogue search and prices, estimates, orders, prescriptions and cancellation. Every call must include a valid ls-api-key header, and every change to an order is sent to your pharmacy webhook.
Catalog
Get alternatives
Other drugs with the same salt composition as drugMasterId - other brands and packs of the same medicine - that your pharmacy network lists, by name, in the same shape as Search Drugs. Send lsPharmacyId to find alternatives one pharmacy stocks, for example to replace a drug Get Estimate reports unavailable there. drug is the drug you asked about, with its own listings. An order is never substituted automatically: only the drugMasterIds you send to Place Order are ordered, so an alternative has to be ordered explicitly. A drug with no salt composition on record has no alternatives. An alternative with notForSale: true - a Schedule X or habit-forming drug - cannot be ordered online either.
Query parameters
drugMasterIdstringRequiredThe drug to find alternatives for
lsPharmacyIdintegerOptionalOptional. Only alternatives this network pharmacy lists.
pageintegerOptionalOptional. 1-based. Default 1. A page past totalPages is a 400.
pageSizeintegerOptionalOptional. Default 20, at most 100.
Responses
The drug and a page of its alternatives
statusstringsuccessdrugobjectThe drug asked about, in the Search Drugs shape
countintegerAlternatives across all pages
pageintegerpageSizeintegertotalPagesintegeralternativesarray<object>Drugs in the Search Drugs shape
Bad request — missing or invalid parameters
statusstringfailureerrorstringUnauthorized — API key missing, invalid, expired or revoked
statusstringfailureerrorstringNo such drug in the catalogue
statusstringfailureerrorstringToo many failed authentication attempts from your address. Every request from that address is refused, whatever key it carries, until the number of seconds in the Retry-After header has passed.
statusstringfailureerrorstring{
"status": "success",
"drug": {
"drugMasterId": "LSD100001",
"name": "Crocin 500 Tablet",
"saltCompositionId": "SALT00045",
"saltCompositionName": "Paracetamol 500mg",
"prescriptionRequired": false,
"notForSale": false,
"packContainer": "strip",
"packQty": 15,
"packUnit": null,
"pharmacies": [
{
"lsPharmacyId": 456,
"pharmacyName": "City Health Pharmacy",
"mrp": 32,
"customerPrice": 28.8,
"storePrice": 27.2
}
]
},
"count": 1,
"page": 1,
"pageSize": 20,
"totalPages": 1,
"alternatives": [
{
"drugMasterId": "LSD100045",
"name": "Dolo 500 Tablet",
"saltCompositionId": "SALT00045",
"saltCompositionName": "Paracetamol 500mg",
"prescriptionRequired": false,
"notForSale": false,
"packContainer": "strip",
"packQty": 10,
"packUnit": null,
"pharmacies": [
{
"lsPharmacyId": 456,
"pharmacyName": "City Health Pharmacy",
"mrp": 30,
"customerPrice": 27,
"storePrice": 25.5
}
]
}
]
}Request example
curl -X GET 'https://integration.labstack.in/api/pharma/v1.0/catalog/getAlternatives?drugMasterId=LSD100001&lsPharmacyId=456&page=1&pageSize=20' \
-H 'ls-api-key: <YOUR_API_KEY>'Get drug details
One drug, in the same shape Search Drugs returns: its salt composition, whether a prescription is required, its pack, and each network pharmacy that lists it with the MRP, customer price and your store's price there, cheapest to the customer first. Send lsPharmacyId for one pharmacy's listing only. A drug your network does not list comes back with an empty pharmacies. Prices are from the catalogue and listing is not live stock; Get Estimate gives the live price and stock for a basket. A drug that cannot be sold online - a Schedule X or habit-forming drug - is returned with notForSale: true and prescriptionRequired: true, so its details can be shown; Get Estimate and Place Order reject a basket that contains it.
Query parameters
drugMasterIdstringRequiredLabStack drug id
lsPharmacyIdintegerOptionalOptional. Only this network pharmacy's listing.
Responses
The drug and its listings in your network
statusstringsuccessdrugobjectdrugMasterIdstringnamestringsaltCompositionIdstring | nullsaltCompositionNamestring | nullprescriptionRequiredbooleanTrue when a prescription must be sent with the order, or when that is unconfirmed. Always true when notForSale is.
notForSalebooleanTrue for a Schedule X or habit-forming drug, which cannot be ordered online. Get Estimate and Place Order reject it.
packContainerstring | nullWhat the pack is, e.g. strip, bottle, vial. The same at every pharmacy.
packQtynumber | nullHow much the pack holds, counted in packUnit - or in units of the dosage form (tablets, capsules) when packUnit is null.
packUnitstring | nullUnit of packQty, e.g. ml, gm. Null when packQty is a count.
pharmaciesarray<object>Cheapest to the customer first
lsPharmacyIdintegerpharmacyNamestringmrpnumber | nullcustomerPricenumber | nullmrp less your store's customer medicine discount
storePricenumber | nullWhat your store owes LabStack per pack: mrp less your store's own medicine discount
Bad request — missing or invalid parameters
statusstringfailureerrorstringUnauthorized — API key missing, invalid, expired or revoked
statusstringfailureerrorstringNo such drug in the catalogue
statusstringfailureerrorstringToo many failed authentication attempts from your address. Every request from that address is refused, whatever key it carries, until the number of seconds in the Retry-After header has passed.
statusstringfailureerrorstring{
"status": "success",
"drug": {
"drugMasterId": "LSD100001",
"name": "Azithral 500 Tablet",
"saltCompositionId": "SALT00112",
"saltCompositionName": "Azithromycin 500mg",
"prescriptionRequired": true,
"notForSale": false,
"packContainer": "strip",
"packQty": 5,
"packUnit": null,
"pharmacies": [
{
"lsPharmacyId": 456,
"pharmacyName": "City Health Pharmacy",
"mrp": 120,
"customerPrice": 108,
"storePrice": 102
},
{
"lsPharmacyId": 457,
"pharmacyName": "MG Road Chemist",
"mrp": 125,
"customerPrice": 112.5,
"storePrice": 106.25
}
]
}
}Request example
curl -X GET 'https://integration.labstack.in/api/pharma/v1.0/catalog/getDrugDetails?drugMasterId=LSD100001&lsPharmacyId=456' \
-H 'ls-api-key: <YOUR_API_KEY>'Search drugs
Pages through the drugs your pharmacy network lists, by name. Send query to search by brand or salt name; omit it to page through the whole catalogue. Send lsPharmacyId to list one pharmacy's drugs only. Each drug is one row with its pack - packContainer, packQty and packUnit, which are the drug's own and the same at every pharmacy - and pharmacies: every network pharmacy that lists it, with its MRP there, customerPrice - what the customer pays, the MRP less your store's customer medicine discount - and storePrice - what your store owes LabStack, the MRP less your store's own medicine discount. count and totalPages count drugs, not pharmacy listings. Prices here are from the catalogue; Get Estimate gives the live price and stock for a basket. prescriptionRequired is true when a prescription must be sent with an order containing the drug, and also when that is not confirmed either way - treat true as "collect a prescription". Drugs that cannot be sold online - Schedule X and habit-forming drugs - are listed so their details can be shown, with notForSale: true and prescriptionRequired: true. Get Estimate and Place Order reject a basket that contains one.
Query parameters
querystringOptionalOptional. Brand or salt name to search for. At least 3 characters when sent.
lsPharmacyIdintegerOptionalOptional. Only drugs this network pharmacy lists.
pageintegerOptionalOptional. 1-based. Default 1. A page past totalPages is a 400.
pageSizeintegerOptionalOptional. Drugs per page. Default 20, at most 100.
Responses
A page of drugs
statusstringsuccesscountintegerDrugs matching, across all pages
pageintegerpageSizeintegertotalPagesintegerdrugsarray<object>drugMasterIdstringLabStack drug id. Identifies a brand and pack, not a salt.
namestringsaltCompositionIdstring | nullsaltCompositionNamestring | nullprescriptionRequiredbooleanTrue when a prescription must be sent with the order, or when that is unconfirmed. Always true when notForSale is.
notForSalebooleanTrue for a Schedule X or habit-forming drug, which cannot be ordered online. Get Estimate and Place Order reject it.
packContainerstring | nullWhat the pack is, e.g. strip, bottle, vial
packQtynumber | nullHow much the pack holds, counted in packUnit - or in units of the dosage form (tablets, capsules) when packUnit is null.
packUnitstring | nullUnit of packQty, e.g. ml, gm. Null when packQty is a count.
pharmaciesarray<object>Network pharmacies listing the drug, cheapest to the customer first
lsPharmacyIdintegerpharmacyNamestringmrpnumber | nullMRP per pack. Null when none is on record.
customerPricenumber | nullCustomer price per pack: mrp less your store's customer medicine discount
storePricenumber | nullYour store's price per pack, what your store owes LabStack: mrp less your store's own medicine discount
Bad request — missing or invalid parameters
statusstringfailureerrorstringUnauthorized — API key missing, invalid, expired or revoked
statusstringfailureerrorstringToo many failed authentication attempts from your address. Every request from that address is refused, whatever key it carries, until the number of seconds in the Retry-After header has passed.
statusstringfailureerrorstring{
"status": "success",
"count": 2,
"page": 1,
"pageSize": 20,
"totalPages": 1,
"drugs": [
{
"drugMasterId": "LSD100001",
"name": "Paracetamol 500mg Tablet",
"saltCompositionId": "SALT00045",
"saltCompositionName": "Paracetamol 500mg",
"prescriptionRequired": false,
"notForSale": false,
"packContainer": "strip",
"packQty": 10,
"packUnit": null,
"pharmacies": [
{
"lsPharmacyId": 456,
"pharmacyName": "City Health Pharmacy",
"mrp": 30,
"customerPrice": 27,
"storePrice": 25.5
},
{
"lsPharmacyId": 457,
"pharmacyName": "MG Road Chemist",
"mrp": 32,
"customerPrice": 28.8,
"storePrice": 27.2
}
]
},
{
"drugMasterId": "LSD100002",
"name": "Paracetamol 650mg Tablet",
"saltCompositionId": "SALT00046",
"saltCompositionName": "Paracetamol 650mg",
"prescriptionRequired": false,
"notForSale": false,
"packContainer": "strip",
"packQty": 15,
"packUnit": null,
"pharmacies": [
{
"lsPharmacyId": 456,
"pharmacyName": "City Health Pharmacy",
"mrp": 34,
"customerPrice": 30.6,
"storePrice": 28.9
}
]
}
]
}Request example
curl -X GET 'https://integration.labstack.in/api/pharma/v1.0/catalog/searchDrugs?query=paracetamol&lsPharmacyId=456&page=1&pageSize=20' \
-H 'ls-api-key: <YOUR_API_KEY>'Serviceability
Check serviceability
Lists the pharmacies in your network that can fulfil an order at a location, with the order types and shipment speeds each offers there. Send pincode, a latitude/longitude pair, or both. The optional address fields refine a pincode into a more precise location and require it. HOME_DELIVERY is offered where the pharmacy delivers to the location. PICKUP is offered when the pharmacy's pickup point is within range km of the location - 10 km unless you send range, at most 100. distance says how far away it is, and pickupLocation where the customer collects the order and when the pharmacy is open. A few pharmacies choose the pickup point nearest the customer only when the order is placed; they are listed for PICKUP with a null distance and pickupLocation, and range does not apply to them. Order: with orderType=PICKUP, the nearest pickup point comes first. Otherwise pharmacies come in your network's order of preference, the nearest first among those you prefer equally. A pharmacy with no distance follows those with one. Use a returned lsPharmacyId with Search Drugs, Get Estimate and Place Order, and send Get Estimate and Place Order the same location and range: they apply the same rules. A shipmentSpeed you send to them must be one of that pharmacy's shipmentSpeeds; an empty list means the pharmacy offers no choice of speed, so omit it.
Query parameters
pincodestringOptionalRequired unless latitude and longitude are sent. 6 digits.
latitudenumberOptionalRequired unless pincode is sent. -90 to 90. Send with longitude.
longitudenumberOptionalRequired unless pincode is sent. -180 to 180. Send with latitude.
orderTypestringOptionalHOME_DELIVERYPICKUPOptional. Only pharmacies taking this order type. PICKUP also lists the nearest pickup point first.
rangenumberOptionalOptional. How far, in km, a pickup point may be from the location for PICKUP to be offered. Greater than 0 and at most 100; may be fractional. Default 10.
shipmentSpeedstringOptionalSTANDARDEXPRESSSAME_DAYPAN_INDIAOptional. Only pharmacies offering this speed at the location.
unitFloorBuildingstringOptionalOptional. Refines the location. Requires pincode.
addressstringOptionalOptional. Refines the location. Requires pincode.
localitystringOptionalOptional. Refines the location. Requires pincode.
citystringOptionalOptional. Refines the location. Requires pincode.
statestringOptionalOptional. Refines the location. Requires pincode.
Responses
Pharmacies that can fulfil an order at the location
statusstringsuccesspincodestring | nullThe pincode the location resolved to. Null only when latitude and longitude alone were sent and your network has no pharmacies.
latitudenumber | nullThe point distances are measured from. Null only when a pincode alone was sent and no answer depended on a more precise location; PICKUP is then offered only by pharmacies that choose the pickup point when the order is placed.
longitudenumber | nullpharmaciesarray<object>In the order described above. Empty when no network pharmacy serves the location.
lsPharmacyIdintegerPass as lsPharmacyId to Get Estimate and Place Order
pharmacyNamestringorderTypesarray<string>The order types this pharmacy takes at the location
shipmentSpeedsarray<string>Speeds you may request. Empty when the pharmacy offers no choice.
distancenumber | nullKm from the location to the pickup point, to 2 decimal places. Null unless orderTypes includes PICKUP and the pickup point is known.
pickupLocationobject | nullWhere the customer collects a PICKUP order. Null exactly when distance is.
addressstring | nulllocalitystring | nullcitystring | nullstatestring | nullpincodestring | nulllatitudenumberlongitudenumberopeningTimestring | nullHH:mm, India time, the same every day. Null together with closingTime when the pharmacy is open 24 hours.
closingTimestring | nullHH:mm, India time.
Bad request — missing or invalid parameters
statusstringfailureerrorstringUnauthorized — API key missing, invalid, expired or revoked
statusstringfailureerrorstringToo many failed authentication attempts from your address. Every request from that address is refused, whatever key it carries, until the number of seconds in the Retry-After header has passed.
statusstringfailureerrorstring{
"status": "success",
"pincode": "560038",
"latitude": 12.9784,
"longitude": 77.6408,
"pharmacies": [
{
"lsPharmacyId": 456,
"pharmacyName": "City Health Pharmacy",
"orderTypes": [
"HOME_DELIVERY",
"PICKUP"
],
"shipmentSpeeds": [],
"distance": 0.74,
"pickupLocation": {
"address": "612, 100 Feet Road, HAL 2nd Stage",
"locality": "Indiranagar",
"city": "Bangalore",
"state": "Karnataka",
"pincode": "560038",
"latitude": 12.9719,
"longitude": 77.6412,
"openingTime": "08:00",
"closingTime": "22:00"
}
},
{
"lsPharmacyId": 458,
"pharmacyName": "Koramangala Medicals",
"orderTypes": [
"PICKUP"
],
"shipmentSpeeds": [],
"distance": 5.83,
"pickupLocation": {
"address": "14, 80 Feet Road, 4th Block",
"locality": "Koramangala",
"city": "Bangalore",
"state": "Karnataka",
"pincode": "560034",
"latitude": 12.9279,
"longitude": 77.6271,
"openingTime": null,
"closingTime": null
}
},
{
"lsPharmacyId": 457,
"pharmacyName": "MG Road Chemist",
"orderTypes": [
"HOME_DELIVERY"
],
"shipmentSpeeds": [
"STANDARD",
"EXPRESS"
],
"distance": null,
"pickupLocation": null
}
]
}Request example
curl -X GET 'https://integration.labstack.in/api/pharma/v1.0/network/checkServiceability?pincode=560001&latitude=12.9716&longitude=77.5946&orderType=&range=&shipmentSpeed=&unitFloorBuilding=&address=42, MG Road&locality=Indiranagar&city=Bangalore&state=Karnataka' \
-H 'ls-api-key: <YOUR_API_KEY>'Orders
Cancel order
Cancels one of your orders, by orderId or referenceId. An order the pharmacy has not received yet - waiting for payment, or not accepted automatically - is cancelled at once. Otherwise the pharmacy is asked, and may refuse once it has started on the order; a refusal is a 409, the order keeps its status, and LabStack follows it up with the pharmacy. Cancelling an order that is already CANCELLED succeeds and changes nothing, so a retry is safe. A FULL_DELIVERED or PARTIAL_DELIVERED order cannot be cancelled (409). For an order the pharmacy split into several fulfilments, cancelling any one cancels the whole order; relatedOrders reports where each of the others ended up, since a fulfilment the pharmacy had already accepted is left with it. A cancelled order's referenceId can be used again with Place Order. Money already paid through the order's payment link is owed back, and LabStack arranges the refund.
Request bodyRequired
orderIdintegerOptionalLabStack order id. Send this or referenceId.
referenceIdstringOptionalYour own order id. Send this or orderId.
reasonstringOptionalOptional. Recorded as the cancelReason.
Responses
The order is cancelled
statusstringsuccessorderobjectorderIdintegerreferenceIdstring | nullorderStatusstringcancelReasonstring | nullpharmaSuperOrderIdinteger | nullrelatedOrdersarray<object>The other fulfilments of a split order, with their status after the cancellation. Empty otherwise.
orderIdintegerorderStatusstringBad request — missing or invalid parameters
statusstringfailureerrorstringUnauthorized — API key missing, invalid, expired or revoked
statusstringfailureerrorstringNo such order among yours
statusstringfailureerrorstringThe order is delivered, is already being cancelled, or the pharmacy refused the cancellation
statusstringfailureerrorstringToo many failed authentication attempts from your address. Every request from that address is refused, whatever key it carries, until the number of seconds in the Retry-After header has passed.
statusstringfailureerrorstring{
"status": "success",
"order": {
"orderId": 1234,
"referenceId": "MY-REF-001",
"orderStatus": "CANCELLED",
"cancelReason": "Patient no longer needs the medication",
"pharmaSuperOrderId": null,
"relatedOrders": []
}
}Request example
curl -X POST 'https://integration.labstack.in/api/pharma/v1.0/order/cancelOrder' \
-H 'ls-api-key: <YOUR_API_KEY>' \
-H 'Content-Type: application/json' \
-d '{
"orderId": 1234,
"reason": "Patient no longer needs the medication"
}'Get estimate
Prices a basket at a pharmacy before any order exists, for partners that show a total or collect payment on their own platform. The basket is checked exactly as Place Order checks it - your network, the order type, the drugs the pharmacy lists, drugs that are not for sale, the location and the shipment speed - so a basket accepted here is accepted there unless stock or prices change in between. A basket containing a drug marked notForSale (Schedule X or habit-forming) is rejected with a 400 naming it. unitPrice, subTotal and totalAmount are what the customer pays: each drug's MRP less your store's customer medicine discount, plus additionalCharges - delivery and every other fee - on top. storeUnitPrice, storeSubTotal and storeTotalAmount are what your store owes LabStack: each drug's MRP less your store's own medicine discount, plus the same additionalCharges. Both totals are the figures Place Order fixes for the order if nothing changes; re-read them from Place Order's response. allItemsAvailable is false when the pharmacy cannot supply a drug, or not in the quantity asked; Place Order refuses that basket, and the item's available says which. Unavailable items are priced but left out of subTotal and totalAmount. prescriptionRequired is true when Place Order will need a prescription in documents. canCollectPayment is true when Place Order will accept isPaymentRequired for this basket. isLivePrice is false for a pharmacy that prices from its catalogue, whose stock is confirmed only once it receives the order. Location: send the patient's pincode or a latitude/longitude pair, for either order type. PICKUP is accepted on the rules Check Serviceability applies: the pharmacy's pickup point must be within range km of that location (10 unless sent, at most 100), or the call is a 400 giving the distance. distance and pickupLocation then say how far away the pickup point is and where the customer collects the order; both are null for HOME_DELIVERY, and for a pharmacy that chooses the pickup point when the order is placed. expectedDeliveryBy is when a HOME_DELIVERY order placed now would be expected to reach the patient, at the shipmentSpeed you sent or the pharmacy's default when you sent none. It is the time Place Order gives the order if you place it straight away; placing later moves it. An order placed shortly before the pharmacy closes, or while it is closed, is expected after it next opens. Null for PICKUP.
Request bodyRequired
orderTypestringRequiredHOME_DELIVERYPICKUPlsPharmacyIdintegerRequiredA pharmacy from Check Serviceability
drugsarray<object>RequiredOne entry per drug. Repeated drugMasterIds are merged; at most 100 of any one drug.
drugMasterIdstringRequiredquantityintegerRequiredpincodestringOptionalThe patient's pincode - the delivery pincode for HOME_DELIVERY. Required unless latitude and longitude are sent.
latitudenumberOptionalOptional. Send with longitude. The patient's location when sent: the delivery point, or where a PICKUP distance is measured from.
longitudenumberOptionalrangenumberOptionalOptional, PICKUP only. How far, in km, the pickup point may be from the patient. Greater than 0 and at most 100. Default 10.
unitFloorBuildingstringOptionalOptional. Refines the location. Requires pincode.
addressstringOptionalOptional. Refines the location. Requires pincode.
localitystringOptionalOptional. Requires pincode.
citystringOptionalOptional. Requires pincode.
statestringOptionalOptional. Requires pincode.
shipmentSpeedstringOptionalSTANDARDEXPRESSSAME_DAYPAN_INDIAOptional. One of the pharmacy's shipmentSpeeds from Check Serviceability. Omit for its default.
namestringOptionalOptional patient name. Send with mobile; some pharmacies quote more precisely with both.
mobilestringOptionalOptional patient mobile. Send with name.
Responses
The estimate
statusstringsuccessestimateobjectlsPharmacyIdintegerpharmacyNamestringorderTypestringHOME_DELIVERYPICKUPshipmentSpeedstring | nullSTANDARDEXPRESSSAME_DAYPAN_INDIAThe speed quoted; null for the pharmacy default
shipmentSpeedsarray<string>Speeds the pharmacy offers at this location. Empty when it offers no choice.
expectedDeliveryBystring · date-time | nullHOME_DELIVERY only: when an order placed now would be expected to be delivered. Null for PICKUP.
distancenumber | nullPICKUP only: km from the patient to the pickup point, to 2 decimal places. Null otherwise.
pickupLocationobject | nullPICKUP only: where the customer collects the order. Null exactly when distance is.
addressstring | nulllocalitystring | nullcitystring | nullstatestring | nullpincodestring | nulllatitudenumberlongitudenumberopeningTimestring | nullHH:mm, India time, the same every day. Null together with closingTime when the pharmacy is open 24 hours.
closingTimestring | nullHH:mm, India time.
isLivePricebooleanTrue when the pharmacy priced the basket and confirmed its stock just now
allItemsAvailablebooleanFalse when Place Order would refuse the basket for stock
prescriptionRequiredbooleanTrue when Place Order needs a prescription in documents
canCollectPaymentbooleanTrue when Place Order accepts isPaymentRequired for this basket
priceobjectcurrencystringmrpTotalnumber | nullMRP x quantity over the available items. Null when any of them has no MRP on record.
subTotalnumberThe available items at the customer price
additionalChargesnumberDelivery and every other fee on top of the medicines
totalAmountnumbersubTotal + additionalCharges
storeSubTotalnumber | nullThe medicines at your store's price
storeTotalAmountnumber | nullWhat your store owes LabStack: storeSubTotal + additionalCharges
itemsarray<object>drugMasterIdstringnamestringpackContainerstring | nullWhat the pack is, e.g. strip, bottle, vial
packQtynumber | nullHow much the pack holds, counted in packUnit - or in units of the dosage form (tablets, capsules) when packUnit is null.
packUnitstring | nullUnit of packQty, e.g. ml, gm. Null when packQty is a count.
quantityintegermrpnumber | nullMRP per pack
unitPricenumber | nullCustomer price per pack
linePricenumber | nullunitPrice x quantity
storeUnitPricenumber | nullYour store's price per pack, what your store owes LabStack: mrp less your store's own medicine discount
storeLinePricenumber | nullstoreUnitPrice x quantity
availablebooleanprescriptionRequiredbooleanBad request — missing or invalid parameters
statusstringfailureerrorstringUnauthorized — API key missing, invalid, expired or revoked
statusstringfailureerrorstringToo many failed authentication attempts from your address. Every request from that address is refused, whatever key it carries, until the number of seconds in the Retry-After header has passed.
statusstringfailureerrorstringThe pharmacy could not be reached or could not price the basket. Safe to retry.
statusstringfailureerrorstring{
"status": "success",
"estimate": {
"lsPharmacyId": 456,
"pharmacyName": "City Health Pharmacy",
"orderType": "HOME_DELIVERY",
"shipmentSpeed": "STANDARD",
"shipmentSpeeds": [
"STANDARD",
"EXPRESS"
],
"expectedDeliveryBy": "2026-09-29T17:00:00.000Z",
"distance": null,
"pickupLocation": null,
"isLivePrice": true,
"allItemsAvailable": true,
"prescriptionRequired": true,
"canCollectPayment": true,
"price": {
"currency": "INR",
"mrpTotal": 290,
"subTotal": 261,
"additionalCharges": 40,
"totalAmount": 301,
"storeSubTotal": 246.5,
"storeTotalAmount": 286.5,
"items": [
{
"drugMasterId": "LSD100001",
"name": "Azithral 500 Tablet",
"packContainer": "strip",
"packQty": 5,
"packUnit": null,
"quantity": 2,
"mrp": 120,
"unitPrice": 108,
"linePrice": 216,
"storeUnitPrice": 102,
"storeLinePrice": 204,
"available": true,
"prescriptionRequired": true
},
{
"drugMasterId": "LSD100002",
"name": "Paracetamol 650mg Tablet",
"packContainer": "strip",
"packQty": 15,
"packUnit": null,
"quantity": 1,
"mrp": 50,
"unitPrice": 45,
"linePrice": 45,
"storeUnitPrice": 42.5,
"storeLinePrice": 42.5,
"available": true,
"prescriptionRequired": false
}
]
}
}
}Request example
curl -X POST 'https://integration.labstack.in/api/pharma/v1.0/order/getEstimate' \
-H 'ls-api-key: <YOUR_API_KEY>' \
-H 'Content-Type: application/json' \
-d '{
"orderType": "HOME_DELIVERY",
"lsPharmacyId": 456,
"drugs": [
{
"drugMasterId": "LSD100001",
"quantity": 2
},
{
"drugMasterId": "LSD100002",
"quantity": 1
}
],
"pincode": "560001",
"address": "42, MG Road",
"city": "Bangalore",
"state": "Karnataka",
"shipmentSpeed": "STANDARD"
}'Get order details
The full state of one of your orders, by LabStack orderId or by the referenceId you placed it with - send exactly one. items come back in the shape Place Order accepts - drugMasterId and quantity - with the customer price each was placed at, and the store price beside it. unitPrice, subTotal and totalAmount are what the customer pays: MRP less your store's customer medicine discount at the time of placing. storeUnitPrice, storeSubTotal and storeTotalAmount are what your store owes LabStack: MRP less your store's own medicine discount, plus the same additionalCharges. When the order ships, a drug dispatched from a batch printed at a lower MRP is repriced at that MRP with the same discounts, and both sets of totals drop with it; a higher printed MRP never raises a price. An order placed before customer prices were recorded reports the prices it was placed at, with no mrp, null store figures and possibly no additionalCharges. The pharmacy may split an order into several fulfilments, each with its own orderId and status. Such an order carries a pharmaSuperOrderId and lists the other fulfilments in relatedOrders. On a split, totalAmount and storeTotalAmount are for the whole order while price covers this fulfilment only; the delivery charge is made once, so it appears on one fulfilment. A referenceId names the fulfilment Place Order returned. A PICKUP order carries pickupLocation, where the customer collects it - the pharmacy's current address and opening hours. address stays the patient's, as sent to Place Order. expectedDeliveryBy is when a HOME_DELIVERY order is expected to reach the patient: the time Place Order returned, moved only if the order's shipment speed was changed. It stays set once the order is delivered, so you can compare the two. Null for PICKUP, for a CANCELLED order, and while the order waits for payment. On a split order each fulfilment has its own. Every documented field is always present; a value that does not exist is null. Order Status Webhook: every change to an order is POSTed to your store's pharmacy webhook URL, authenticated like your other LabStack webhooks. It carries event (what changed - orderStatus, paymentStatus, shipmentSpeed, pharmacy or drugs), orderId, referenceId, orderStatus, previousStatus, orderType, orderDate, lsPharmacyId, pharmacyName, shipmentSpeed, expectedDeliveryBy, paymentStatus, isPaymentRequired, pharmaSuperOrderId, shipmentTrackingId, totalAmount, cancelReason, uniqueId and userName; call this endpoint for everything else. expectedDeliveryBy there is the value this endpoint returns.
Query parameters
orderIdintegerOptionalLabStack order id. Send this or referenceId.
referenceIdstringOptionalYour own order id, e.g. MY-REF-001. Send this or orderId.
Responses
The order
statusstringsuccessorderobjectorderIdintegerreferenceIdstring | nullorderStatusstringPENDINGCREATEDPLACEDCONFIRMEDSHIPPEDPARTIAL_DELIVEREDFULL_DELIVEREDCANCELLEDorderTypestringHOME_DELIVERYPICKUPorderDatestring · date-timelsPharmacyIdintegerpharmacyNamestring | nullpickupLocationobject | nullPICKUP only: where the customer collects the order. Null for HOME_DELIVERY, and for a pharmacy that chooses the pickup point when the order is placed.
addressstring | nulllocalitystring | nullcitystring | nullstatestring | nullpincodestring | nulllatitudenumberlongitudenumberopeningTimestring | nullHH:mm, India time, the same every day. Null together with closingTime when the pharmacy is open 24 hours.
closingTimestring | nullHH:mm, India time.
shipmentSpeedstring | nullSTANDARDEXPRESSSAME_DAYPAN_INDIAexpectedDeliveryBystring · date-time | nullHOME_DELIVERY only: when the order is expected to be delivered. Null for PICKUP, for a CANCELLED order and while the order waits for payment.
shipmentTrackingIdstring | nullinvoiceUrlstring | nullThe pharmacy's GST invoice, once issued
notesstring | nullcancelReasonstring | nullSet only on a CANCELLED order
pharmaSuperOrderIdinteger | nullSet when the order was split into several fulfilments
relatedOrdersarray<object>The other fulfilments of a split order. Empty otherwise.
orderIdintegerorderStatusstringisPaymentRequiredbooleanTrue while the order waits for payment and has not been sent to the pharmacy
paymentStatusstringIDLEPENDINGCOMPLETEDCANCELLEDtotalAmountnumber | nullWhat the customer pays for the whole order
storeTotalAmountnumber | nullWhat your store owes LabStack for the whole order. Null on an order placed before store prices were recorded.
priceobjectThis fulfilment: its items and the charges it carries
currencystringmrpTotalnumber | nullsubTotalnumberadditionalChargesnumber | nullNull only on an order placed before customer prices were recorded, when unknown
totalAmountnumberstoreSubTotalnumber | nullThe medicines at your store's price
storeTotalAmountnumber | nullWhat your store owes LabStack: storeSubTotal + additionalCharges
itemsarray<object>drugMasterIdstring | nullnamestring | nullpackContainerstring | nullWhat the pack is, e.g. strip, bottle, vial
packQtynumber | nullHow much the pack holds, counted in packUnit - or in units of the dosage form (tablets, capsules) when packUnit is null.
packUnitstring | nullUnit of packQty, e.g. ml, gm. Null when packQty is a count.
quantityintegermrpnumber | nullunitPricenumber | nullCustomer price per pack
linePricenumber | nullstoreUnitPricenumber | nullYour store's price per pack, what your store owes LabStack: mrp less your store's own medicine discount
storeLinePricenumber | nullstoreUnitPrice x quantity
documentsarray<object>documentIdintegertypestringPRESCRIPTIONPRIOR_PRESCRIPTIONREFERRALOTHERurlstringpatientobjectuniqueIdstringnamestringdateOfBirthstring | nullYYYY-MM-DD
ageinteger | nullgenderstring | nullMALEFEMALEOTHERSmobilestring | nullaltNumberstring | nullemailstring | nullmainUserUniqueIdstring | nullrelationshipstring | nulladdressobjectThe patient's address as sent to Place Order. For PICKUP, see pickupLocation.
unitFloorBuildingstring | nulladdressstring | nulllocalitystring | nullcitystring | nullstatestring | nullpincodestring | nulllatitudenumber | nulllongitudenumber | nullBad request — missing or invalid parameters
statusstringfailureerrorstringUnauthorized — API key missing, invalid, expired or revoked
statusstringfailureerrorstringNo such order among yours
statusstringfailureerrorstringToo many failed authentication attempts from your address. Every request from that address is refused, whatever key it carries, until the number of seconds in the Retry-After header has passed.
statusstringfailureerrorstring{
"status": "success",
"order": {
"orderId": 1234,
"referenceId": "MY-REF-001",
"orderStatus": "CONFIRMED",
"orderType": "HOME_DELIVERY",
"orderDate": "2026-09-29T09:00:00.000Z",
"lsPharmacyId": 456,
"pharmacyName": "City Health Pharmacy",
"pickupLocation": null,
"shipmentSpeed": "STANDARD",
"expectedDeliveryBy": "2026-09-29T17:00:00.000Z",
"shipmentTrackingId": null,
"invoiceUrl": null,
"notes": "Leave at reception",
"cancelReason": null,
"pharmaSuperOrderId": null,
"relatedOrders": [],
"isPaymentRequired": false,
"paymentStatus": "PENDING",
"totalAmount": 301,
"storeTotalAmount": 286.5,
"price": {
"currency": "INR",
"mrpTotal": 290,
"subTotal": 261,
"additionalCharges": 40,
"totalAmount": 301,
"storeSubTotal": 246.5,
"storeTotalAmount": 286.5,
"items": [
{
"drugMasterId": "LSD100001",
"name": "Azithral 500 Tablet",
"packContainer": "strip",
"packQty": 5,
"packUnit": null,
"quantity": 2,
"mrp": 120,
"unitPrice": 108,
"linePrice": 216,
"storeUnitPrice": 102,
"storeLinePrice": 204
},
{
"drugMasterId": "LSD100002",
"name": "Paracetamol 650mg Tablet",
"packContainer": "strip",
"packQty": 15,
"packUnit": null,
"quantity": 1,
"mrp": 50,
"unitPrice": 45,
"linePrice": 45,
"storeUnitPrice": 42.5,
"storeLinePrice": 42.5
}
]
},
"documents": [
{
"documentId": 88,
"type": "PRESCRIPTION",
"url": "https://files.example.com/prescription.pdf"
}
],
"patient": {
"uniqueId": "USR-001",
"name": "Jane Doe",
"dateOfBirth": "1990-04-12",
"age": 36,
"gender": "FEMALE",
"mobile": "9876543210",
"altNumber": null,
"email": "jane@example.com",
"mainUserUniqueId": null,
"relationship": null
},
"address": {
"unitFloorBuilding": null,
"address": "42, MG Road",
"locality": null,
"city": "Bangalore",
"state": "Karnataka",
"pincode": "560001",
"latitude": 12.9716,
"longitude": 77.5946
}
}
}Request example
curl -X GET 'https://integration.labstack.in/api/pharma/v1.0/order/getOrderDetails?orderId=1234&referenceId=' \
-H 'ls-api-key: <YOUR_API_KEY>'Place order
Creates a pharmacy order for a patient and sends it to the pharmacy. The basket is checked exactly as Get Estimate checks it, and the order is created only when the pharmacy can supply every drug in the quantity asked; otherwise the call is a 400 naming the drugMasterIds, and nothing is created. Only the drugMasterIds you send are ordered - nothing is substituted. A drug marked notForSale in the catalogue (Schedule X or habit-forming) cannot be ordered online: a basket containing one is a 400 naming it, whatever prescriptions are sent. Prescriptions go in documents. They are required when any drug needs one (Get Estimate's prescriptionRequired), and they reach the pharmacy with the order. A document added later with Upload Prescription is forwarded by LabStack instead. If the documents cannot be stored the call is a 503, no order is left behind, and it is safe to retry. Send a referenceId - your own order id - to make retries safe: while an order with that referenceId exists and is not cancelled, a second Place Order with it is a 409 that returns the existing orderId. A request identical to one still in progress is also a 409. order.price.totalAmount is what the customer pays: each drug's MRP less your store's customer medicine discount, which is also what the pharmacy invoices the customer, plus additionalCharges. order.price.storeTotalAmount is what your store owes LabStack: each drug's MRP less your store's own medicine discount, plus the same additionalCharges. Both are fixed when the order is placed and never rise afterwards; they drop only if a drug is dispatched from a batch printed at a lower MRP, which Get Order Details then reports. A 200 means LabStack has the order; orderStatus says where it is. PLACED - the pharmacy has it. CREATED - taken by LabStack for a pharmacy it places orders with directly. PENDING - waiting for payment (isPaymentRequired is true), or the pharmacy did not accept it automatically, in which case placementError says so and LabStack follows it up. Every later change arrives on the Order Status Webhook. Set isPaymentRequired to collect payment before the order is sent. The response then carries a paymentLink, valid until paymentLinkExpiresAt (16 minutes). The order stays PENDING and the pharmacy does not see it until it is paid. Once paid it is sent and moves to PLACED - or CREATED for a pharmacy LabStack places orders with directly, or stays PENDING if the pharmacy does not accept it - and the webhook reports it. If the link lapses unpaid the order is cancelled. Payment needs a live price (Get Estimate's canCollectPayment), and when payment cannot be set up the call is a 503 with no order left behind. HOME_DELIVERY needs address, city, state and pincode. PICKUP needs the patient's pincode or a latitude/longitude pair, and is accepted only when the pharmacy's pickup point is within range km of it (10 unless sent, at most 100) - the rule Check Serviceability and Get Estimate apply. pickupLocation in the response is where the customer collects the order. One of dateOfBirth or age is required. expectedDeliveryBy is when a HOME_DELIVERY order is expected to reach the patient, at its shipmentSpeed or the pharmacy's default when none was sent. It is set when the order is placed and moves only if the order's shipment speed is changed; Get Order Details and the Order Status Webhook report it. An order placed shortly before the pharmacy closes, or while it is closed, is expected after it next opens. Null for PICKUP, and while the order waits for payment: the webhook that reports the payment carries it, and it counts from when the order was placed, not from the payment.
Request bodyRequired
orderTypestringRequiredHOME_DELIVERYPICKUPlsPharmacyIdintegerRequiredA pharmacy from Check Serviceability
drugsarray<object>RequiredOne entry per drug. Repeated drugMasterIds are merged; at most 100 of any one drug.
drugMasterIdstringRequiredIdentifies a brand and pack, not a salt
quantityintegerRequiredreferenceIdstringOptionalOptional but recommended. Your own order id. Unique among your orders that are not cancelled; usable with Get Order Details, Cancel Order and Upload Prescription.
namestringRequiredLetters, digits and spaces; other characters are removed.
genderstringRequiredMALEFEMALEOTHERSmobilestringRequired10 digits. A +91 prefix, spaces and dashes are accepted.
dateOfBirthstring · dateOptionalYYYY-MM-DD. Required unless age is sent; used over age when both are.
ageintegerOptionalWhole years. Required unless dateOfBirth is sent.
emailstringOptionalOptional
altNumberstringOptionalOptional alternate contact, 10 digits
uniqueIdstringOptionalOptional. Your id for the patient; the same uniqueId is the same patient on every order. Derived from mobile and name when omitted.
mainUserUniqueIdstringOptionalOptional. uniqueId of an existing patient this one is a dependant of.
relationshipstringOptionalOptional. How the patient relates to mainUserUniqueId, which it requires. Defaults to OTHER.
unitFloorBuildingstringOptionaladdressstringOptionalRequired for HOME_DELIVERY
localitystringOptionalcitystringOptionalRequired for HOME_DELIVERY
statestringOptionalRequired for HOME_DELIVERY
pincodestringOptionalRequired for HOME_DELIVERY. For PICKUP, required unless latitude and longitude are sent. 6 digits.
latitudenumberOptionalOptional. The patient's location, when you have it: the delivery point, or where a PICKUP distance is measured from. Send with longitude.
longitudenumberOptionalrangenumberOptionalOptional, PICKUP only. How far, in km, the pickup point may be from the patient. Greater than 0 and at most 100. Default 10.
shipmentSpeedstringOptionalSTANDARDEXPRESSSAME_DAYPAN_INDIAOptional. One of the pharmacy's shipmentSpeeds from Check Serviceability. Omit for its default.
notesstringOptionalOptional note for the pharmacy
isPaymentRequiredbooleanOptionalOptional, default false. Hold the order until the returned paymentLink is paid.
documentsarray<object>OptionalPrescriptions. Required when any drug needs one.
contentstringRequiredBase64 file content, at most 10 MB. A data-URI prefix is accepted.
fileNamestringRequiredWith extension: pdf, jpg, jpeg or png
Responses
LabStack has the order. Check orderStatus for where it is.
statusstringsuccessorderobjectorderIdintegerLabStack order id
referenceIdstring | nullorderStatusstringPLACEDCREATEDPENDINGorderTypestringHOME_DELIVERYPICKUPlsPharmacyIdintegerpharmacyNamestringpickupLocationobject | nullPICKUP only: where the customer collects the order. Null for HOME_DELIVERY, and for a pharmacy that chooses the pickup point when the order is placed.
addressstring | nulllocalitystring | nullcitystring | nullstatestring | nullpincodestring | nulllatitudenumberlongitudenumberopeningTimestring | nullHH:mm, India time, the same every day. Null together with closingTime when the pharmacy is open 24 hours.
closingTimestring | nullHH:mm, India time.
shipmentSpeedstring | nullexpectedDeliveryBystring · date-time | nullHOME_DELIVERY only: when the order is expected to be delivered. Null for PICKUP and while the order waits for payment.
pharmaSuperOrderIdinteger | nullSet when the pharmacy split the order into several fulfilments; Get Order Details lists them. Null otherwise.
isPaymentRequiredbooleanTrue while the order waits for payment
paymentLinkstring | nullOnly when isPaymentRequired was sent true
paymentLinkExpiresAtstring · date-time | nullWhen an unpaid order is cancelled
placementErrorstring | nullSet when the pharmacy did not accept the order (orderStatus PENDING, isPaymentRequired false). Null otherwise, including for an order waiting for payment.
documentsarray<object>documentIdintegerpriceobjectcurrencystringmrpTotalnumber | nullNull when any drug has no MRP on record
subTotalnumberThe medicines at the customer price
additionalChargesnumberDelivery and every other fee on top of the medicines
totalAmountnumberWhat the customer pays: subTotal + additionalCharges
storeSubTotalnumber | nullThe medicines at your store's price
storeTotalAmountnumber | nullWhat your store owes LabStack: storeSubTotal + additionalCharges
itemsarray<object>drugMasterIdstringnamestringpackContainerstring | nullWhat the pack is, e.g. strip, bottle, vial
packQtynumber | nullHow much the pack holds, counted in packUnit - or in units of the dosage form (tablets, capsules) when packUnit is null.
packUnitstring | nullUnit of packQty, e.g. ml, gm. Null when packQty is a count.
quantityintegermrpnumber | nullunitPricenumber | nullCustomer price per pack
linePricenumber | nullstoreUnitPricenumber | nullYour store's price per pack, what your store owes LabStack: mrp less your store's own medicine discount
storeLinePricenumber | nullstoreUnitPrice x quantity
Bad request — missing or invalid parameters
statusstringfailureerrorstringUnauthorized — API key missing, invalid, expired or revoked
statusstringfailureerrorstringAn order with this referenceId exists, or an identical request is in progress
statusstringerrorstringorderIdintegerThe existing order, when the referenceId is taken
Too many failed authentication attempts from your address. Every request from that address is refused, whatever key it carries, until the number of seconds in the Retry-After header has passed.
statusstringfailureerrorstringThe documents could not be stored or payment could not be set up. No order was left behind; safe to retry.
statusstringfailureerrorstring{
"status": "success",
"order": {
"orderId": 1234,
"referenceId": "MY-REF-001",
"orderStatus": "PLACED",
"orderType": "HOME_DELIVERY",
"lsPharmacyId": 456,
"pharmacyName": "City Health Pharmacy",
"pickupLocation": null,
"shipmentSpeed": "STANDARD",
"expectedDeliveryBy": "2026-09-29T17:00:00.000Z",
"pharmaSuperOrderId": null,
"isPaymentRequired": false,
"paymentLink": null,
"paymentLinkExpiresAt": null,
"placementError": null,
"documents": [
{
"documentId": 88
}
],
"price": {
"currency": "INR",
"mrpTotal": 290,
"subTotal": 261,
"additionalCharges": 40,
"totalAmount": 301,
"storeSubTotal": 246.5,
"storeTotalAmount": 286.5,
"items": [
{
"drugMasterId": "LSD100001",
"name": "Azithral 500 Tablet",
"packContainer": "strip",
"packQty": 5,
"packUnit": null,
"quantity": 2,
"mrp": 120,
"unitPrice": 108,
"linePrice": 216,
"storeUnitPrice": 102,
"storeLinePrice": 204
},
{
"drugMasterId": "LSD100002",
"name": "Paracetamol 650mg Tablet",
"packContainer": "strip",
"packQty": 15,
"packUnit": null,
"quantity": 1,
"mrp": 50,
"unitPrice": 45,
"linePrice": 45,
"storeUnitPrice": 42.5,
"storeLinePrice": 42.5
}
]
}
}
}Request example
curl -X POST 'https://integration.labstack.in/api/pharma/v1.0/order/placeOrder' \
-H 'ls-api-key: <YOUR_API_KEY>' \
-H 'Content-Type: application/json' \
-d '{
"orderType": "HOME_DELIVERY",
"lsPharmacyId": 456,
"referenceId": "MY-REF-001",
"drugs": [
{
"drugMasterId": "LSD100001",
"quantity": 2
},
{
"drugMasterId": "LSD100002",
"quantity": 1
}
],
"name": "Jane Doe",
"gender": "FEMALE",
"mobile": "9876543210",
"dateOfBirth": "1990-04-12",
"email": "jane@example.com",
"uniqueId": "USR-001",
"address": "42, MG Road",
"city": "Bangalore",
"state": "Karnataka",
"pincode": "560001",
"shipmentSpeed": "STANDARD",
"documents": [
{
"content": "JVBERi0xLjQK...",
"fileName": "prescription.pdf"
}
]
}'Upload prescription
Attaches prescriptions to one of your orders, by orderId or referenceId. Prefer sending them in Place Order's documents, where they reach the pharmacy with the order. forwarding says how these reach the pharmacy. WITH_ORDER - the pharmacy has not received the order yet, and the documents go with it. BY_LABSTACK - the pharmacy already has the order, so LabStack forwards the documents to it; allow time for that before the pharmacy acts on them. A CANCELLED, FULL_DELIVERED or PARTIAL_DELIVERED order takes no documents (409). When some documents are stored and others are not, the call succeeds and errors names the ones that were not; when none are stored it is a 503 and safe to retry.
Request bodyRequired
orderIdintegerOptionalLabStack order id. Send this or referenceId.
referenceIdstringOptionalYour own order id. Send this or orderId.
documentsarray<object>RequiredcontentstringRequiredBase64 file content, at most 10 MB. A data-URI prefix is accepted.
fileNamestringRequiredWith extension: pdf, jpg, jpeg or png
Responses
The documents are attached to the order
statusstringsuccessorderobjectorderIdintegerreferenceIdstring | nullorderStatusstringdocumentsarray<object>documentIdintegerforwardingstringWITH_ORDERBY_LABSTACKerrorsarray<string>Documents that were not stored. Empty when all were.
Bad request — missing or invalid parameters
statusstringfailureerrorstringUnauthorized — API key missing, invalid, expired or revoked
statusstringfailureerrorstringNo such order among yours
statusstringfailureerrorstringThe order is closed and takes no more documents
statusstringfailureerrorstringToo many failed authentication attempts from your address. Every request from that address is refused, whatever key it carries, until the number of seconds in the Retry-After header has passed.
statusstringfailureerrorstring{
"status": "success",
"order": {
"orderId": 1234,
"referenceId": "MY-REF-001",
"orderStatus": "CONFIRMED",
"documents": [
{
"documentId": 89
}
],
"forwarding": "BY_LABSTACK",
"errors": []
}
}Request example
curl -X POST 'https://integration.labstack.in/api/pharma/v1.0/order/uploadPrescription' \
-H 'ls-api-key: <YOUR_API_KEY>' \
-H 'Content-Type: application/json' \
-d '{
"orderId": 1234,
"documents": [
{
"content": "JVBERi0xLjQK...",
"fileName": "prescription.pdf"
}
]
}'