Update a order status.
curl --request PATCH \
--url https://api.aasaan.shop/api/v1/stores/orders/status/{orderId} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data @- <<EOF
{
"status": "'ORDER_PLACED', 'ACCEPTED', 'SHIPPED', 'UNSHIPPED', 'SENT'"
}
EOFimport requests
url = "https://api.aasaan.shop/api/v1/stores/orders/status/{orderId}"
payload = { "status": "'ORDER_PLACED', 'ACCEPTED', 'SHIPPED', 'UNSHIPPED', 'SENT'" }
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({status: '\'ORDER_PLACED\', \'ACCEPTED\', \'SHIPPED\', \'UNSHIPPED\', \'SENT\''})
};
fetch('https://api.aasaan.shop/api/v1/stores/orders/status/{orderId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.aasaan.shop/api/v1/stores/orders/status/{orderId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'status' => '\'ORDER_PLACED\', \'ACCEPTED\', \'SHIPPED\', \'UNSHIPPED\', \'SENT\''
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.aasaan.shop/api/v1/stores/orders/status/{orderId}"
payload := strings.NewReader("{\n \"status\": \"'ORDER_PLACED', 'ACCEPTED', 'SHIPPED', 'UNSHIPPED', 'SENT'\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.aasaan.shop/api/v1/stores/orders/status/{orderId}")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"status\": \"'ORDER_PLACED', 'ACCEPTED', 'SHIPPED', 'UNSHIPPED', 'SENT'\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aasaan.shop/api/v1/stores/orders/status/{orderId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"status\": \"'ORDER_PLACED', 'ACCEPTED', 'SHIPPED', 'UNSHIPPED', 'SENT'\"\n}"
response = http.request(request)
puts response.read_body{
"id": "623d3455ec3c4b3548eb4a349",
"reference": null,
"number": 1234,
"discount": 120,
"tax": 100,
"total": 1200,
"subtotal": 100,
"date": "2022-06-10T07:51:12.510Z",
"date_created": "2022-03-25T03:17:44.092Z",
"date_modified": "2022-06-10T07:51:12.510Z",
"orderStatus": {
"status": "New Order",
"date": "2022-06-10T07:51:12.510Z"
},
"products": {
"productId": 1234,
"variantId": 1234,
"name": "Test",
"sku": 1234,
"price": 120,
"CGST": 120,
"SGST": 100,
"total": 124,
"quantity": 4
},
"shipping": {
"firstName": "John",
"lastName": "mathews",
"trackingId": 123456,
"carrier": "pickrr",
"weight": 10,
"fee": 100,
"date": "2022-06-10T07:51:12.510Z",
"mobileNumber": 9949891734,
"countryCode": "IN",
"email": "john@gmail.com",
"address": {
"line1": "7-52/1",
"line2": "ram nagar",
"city": "Hyderabad",
"zipcode": 500098,
"state": "Telangana",
"country": "India",
"email": "john@lightbooks"
}
},
"payment": {
"transactionId": 123456,
"amount": 123,
"currency": "INR",
"method": "pre-paid",
"date": "2022-06-10T07:51:12.510Z",
"status": "success",
"statusReason": "Transaction failed due to network error"
}
}Orders
Update a order status.
Update Status.
PATCH
/
orders
/
status
/
{orderId}
Update a order status.
curl --request PATCH \
--url https://api.aasaan.shop/api/v1/stores/orders/status/{orderId} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data @- <<EOF
{
"status": "'ORDER_PLACED', 'ACCEPTED', 'SHIPPED', 'UNSHIPPED', 'SENT'"
}
EOFimport requests
url = "https://api.aasaan.shop/api/v1/stores/orders/status/{orderId}"
payload = { "status": "'ORDER_PLACED', 'ACCEPTED', 'SHIPPED', 'UNSHIPPED', 'SENT'" }
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({status: '\'ORDER_PLACED\', \'ACCEPTED\', \'SHIPPED\', \'UNSHIPPED\', \'SENT\''})
};
fetch('https://api.aasaan.shop/api/v1/stores/orders/status/{orderId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.aasaan.shop/api/v1/stores/orders/status/{orderId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'status' => '\'ORDER_PLACED\', \'ACCEPTED\', \'SHIPPED\', \'UNSHIPPED\', \'SENT\''
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.aasaan.shop/api/v1/stores/orders/status/{orderId}"
payload := strings.NewReader("{\n \"status\": \"'ORDER_PLACED', 'ACCEPTED', 'SHIPPED', 'UNSHIPPED', 'SENT'\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.aasaan.shop/api/v1/stores/orders/status/{orderId}")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"status\": \"'ORDER_PLACED', 'ACCEPTED', 'SHIPPED', 'UNSHIPPED', 'SENT'\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aasaan.shop/api/v1/stores/orders/status/{orderId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"status\": \"'ORDER_PLACED', 'ACCEPTED', 'SHIPPED', 'UNSHIPPED', 'SENT'\"\n}"
response = http.request(request)
puts response.read_body{
"id": "623d3455ec3c4b3548eb4a349",
"reference": null,
"number": 1234,
"discount": 120,
"tax": 100,
"total": 1200,
"subtotal": 100,
"date": "2022-06-10T07:51:12.510Z",
"date_created": "2022-03-25T03:17:44.092Z",
"date_modified": "2022-06-10T07:51:12.510Z",
"orderStatus": {
"status": "New Order",
"date": "2022-06-10T07:51:12.510Z"
},
"products": {
"productId": 1234,
"variantId": 1234,
"name": "Test",
"sku": 1234,
"price": 120,
"CGST": 120,
"SGST": 100,
"total": 124,
"quantity": 4
},
"shipping": {
"firstName": "John",
"lastName": "mathews",
"trackingId": 123456,
"carrier": "pickrr",
"weight": 10,
"fee": 100,
"date": "2022-06-10T07:51:12.510Z",
"mobileNumber": 9949891734,
"countryCode": "IN",
"email": "john@gmail.com",
"address": {
"line1": "7-52/1",
"line2": "ram nagar",
"city": "Hyderabad",
"zipcode": 500098,
"state": "Telangana",
"country": "India",
"email": "john@lightbooks"
}
},
"payment": {
"transactionId": 123456,
"amount": 123,
"currency": "INR",
"method": "pre-paid",
"date": "2022-06-10T07:51:12.510Z",
"status": "success",
"statusReason": "Transaction failed due to network error"
}
}Body
application/json
Response
Get an order by id.
