Get an order info.
curl --request GET \
--url https://api.aasaan.shop/api/v1/stores/orders/{orderId} \
--header 'x-api-key: <api-key>'import requests
url = "https://api.aasaan.shop/api/v1/stores/orders/{orderId}"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.aasaan.shop/api/v1/stores/orders/{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/{orderId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://api.aasaan.shop/api/v1/stores/orders/{orderId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.aasaan.shop/api/v1/stores/orders/{orderId}")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aasaan.shop/api/v1/stores/orders/{orderId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
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
Get an order info.
Get order details.
GET
/
orders
/
{orderId}
Get an order info.
curl --request GET \
--url https://api.aasaan.shop/api/v1/stores/orders/{orderId} \
--header 'x-api-key: <api-key>'import requests
url = "https://api.aasaan.shop/api/v1/stores/orders/{orderId}"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.aasaan.shop/api/v1/stores/orders/{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/{orderId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://api.aasaan.shop/api/v1/stores/orders/{orderId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.aasaan.shop/api/v1/stores/orders/{orderId}")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aasaan.shop/api/v1/stores/orders/{orderId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
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"
}
}Response
Get an order by id.
