curl --request POST \
--url https://api.eka.care/ipd/service/dawakhana/orders/{order_id}/return \
--header 'Content-Type: application/json' \
--header 'auth: <auth>' \
--data '
{
"lines": [
{
"itemId": "66f1cd07e4b0a1b2c3d4ef0b",
"returnQty": 4
}
],
"reason": "Patient discharged early"
}
'import requests
url = "https://api.eka.care/ipd/service/dawakhana/orders/{order_id}/return"
payload = {
"lines": [
{
"itemId": "66f1cd07e4b0a1b2c3d4ef0b",
"returnQty": 4
}
],
"reason": "Patient discharged early"
}
headers = {
"auth": "<auth>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {auth: '<auth>', 'Content-Type': 'application/json'},
body: JSON.stringify({
lines: [{itemId: '66f1cd07e4b0a1b2c3d4ef0b', returnQty: 4}],
reason: 'Patient discharged early'
})
};
fetch('https://api.eka.care/ipd/service/dawakhana/orders/{order_id}/return', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.post("https://api.eka.care/ipd/service/dawakhana/orders/{order_id}/return")
.header("auth", "<auth>")
.header("Content-Type", "application/json")
.body("{\n \"lines\": [\n {\n \"itemId\": \"66f1cd07e4b0a1b2c3d4ef0b\",\n \"returnQty\": 4\n }\n ],\n \"reason\": \"Patient discharged early\"\n}")
.asString();using RestSharp;
var options = new RestClientOptions("https://api.eka.care/ipd/service/dawakhana/orders/{order_id}/return");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("auth", "<auth>");
request.AddJsonBody("{\n \"lines\": [\n {\n \"itemId\": \"66f1cd07e4b0a1b2c3d4ef0b\",\n \"returnQty\": 4\n }\n ],\n \"reason\": \"Patient discharged early\"\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
require 'uri'
require 'net/http'
url = URI("https://api.eka.care/ipd/service/dawakhana/orders/{order_id}/return")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["auth"] = '<auth>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"lines\": [\n {\n \"itemId\": \"66f1cd07e4b0a1b2c3d4ef0b\",\n \"returnQty\": 4\n }\n ],\n \"reason\": \"Patient discharged early\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": "66f1cd07e4b0a1b2c3d4ef0a",
"admissionId": "a1b2c3d4-5678-90ab-cdef-1234567890ab",
"kind": "order",
"orderNumber": "DW-7Q2K9F3M",
"status": "PARTIALLY_RETURNED",
"createdBy": "161467756044203",
"isCollected": false,
"provider": "dawakhana",
"billedTotal": 45,
"fulfilmentType": "FULL",
"returnedBy": "161467756044204",
"returnedByName": "Meena Iyer",
"returnedAt": "2026-10-07T16:00:00.000Z",
"returnReason": "Patient discharged early",
"returnedTotal": 18,
"createdAt": "2026-10-07T12:10:00.000Z",
"updatedAt": "2026-10-07T16:00:00.000Z",
"lines": [
{
"id": "66f1cd07e4b0a1b2c3d4ef0b",
"name": "Paracetamol 500mg Tablet",
"orderedQty": 10,
"fulfilledQty": 10,
"rate": 4.5,
"amount": 45,
"returnedQty": 4,
"lineStatus": "FULFILLED"
}
]
}
}{
"success": false,
"error": "Only a dispatched order can be returned"
}{
"message": "<string>"
}{
"success": false,
"error": "Order not found"
}Return Dawakhana Order
Overview
This API returns medicines against a dispatched Dawakhana order of your workspace. Only an order in status DISPATCHED or PARTIALLY_RETURNED can be returned, so an order can be returned in several steps.
For each line sent, returnQty is capped at the quantity still outstanding (fulfilled minus already returned); lines with nothing left to return are skipped. A line whose whole fulfilled quantity is back becomes RETURNED. The order moves to RETURNED when every fulfilled line is fully returned, otherwise to PARTIALLY_RETURNED.
The returned amount (returnQty × rate) is deducted from the admission’s bill and added to the order’s returnedTotal. A return order (kind: return, with parentOrderId set to this order) is also created. The response is the original order with its updated lines.
curl --request POST \
--url https://api.eka.care/ipd/service/dawakhana/orders/{order_id}/return \
--header 'Content-Type: application/json' \
--header 'auth: <auth>' \
--data '
{
"lines": [
{
"itemId": "66f1cd07e4b0a1b2c3d4ef0b",
"returnQty": 4
}
],
"reason": "Patient discharged early"
}
'import requests
url = "https://api.eka.care/ipd/service/dawakhana/orders/{order_id}/return"
payload = {
"lines": [
{
"itemId": "66f1cd07e4b0a1b2c3d4ef0b",
"returnQty": 4
}
],
"reason": "Patient discharged early"
}
headers = {
"auth": "<auth>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {auth: '<auth>', 'Content-Type': 'application/json'},
body: JSON.stringify({
lines: [{itemId: '66f1cd07e4b0a1b2c3d4ef0b', returnQty: 4}],
reason: 'Patient discharged early'
})
};
fetch('https://api.eka.care/ipd/service/dawakhana/orders/{order_id}/return', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.post("https://api.eka.care/ipd/service/dawakhana/orders/{order_id}/return")
.header("auth", "<auth>")
.header("Content-Type", "application/json")
.body("{\n \"lines\": [\n {\n \"itemId\": \"66f1cd07e4b0a1b2c3d4ef0b\",\n \"returnQty\": 4\n }\n ],\n \"reason\": \"Patient discharged early\"\n}")
.asString();using RestSharp;
var options = new RestClientOptions("https://api.eka.care/ipd/service/dawakhana/orders/{order_id}/return");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("auth", "<auth>");
request.AddJsonBody("{\n \"lines\": [\n {\n \"itemId\": \"66f1cd07e4b0a1b2c3d4ef0b\",\n \"returnQty\": 4\n }\n ],\n \"reason\": \"Patient discharged early\"\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
require 'uri'
require 'net/http'
url = URI("https://api.eka.care/ipd/service/dawakhana/orders/{order_id}/return")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["auth"] = '<auth>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"lines\": [\n {\n \"itemId\": \"66f1cd07e4b0a1b2c3d4ef0b\",\n \"returnQty\": 4\n }\n ],\n \"reason\": \"Patient discharged early\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": "66f1cd07e4b0a1b2c3d4ef0a",
"admissionId": "a1b2c3d4-5678-90ab-cdef-1234567890ab",
"kind": "order",
"orderNumber": "DW-7Q2K9F3M",
"status": "PARTIALLY_RETURNED",
"createdBy": "161467756044203",
"isCollected": false,
"provider": "dawakhana",
"billedTotal": 45,
"fulfilmentType": "FULL",
"returnedBy": "161467756044204",
"returnedByName": "Meena Iyer",
"returnedAt": "2026-10-07T16:00:00.000Z",
"returnReason": "Patient discharged early",
"returnedTotal": 18,
"createdAt": "2026-10-07T12:10:00.000Z",
"updatedAt": "2026-10-07T16:00:00.000Z",
"lines": [
{
"id": "66f1cd07e4b0a1b2c3d4ef0b",
"name": "Paracetamol 500mg Tablet",
"orderedQty": 10,
"fulfilledQty": 10,
"rate": 4.5,
"amount": 45,
"returnedQty": 4,
"lineStatus": "FULFILLED"
}
]
}
}{
"success": false,
"error": "Only a dispatched order can be returned"
}{
"message": "<string>"
}{
"success": false,
"error": "Order not found"
}Headers
Path Parameters
Id of the dispatched Dawakhana order.
Body
The quantity being returned per line.
Was this page helpful?

