Order query
curl --request POST \
--url https://prod01-apigw.{customer_name}.fabric.zone/api-order/orders/query \
--header 'Content-Type: application/json' \
--header 'x-site-context: <x-site-context>' \
--data '
{
"offset": 0,
"limit": 10,
"sortBy": "createdAt",
"sortDirection": "desc",
"filters": {
"status": [
"ORDER_CREATED",
"ORDER_PAYMENT_AUTHORIZED"
],
"date": {
"gte": "2020-11-01T18:12:03.412Z",
"lte": "2022-12-03T18:12:03.412Z"
},
"orderTotal": {},
"totalQuantity": {},
"attributes": [
{
"attributeId": "60119337cb662800075717f8",
"value": "blue"
}
],
"customerUserId": [
"<string>"
],
"customerEmail": [
"<string>"
],
"shipTo": [
{
"address": {
"name": {
"first": "Mark",
"middle": "p",
"last": "styler"
},
"phone": {
"number": "555-555-5555",
"kind": "mobile"
},
"isValidated": false,
"email": "mark@google.com",
"street1": "10400 NE 4th St",
"street2": "Suite 500",
"city": "Bellevue",
"state": "WA",
"country": "USA",
"zipCode": "98004",
"kind": "Ship to address"
},
"delivery": {
"actual": "<string>"
},
"shipping": {
"actual": "<string>"
},
"promosApplied": [
{
"name": "test1"
}
],
"_id": "602c1511fcc5e900078ba4af",
"shipToId": 1000001,
"shipToType": "SHIP_TO_ADDRESS",
"price": 24.87,
"currency": "USD",
"estimatedTax": 10,
"committedTax": 10,
"total": 34.87,
"taxCode": "FR020000",
"shipmentCarrier": "Fedex",
"shipmentMethod": "Express",
"shipmentMethodId": "10000001",
"promisedDeliveryDate": "2021-02-14T00:00:00.000Z",
"shipmentInstructions": "Leave at back door",
"shipmentStatus": "Delivered",
"readyForPickups": "<array>",
"id": "602c1511fcc5e900078ba4af"
}
]
}
}
'import requests
url = "https://prod01-apigw.{customer_name}.fabric.zone/api-order/orders/query"
payload = {
"offset": 0,
"limit": 10,
"sortBy": "createdAt",
"sortDirection": "desc",
"filters": {
"status": ["ORDER_CREATED", "ORDER_PAYMENT_AUTHORIZED"],
"date": {
"gte": "2020-11-01T18:12:03.412Z",
"lte": "2022-12-03T18:12:03.412Z"
},
"orderTotal": {},
"totalQuantity": {},
"attributes": [
{
"attributeId": "60119337cb662800075717f8",
"value": "blue"
}
],
"customerUserId": ["<string>"],
"customerEmail": ["<string>"],
"shipTo": [
{
"address": {
"name": {
"first": "Mark",
"middle": "p",
"last": "styler"
},
"phone": {
"number": "555-555-5555",
"kind": "mobile"
},
"isValidated": False,
"email": "mark@google.com",
"street1": "10400 NE 4th St",
"street2": "Suite 500",
"city": "Bellevue",
"state": "WA",
"country": "USA",
"zipCode": "98004",
"kind": "Ship to address"
},
"delivery": { "actual": "<string>" },
"shipping": { "actual": "<string>" },
"promosApplied": [{ "name": "test1" }],
"_id": "602c1511fcc5e900078ba4af",
"shipToId": 1000001,
"shipToType": "SHIP_TO_ADDRESS",
"price": 24.87,
"currency": "USD",
"estimatedTax": 10,
"committedTax": 10,
"total": 34.87,
"taxCode": "FR020000",
"shipmentCarrier": "Fedex",
"shipmentMethod": "Express",
"shipmentMethodId": "10000001",
"promisedDeliveryDate": "2021-02-14T00:00:00.000Z",
"shipmentInstructions": "Leave at back door",
"shipmentStatus": "Delivered",
"readyForPickups": "<array>",
"id": "602c1511fcc5e900078ba4af"
}
]
}
}
headers = {
"x-site-context": "<x-site-context>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-site-context': '<x-site-context>', 'Content-Type': 'application/json'},
body: JSON.stringify({
offset: 0,
limit: 10,
sortBy: 'createdAt',
sortDirection: 'desc',
filters: {
status: ['ORDER_CREATED', 'ORDER_PAYMENT_AUTHORIZED'],
date: {gte: '2020-11-01T18:12:03.412Z', lte: '2022-12-03T18:12:03.412Z'},
orderTotal: {},
totalQuantity: {},
attributes: [{attributeId: '60119337cb662800075717f8', value: 'blue'}],
customerUserId: ['<string>'],
customerEmail: ['<string>'],
shipTo: [
{
address: {
name: {first: 'Mark', middle: 'p', last: 'styler'},
phone: {number: '555-555-5555', kind: 'mobile'},
isValidated: false,
email: 'mark@google.com',
street1: '10400 NE 4th St',
street2: 'Suite 500',
city: 'Bellevue',
state: 'WA',
country: 'USA',
zipCode: '98004',
kind: 'Ship to address'
},
delivery: {actual: '<string>'},
shipping: {actual: '<string>'},
promosApplied: [{name: 'test1'}],
_id: '602c1511fcc5e900078ba4af',
shipToId: 1000001,
shipToType: 'SHIP_TO_ADDRESS',
price: 24.87,
currency: 'USD',
estimatedTax: 10,
committedTax: 10,
total: 34.87,
taxCode: 'FR020000',
shipmentCarrier: 'Fedex',
shipmentMethod: 'Express',
shipmentMethodId: '10000001',
promisedDeliveryDate: '2021-02-14T00:00:00.000Z',
shipmentInstructions: 'Leave at back door',
shipmentStatus: 'Delivered',
readyForPickups: '<array>',
id: '602c1511fcc5e900078ba4af'
}
]
}
})
};
fetch('https://prod01-apigw.{customer_name}.fabric.zone/api-order/orders/query', 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://prod01-apigw.{customer_name}.fabric.zone/api-order/orders/query",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'offset' => 0,
'limit' => 10,
'sortBy' => 'createdAt',
'sortDirection' => 'desc',
'filters' => [
'status' => [
'ORDER_CREATED',
'ORDER_PAYMENT_AUTHORIZED'
],
'date' => [
'gte' => '2020-11-01T18:12:03.412Z',
'lte' => '2022-12-03T18:12:03.412Z'
],
'orderTotal' => [
],
'totalQuantity' => [
],
'attributes' => [
[
'attributeId' => '60119337cb662800075717f8',
'value' => 'blue'
]
],
'customerUserId' => [
'<string>'
],
'customerEmail' => [
'<string>'
],
'shipTo' => [
[
'address' => [
'name' => [
'first' => 'Mark',
'middle' => 'p',
'last' => 'styler'
],
'phone' => [
'number' => '555-555-5555',
'kind' => 'mobile'
],
'isValidated' => false,
'email' => 'mark@google.com',
'street1' => '10400 NE 4th St',
'street2' => 'Suite 500',
'city' => 'Bellevue',
'state' => 'WA',
'country' => 'USA',
'zipCode' => '98004',
'kind' => 'Ship to address'
],
'delivery' => [
'actual' => '<string>'
],
'shipping' => [
'actual' => '<string>'
],
'promosApplied' => [
[
'name' => 'test1'
]
],
'_id' => '602c1511fcc5e900078ba4af',
'shipToId' => 1000001,
'shipToType' => 'SHIP_TO_ADDRESS',
'price' => 24.87,
'currency' => 'USD',
'estimatedTax' => 10,
'committedTax' => 10,
'total' => 34.87,
'taxCode' => 'FR020000',
'shipmentCarrier' => 'Fedex',
'shipmentMethod' => 'Express',
'shipmentMethodId' => '10000001',
'promisedDeliveryDate' => '2021-02-14T00:00:00.000Z',
'shipmentInstructions' => 'Leave at back door',
'shipmentStatus' => 'Delivered',
'readyForPickups' => '<array>',
'id' => '602c1511fcc5e900078ba4af'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-site-context: <x-site-context>"
],
]);
$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://prod01-apigw.{customer_name}.fabric.zone/api-order/orders/query"
payload := strings.NewReader("{\n \"offset\": 0,\n \"limit\": 10,\n \"sortBy\": \"createdAt\",\n \"sortDirection\": \"desc\",\n \"filters\": {\n \"status\": [\n \"ORDER_CREATED\",\n \"ORDER_PAYMENT_AUTHORIZED\"\n ],\n \"date\": {\n \"gte\": \"2020-11-01T18:12:03.412Z\",\n \"lte\": \"2022-12-03T18:12:03.412Z\"\n },\n \"orderTotal\": {},\n \"totalQuantity\": {},\n \"attributes\": [\n {\n \"attributeId\": \"60119337cb662800075717f8\",\n \"value\": \"blue\"\n }\n ],\n \"customerUserId\": [\n \"<string>\"\n ],\n \"customerEmail\": [\n \"<string>\"\n ],\n \"shipTo\": [\n {\n \"address\": {\n \"name\": {\n \"first\": \"Mark\",\n \"middle\": \"p\",\n \"last\": \"styler\"\n },\n \"phone\": {\n \"number\": \"555-555-5555\",\n \"kind\": \"mobile\"\n },\n \"isValidated\": false,\n \"email\": \"mark@google.com\",\n \"street1\": \"10400 NE 4th St\",\n \"street2\": \"Suite 500\",\n \"city\": \"Bellevue\",\n \"state\": \"WA\",\n \"country\": \"USA\",\n \"zipCode\": \"98004\",\n \"kind\": \"Ship to address\"\n },\n \"delivery\": {\n \"actual\": \"<string>\"\n },\n \"shipping\": {\n \"actual\": \"<string>\"\n },\n \"promosApplied\": [\n {\n \"name\": \"test1\"\n }\n ],\n \"_id\": \"602c1511fcc5e900078ba4af\",\n \"shipToId\": 1000001,\n \"shipToType\": \"SHIP_TO_ADDRESS\",\n \"price\": 24.87,\n \"currency\": \"USD\",\n \"estimatedTax\": 10,\n \"committedTax\": 10,\n \"total\": 34.87,\n \"taxCode\": \"FR020000\",\n \"shipmentCarrier\": \"Fedex\",\n \"shipmentMethod\": \"Express\",\n \"shipmentMethodId\": \"10000001\",\n \"promisedDeliveryDate\": \"2021-02-14T00:00:00.000Z\",\n \"shipmentInstructions\": \"Leave at back door\",\n \"shipmentStatus\": \"Delivered\",\n \"readyForPickups\": \"<array>\",\n \"id\": \"602c1511fcc5e900078ba4af\"\n }\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-site-context", "<x-site-context>")
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.post("https://prod01-apigw.{customer_name}.fabric.zone/api-order/orders/query")
.header("x-site-context", "<x-site-context>")
.header("Content-Type", "application/json")
.body("{\n \"offset\": 0,\n \"limit\": 10,\n \"sortBy\": \"createdAt\",\n \"sortDirection\": \"desc\",\n \"filters\": {\n \"status\": [\n \"ORDER_CREATED\",\n \"ORDER_PAYMENT_AUTHORIZED\"\n ],\n \"date\": {\n \"gte\": \"2020-11-01T18:12:03.412Z\",\n \"lte\": \"2022-12-03T18:12:03.412Z\"\n },\n \"orderTotal\": {},\n \"totalQuantity\": {},\n \"attributes\": [\n {\n \"attributeId\": \"60119337cb662800075717f8\",\n \"value\": \"blue\"\n }\n ],\n \"customerUserId\": [\n \"<string>\"\n ],\n \"customerEmail\": [\n \"<string>\"\n ],\n \"shipTo\": [\n {\n \"address\": {\n \"name\": {\n \"first\": \"Mark\",\n \"middle\": \"p\",\n \"last\": \"styler\"\n },\n \"phone\": {\n \"number\": \"555-555-5555\",\n \"kind\": \"mobile\"\n },\n \"isValidated\": false,\n \"email\": \"mark@google.com\",\n \"street1\": \"10400 NE 4th St\",\n \"street2\": \"Suite 500\",\n \"city\": \"Bellevue\",\n \"state\": \"WA\",\n \"country\": \"USA\",\n \"zipCode\": \"98004\",\n \"kind\": \"Ship to address\"\n },\n \"delivery\": {\n \"actual\": \"<string>\"\n },\n \"shipping\": {\n \"actual\": \"<string>\"\n },\n \"promosApplied\": [\n {\n \"name\": \"test1\"\n }\n ],\n \"_id\": \"602c1511fcc5e900078ba4af\",\n \"shipToId\": 1000001,\n \"shipToType\": \"SHIP_TO_ADDRESS\",\n \"price\": 24.87,\n \"currency\": \"USD\",\n \"estimatedTax\": 10,\n \"committedTax\": 10,\n \"total\": 34.87,\n \"taxCode\": \"FR020000\",\n \"shipmentCarrier\": \"Fedex\",\n \"shipmentMethod\": \"Express\",\n \"shipmentMethodId\": \"10000001\",\n \"promisedDeliveryDate\": \"2021-02-14T00:00:00.000Z\",\n \"shipmentInstructions\": \"Leave at back door\",\n \"shipmentStatus\": \"Delivered\",\n \"readyForPickups\": \"<array>\",\n \"id\": \"602c1511fcc5e900078ba4af\"\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://prod01-apigw.{customer_name}.fabric.zone/api-order/orders/query")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-site-context"] = '<x-site-context>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"offset\": 0,\n \"limit\": 10,\n \"sortBy\": \"createdAt\",\n \"sortDirection\": \"desc\",\n \"filters\": {\n \"status\": [\n \"ORDER_CREATED\",\n \"ORDER_PAYMENT_AUTHORIZED\"\n ],\n \"date\": {\n \"gte\": \"2020-11-01T18:12:03.412Z\",\n \"lte\": \"2022-12-03T18:12:03.412Z\"\n },\n \"orderTotal\": {},\n \"totalQuantity\": {},\n \"attributes\": [\n {\n \"attributeId\": \"60119337cb662800075717f8\",\n \"value\": \"blue\"\n }\n ],\n \"customerUserId\": [\n \"<string>\"\n ],\n \"customerEmail\": [\n \"<string>\"\n ],\n \"shipTo\": [\n {\n \"address\": {\n \"name\": {\n \"first\": \"Mark\",\n \"middle\": \"p\",\n \"last\": \"styler\"\n },\n \"phone\": {\n \"number\": \"555-555-5555\",\n \"kind\": \"mobile\"\n },\n \"isValidated\": false,\n \"email\": \"mark@google.com\",\n \"street1\": \"10400 NE 4th St\",\n \"street2\": \"Suite 500\",\n \"city\": \"Bellevue\",\n \"state\": \"WA\",\n \"country\": \"USA\",\n \"zipCode\": \"98004\",\n \"kind\": \"Ship to address\"\n },\n \"delivery\": {\n \"actual\": \"<string>\"\n },\n \"shipping\": {\n \"actual\": \"<string>\"\n },\n \"promosApplied\": [\n {\n \"name\": \"test1\"\n }\n ],\n \"_id\": \"602c1511fcc5e900078ba4af\",\n \"shipToId\": 1000001,\n \"shipToType\": \"SHIP_TO_ADDRESS\",\n \"price\": 24.87,\n \"currency\": \"USD\",\n \"estimatedTax\": 10,\n \"committedTax\": 10,\n \"total\": 34.87,\n \"taxCode\": \"FR020000\",\n \"shipmentCarrier\": \"Fedex\",\n \"shipmentMethod\": \"Express\",\n \"shipmentMethodId\": \"10000001\",\n \"promisedDeliveryDate\": \"2021-02-14T00:00:00.000Z\",\n \"shipmentInstructions\": \"Leave at back door\",\n \"shipmentStatus\": \"Delivered\",\n \"readyForPickups\": \"<array>\",\n \"id\": \"602c1511fcc5e900078ba4af\"\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"query": {
"limit": 2,
"offset": 0,
"count": 6,
"orderTotalSum": 13543.5,
"orderAverage": 2257.25,
"totalQuantitySum": 82,
"statusCounts": {
"ORDER_CREATED": 0,
"ORDER_CONFIRMED": 0,
"ORDER_CANCELLED": 0,
"ORDER_PARTIALLY_SHIPPED": 0,
"ORDER_SHIPPED": 0,
"ORDER_PARTIALLY_DELIVERED": 0,
"ORDER_DELIVERED": 0,
"ORDER_RETURNED": 0,
"ORDER_PARTIALLY_RETURNED": 0,
"ORDER_PAYMENT_AUTHORIZED": 0,
"ORDER_PAYMENT_INVALID": 0,
"ORDER_FULFILLED": 0,
"ORDER_PARTIALLY_FULFILLED": 0,
"ORDER_REFUNDED": 6
},
"paymentStatusCounts": {
"succeeded": 3
}
},
"orders": [
{
"_id": "608c8f995cc215000848a8e0",
"tags": "<array>",
"cartId": "608c8c9e79f00c00080fbacc",
"attributes": "<array>",
"customerEmail": "mike@fabric.inc",
"orderCurrency": "USD",
"orderTotal": 950.5,
"taxTotal": 2.5,
"channel": 12,
"status": "ORDER_REFUNDED",
"statusLog": "Order has been shipped",
"orderReference": "9975-7559-14446",
"orderId": "2660-5356-89773",
"shipTo": [
{
"pickupPerson": {
"name": {
"first": "John",
"last": "Doe"
},
"phone": {
"number": 8087769338,
"kind": "Mobile"
},
"email": "johndoe@fabric.inc"
},
"altPickupPerson": {
"name": {
"first": "first",
"last": "last"
},
"phone": {
"number": 8087769338,
"kind": "Mobile"
},
"email": "first@fabric.inc"
},
"promosApplied": "<array>",
"_id": "608c8d2f798c0900083f60ee",
"shipToType": "BOPIS",
"taxCode": "FR1000",
"shipToId": 978,
"price": 0,
"currency": null,
"shipmentMethodId": null,
"estimatedTax": 0,
"shipmentCarrier": null,
"shipmentMethod": null,
"total": 0,
"id": "608c8d2f798c0900083f60ee"
}
],
"items": [
{
"group": [
1.2312312312312322e+23
],
"promosApplied": "<array>",
"_id": "608c8cd679f00c00080fbace",
"price": 900,
"weightUnit": "lb",
"isPickup": true,
"itemId": 1000000051,
"quantity": 1,
"priceListId": 100269,
"sku": 1538910,
"taxCode": "PH060771",
"title": "Luminous Cushion Lagoon",
"weight": 1,
"lineItemId": 1,
"attributeTotalPrice": 0,
"attributes": "<array>",
"warehouseId": "605d0c47c87d0e0008a3b5a8",
"currency": "USD",
"shipToId": 978,
"discount": 0,
"estimatedTax": 1,
"total": 901,
"reservedLocation": [
{
"_id": "608c8f9de4b526000842505f",
"warehouseId": "605d0c47c87d0e0008a3b5a8",
"quantity": 1,
"id": "608c8f9de4b526000842505f"
}
],
"id": "608c8cd679f00c00080fbace"
}
],
"shipments": [
{
"_id": "60936b987d5a2f0008e8bea6",
"shippedDate": "2021-05-06T04:07:47.654Z",
"shipToId": 978,
"shipmentCarrier": "USPS",
"shipmentCarrierUrl": "https://tools.usps.com/go/TrackConfirmAction?tRef=fullpage&tLc=2&text28777=&tLabels=65765798989",
"trackingNumber": 65765798989,
"lineItems": [
{
"_id": "60936b987d5a2f0008e8bea7",
"lineItemId": 1,
"quantity": 1,
"id": "60936b987d5a2f0008e8bea7"
}
],
"shipmentStatus": "ORDER_SHIPPED",
"id": "60936b987d5a2f0008e8bea6"
}
],
"revision": 2,
"totalQuantity": 2,
"statusDescriptions": "<array>",
"events": "<array>",
"createdAt": "2021-04-30T23:15:37.094Z",
"updatedAt": "2021-05-06T04:09:09.970Z",
"__v": 0
}
]
}{
"code": "<string>",
"message": "<string>"
}{
"message": "Forbidden"
}{
"code": "<string>",
"message": "<string>"
}Order
Order query
Order query
POST
/
api-order
/
orders
/
query
Order query
curl --request POST \
--url https://prod01-apigw.{customer_name}.fabric.zone/api-order/orders/query \
--header 'Content-Type: application/json' \
--header 'x-site-context: <x-site-context>' \
--data '
{
"offset": 0,
"limit": 10,
"sortBy": "createdAt",
"sortDirection": "desc",
"filters": {
"status": [
"ORDER_CREATED",
"ORDER_PAYMENT_AUTHORIZED"
],
"date": {
"gte": "2020-11-01T18:12:03.412Z",
"lte": "2022-12-03T18:12:03.412Z"
},
"orderTotal": {},
"totalQuantity": {},
"attributes": [
{
"attributeId": "60119337cb662800075717f8",
"value": "blue"
}
],
"customerUserId": [
"<string>"
],
"customerEmail": [
"<string>"
],
"shipTo": [
{
"address": {
"name": {
"first": "Mark",
"middle": "p",
"last": "styler"
},
"phone": {
"number": "555-555-5555",
"kind": "mobile"
},
"isValidated": false,
"email": "mark@google.com",
"street1": "10400 NE 4th St",
"street2": "Suite 500",
"city": "Bellevue",
"state": "WA",
"country": "USA",
"zipCode": "98004",
"kind": "Ship to address"
},
"delivery": {
"actual": "<string>"
},
"shipping": {
"actual": "<string>"
},
"promosApplied": [
{
"name": "test1"
}
],
"_id": "602c1511fcc5e900078ba4af",
"shipToId": 1000001,
"shipToType": "SHIP_TO_ADDRESS",
"price": 24.87,
"currency": "USD",
"estimatedTax": 10,
"committedTax": 10,
"total": 34.87,
"taxCode": "FR020000",
"shipmentCarrier": "Fedex",
"shipmentMethod": "Express",
"shipmentMethodId": "10000001",
"promisedDeliveryDate": "2021-02-14T00:00:00.000Z",
"shipmentInstructions": "Leave at back door",
"shipmentStatus": "Delivered",
"readyForPickups": "<array>",
"id": "602c1511fcc5e900078ba4af"
}
]
}
}
'import requests
url = "https://prod01-apigw.{customer_name}.fabric.zone/api-order/orders/query"
payload = {
"offset": 0,
"limit": 10,
"sortBy": "createdAt",
"sortDirection": "desc",
"filters": {
"status": ["ORDER_CREATED", "ORDER_PAYMENT_AUTHORIZED"],
"date": {
"gte": "2020-11-01T18:12:03.412Z",
"lte": "2022-12-03T18:12:03.412Z"
},
"orderTotal": {},
"totalQuantity": {},
"attributes": [
{
"attributeId": "60119337cb662800075717f8",
"value": "blue"
}
],
"customerUserId": ["<string>"],
"customerEmail": ["<string>"],
"shipTo": [
{
"address": {
"name": {
"first": "Mark",
"middle": "p",
"last": "styler"
},
"phone": {
"number": "555-555-5555",
"kind": "mobile"
},
"isValidated": False,
"email": "mark@google.com",
"street1": "10400 NE 4th St",
"street2": "Suite 500",
"city": "Bellevue",
"state": "WA",
"country": "USA",
"zipCode": "98004",
"kind": "Ship to address"
},
"delivery": { "actual": "<string>" },
"shipping": { "actual": "<string>" },
"promosApplied": [{ "name": "test1" }],
"_id": "602c1511fcc5e900078ba4af",
"shipToId": 1000001,
"shipToType": "SHIP_TO_ADDRESS",
"price": 24.87,
"currency": "USD",
"estimatedTax": 10,
"committedTax": 10,
"total": 34.87,
"taxCode": "FR020000",
"shipmentCarrier": "Fedex",
"shipmentMethod": "Express",
"shipmentMethodId": "10000001",
"promisedDeliveryDate": "2021-02-14T00:00:00.000Z",
"shipmentInstructions": "Leave at back door",
"shipmentStatus": "Delivered",
"readyForPickups": "<array>",
"id": "602c1511fcc5e900078ba4af"
}
]
}
}
headers = {
"x-site-context": "<x-site-context>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-site-context': '<x-site-context>', 'Content-Type': 'application/json'},
body: JSON.stringify({
offset: 0,
limit: 10,
sortBy: 'createdAt',
sortDirection: 'desc',
filters: {
status: ['ORDER_CREATED', 'ORDER_PAYMENT_AUTHORIZED'],
date: {gte: '2020-11-01T18:12:03.412Z', lte: '2022-12-03T18:12:03.412Z'},
orderTotal: {},
totalQuantity: {},
attributes: [{attributeId: '60119337cb662800075717f8', value: 'blue'}],
customerUserId: ['<string>'],
customerEmail: ['<string>'],
shipTo: [
{
address: {
name: {first: 'Mark', middle: 'p', last: 'styler'},
phone: {number: '555-555-5555', kind: 'mobile'},
isValidated: false,
email: 'mark@google.com',
street1: '10400 NE 4th St',
street2: 'Suite 500',
city: 'Bellevue',
state: 'WA',
country: 'USA',
zipCode: '98004',
kind: 'Ship to address'
},
delivery: {actual: '<string>'},
shipping: {actual: '<string>'},
promosApplied: [{name: 'test1'}],
_id: '602c1511fcc5e900078ba4af',
shipToId: 1000001,
shipToType: 'SHIP_TO_ADDRESS',
price: 24.87,
currency: 'USD',
estimatedTax: 10,
committedTax: 10,
total: 34.87,
taxCode: 'FR020000',
shipmentCarrier: 'Fedex',
shipmentMethod: 'Express',
shipmentMethodId: '10000001',
promisedDeliveryDate: '2021-02-14T00:00:00.000Z',
shipmentInstructions: 'Leave at back door',
shipmentStatus: 'Delivered',
readyForPickups: '<array>',
id: '602c1511fcc5e900078ba4af'
}
]
}
})
};
fetch('https://prod01-apigw.{customer_name}.fabric.zone/api-order/orders/query', 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://prod01-apigw.{customer_name}.fabric.zone/api-order/orders/query",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'offset' => 0,
'limit' => 10,
'sortBy' => 'createdAt',
'sortDirection' => 'desc',
'filters' => [
'status' => [
'ORDER_CREATED',
'ORDER_PAYMENT_AUTHORIZED'
],
'date' => [
'gte' => '2020-11-01T18:12:03.412Z',
'lte' => '2022-12-03T18:12:03.412Z'
],
'orderTotal' => [
],
'totalQuantity' => [
],
'attributes' => [
[
'attributeId' => '60119337cb662800075717f8',
'value' => 'blue'
]
],
'customerUserId' => [
'<string>'
],
'customerEmail' => [
'<string>'
],
'shipTo' => [
[
'address' => [
'name' => [
'first' => 'Mark',
'middle' => 'p',
'last' => 'styler'
],
'phone' => [
'number' => '555-555-5555',
'kind' => 'mobile'
],
'isValidated' => false,
'email' => 'mark@google.com',
'street1' => '10400 NE 4th St',
'street2' => 'Suite 500',
'city' => 'Bellevue',
'state' => 'WA',
'country' => 'USA',
'zipCode' => '98004',
'kind' => 'Ship to address'
],
'delivery' => [
'actual' => '<string>'
],
'shipping' => [
'actual' => '<string>'
],
'promosApplied' => [
[
'name' => 'test1'
]
],
'_id' => '602c1511fcc5e900078ba4af',
'shipToId' => 1000001,
'shipToType' => 'SHIP_TO_ADDRESS',
'price' => 24.87,
'currency' => 'USD',
'estimatedTax' => 10,
'committedTax' => 10,
'total' => 34.87,
'taxCode' => 'FR020000',
'shipmentCarrier' => 'Fedex',
'shipmentMethod' => 'Express',
'shipmentMethodId' => '10000001',
'promisedDeliveryDate' => '2021-02-14T00:00:00.000Z',
'shipmentInstructions' => 'Leave at back door',
'shipmentStatus' => 'Delivered',
'readyForPickups' => '<array>',
'id' => '602c1511fcc5e900078ba4af'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-site-context: <x-site-context>"
],
]);
$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://prod01-apigw.{customer_name}.fabric.zone/api-order/orders/query"
payload := strings.NewReader("{\n \"offset\": 0,\n \"limit\": 10,\n \"sortBy\": \"createdAt\",\n \"sortDirection\": \"desc\",\n \"filters\": {\n \"status\": [\n \"ORDER_CREATED\",\n \"ORDER_PAYMENT_AUTHORIZED\"\n ],\n \"date\": {\n \"gte\": \"2020-11-01T18:12:03.412Z\",\n \"lte\": \"2022-12-03T18:12:03.412Z\"\n },\n \"orderTotal\": {},\n \"totalQuantity\": {},\n \"attributes\": [\n {\n \"attributeId\": \"60119337cb662800075717f8\",\n \"value\": \"blue\"\n }\n ],\n \"customerUserId\": [\n \"<string>\"\n ],\n \"customerEmail\": [\n \"<string>\"\n ],\n \"shipTo\": [\n {\n \"address\": {\n \"name\": {\n \"first\": \"Mark\",\n \"middle\": \"p\",\n \"last\": \"styler\"\n },\n \"phone\": {\n \"number\": \"555-555-5555\",\n \"kind\": \"mobile\"\n },\n \"isValidated\": false,\n \"email\": \"mark@google.com\",\n \"street1\": \"10400 NE 4th St\",\n \"street2\": \"Suite 500\",\n \"city\": \"Bellevue\",\n \"state\": \"WA\",\n \"country\": \"USA\",\n \"zipCode\": \"98004\",\n \"kind\": \"Ship to address\"\n },\n \"delivery\": {\n \"actual\": \"<string>\"\n },\n \"shipping\": {\n \"actual\": \"<string>\"\n },\n \"promosApplied\": [\n {\n \"name\": \"test1\"\n }\n ],\n \"_id\": \"602c1511fcc5e900078ba4af\",\n \"shipToId\": 1000001,\n \"shipToType\": \"SHIP_TO_ADDRESS\",\n \"price\": 24.87,\n \"currency\": \"USD\",\n \"estimatedTax\": 10,\n \"committedTax\": 10,\n \"total\": 34.87,\n \"taxCode\": \"FR020000\",\n \"shipmentCarrier\": \"Fedex\",\n \"shipmentMethod\": \"Express\",\n \"shipmentMethodId\": \"10000001\",\n \"promisedDeliveryDate\": \"2021-02-14T00:00:00.000Z\",\n \"shipmentInstructions\": \"Leave at back door\",\n \"shipmentStatus\": \"Delivered\",\n \"readyForPickups\": \"<array>\",\n \"id\": \"602c1511fcc5e900078ba4af\"\n }\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-site-context", "<x-site-context>")
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.post("https://prod01-apigw.{customer_name}.fabric.zone/api-order/orders/query")
.header("x-site-context", "<x-site-context>")
.header("Content-Type", "application/json")
.body("{\n \"offset\": 0,\n \"limit\": 10,\n \"sortBy\": \"createdAt\",\n \"sortDirection\": \"desc\",\n \"filters\": {\n \"status\": [\n \"ORDER_CREATED\",\n \"ORDER_PAYMENT_AUTHORIZED\"\n ],\n \"date\": {\n \"gte\": \"2020-11-01T18:12:03.412Z\",\n \"lte\": \"2022-12-03T18:12:03.412Z\"\n },\n \"orderTotal\": {},\n \"totalQuantity\": {},\n \"attributes\": [\n {\n \"attributeId\": \"60119337cb662800075717f8\",\n \"value\": \"blue\"\n }\n ],\n \"customerUserId\": [\n \"<string>\"\n ],\n \"customerEmail\": [\n \"<string>\"\n ],\n \"shipTo\": [\n {\n \"address\": {\n \"name\": {\n \"first\": \"Mark\",\n \"middle\": \"p\",\n \"last\": \"styler\"\n },\n \"phone\": {\n \"number\": \"555-555-5555\",\n \"kind\": \"mobile\"\n },\n \"isValidated\": false,\n \"email\": \"mark@google.com\",\n \"street1\": \"10400 NE 4th St\",\n \"street2\": \"Suite 500\",\n \"city\": \"Bellevue\",\n \"state\": \"WA\",\n \"country\": \"USA\",\n \"zipCode\": \"98004\",\n \"kind\": \"Ship to address\"\n },\n \"delivery\": {\n \"actual\": \"<string>\"\n },\n \"shipping\": {\n \"actual\": \"<string>\"\n },\n \"promosApplied\": [\n {\n \"name\": \"test1\"\n }\n ],\n \"_id\": \"602c1511fcc5e900078ba4af\",\n \"shipToId\": 1000001,\n \"shipToType\": \"SHIP_TO_ADDRESS\",\n \"price\": 24.87,\n \"currency\": \"USD\",\n \"estimatedTax\": 10,\n \"committedTax\": 10,\n \"total\": 34.87,\n \"taxCode\": \"FR020000\",\n \"shipmentCarrier\": \"Fedex\",\n \"shipmentMethod\": \"Express\",\n \"shipmentMethodId\": \"10000001\",\n \"promisedDeliveryDate\": \"2021-02-14T00:00:00.000Z\",\n \"shipmentInstructions\": \"Leave at back door\",\n \"shipmentStatus\": \"Delivered\",\n \"readyForPickups\": \"<array>\",\n \"id\": \"602c1511fcc5e900078ba4af\"\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://prod01-apigw.{customer_name}.fabric.zone/api-order/orders/query")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-site-context"] = '<x-site-context>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"offset\": 0,\n \"limit\": 10,\n \"sortBy\": \"createdAt\",\n \"sortDirection\": \"desc\",\n \"filters\": {\n \"status\": [\n \"ORDER_CREATED\",\n \"ORDER_PAYMENT_AUTHORIZED\"\n ],\n \"date\": {\n \"gte\": \"2020-11-01T18:12:03.412Z\",\n \"lte\": \"2022-12-03T18:12:03.412Z\"\n },\n \"orderTotal\": {},\n \"totalQuantity\": {},\n \"attributes\": [\n {\n \"attributeId\": \"60119337cb662800075717f8\",\n \"value\": \"blue\"\n }\n ],\n \"customerUserId\": [\n \"<string>\"\n ],\n \"customerEmail\": [\n \"<string>\"\n ],\n \"shipTo\": [\n {\n \"address\": {\n \"name\": {\n \"first\": \"Mark\",\n \"middle\": \"p\",\n \"last\": \"styler\"\n },\n \"phone\": {\n \"number\": \"555-555-5555\",\n \"kind\": \"mobile\"\n },\n \"isValidated\": false,\n \"email\": \"mark@google.com\",\n \"street1\": \"10400 NE 4th St\",\n \"street2\": \"Suite 500\",\n \"city\": \"Bellevue\",\n \"state\": \"WA\",\n \"country\": \"USA\",\n \"zipCode\": \"98004\",\n \"kind\": \"Ship to address\"\n },\n \"delivery\": {\n \"actual\": \"<string>\"\n },\n \"shipping\": {\n \"actual\": \"<string>\"\n },\n \"promosApplied\": [\n {\n \"name\": \"test1\"\n }\n ],\n \"_id\": \"602c1511fcc5e900078ba4af\",\n \"shipToId\": 1000001,\n \"shipToType\": \"SHIP_TO_ADDRESS\",\n \"price\": 24.87,\n \"currency\": \"USD\",\n \"estimatedTax\": 10,\n \"committedTax\": 10,\n \"total\": 34.87,\n \"taxCode\": \"FR020000\",\n \"shipmentCarrier\": \"Fedex\",\n \"shipmentMethod\": \"Express\",\n \"shipmentMethodId\": \"10000001\",\n \"promisedDeliveryDate\": \"2021-02-14T00:00:00.000Z\",\n \"shipmentInstructions\": \"Leave at back door\",\n \"shipmentStatus\": \"Delivered\",\n \"readyForPickups\": \"<array>\",\n \"id\": \"602c1511fcc5e900078ba4af\"\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"query": {
"limit": 2,
"offset": 0,
"count": 6,
"orderTotalSum": 13543.5,
"orderAverage": 2257.25,
"totalQuantitySum": 82,
"statusCounts": {
"ORDER_CREATED": 0,
"ORDER_CONFIRMED": 0,
"ORDER_CANCELLED": 0,
"ORDER_PARTIALLY_SHIPPED": 0,
"ORDER_SHIPPED": 0,
"ORDER_PARTIALLY_DELIVERED": 0,
"ORDER_DELIVERED": 0,
"ORDER_RETURNED": 0,
"ORDER_PARTIALLY_RETURNED": 0,
"ORDER_PAYMENT_AUTHORIZED": 0,
"ORDER_PAYMENT_INVALID": 0,
"ORDER_FULFILLED": 0,
"ORDER_PARTIALLY_FULFILLED": 0,
"ORDER_REFUNDED": 6
},
"paymentStatusCounts": {
"succeeded": 3
}
},
"orders": [
{
"_id": "608c8f995cc215000848a8e0",
"tags": "<array>",
"cartId": "608c8c9e79f00c00080fbacc",
"attributes": "<array>",
"customerEmail": "mike@fabric.inc",
"orderCurrency": "USD",
"orderTotal": 950.5,
"taxTotal": 2.5,
"channel": 12,
"status": "ORDER_REFUNDED",
"statusLog": "Order has been shipped",
"orderReference": "9975-7559-14446",
"orderId": "2660-5356-89773",
"shipTo": [
{
"pickupPerson": {
"name": {
"first": "John",
"last": "Doe"
},
"phone": {
"number": 8087769338,
"kind": "Mobile"
},
"email": "johndoe@fabric.inc"
},
"altPickupPerson": {
"name": {
"first": "first",
"last": "last"
},
"phone": {
"number": 8087769338,
"kind": "Mobile"
},
"email": "first@fabric.inc"
},
"promosApplied": "<array>",
"_id": "608c8d2f798c0900083f60ee",
"shipToType": "BOPIS",
"taxCode": "FR1000",
"shipToId": 978,
"price": 0,
"currency": null,
"shipmentMethodId": null,
"estimatedTax": 0,
"shipmentCarrier": null,
"shipmentMethod": null,
"total": 0,
"id": "608c8d2f798c0900083f60ee"
}
],
"items": [
{
"group": [
1.2312312312312322e+23
],
"promosApplied": "<array>",
"_id": "608c8cd679f00c00080fbace",
"price": 900,
"weightUnit": "lb",
"isPickup": true,
"itemId": 1000000051,
"quantity": 1,
"priceListId": 100269,
"sku": 1538910,
"taxCode": "PH060771",
"title": "Luminous Cushion Lagoon",
"weight": 1,
"lineItemId": 1,
"attributeTotalPrice": 0,
"attributes": "<array>",
"warehouseId": "605d0c47c87d0e0008a3b5a8",
"currency": "USD",
"shipToId": 978,
"discount": 0,
"estimatedTax": 1,
"total": 901,
"reservedLocation": [
{
"_id": "608c8f9de4b526000842505f",
"warehouseId": "605d0c47c87d0e0008a3b5a8",
"quantity": 1,
"id": "608c8f9de4b526000842505f"
}
],
"id": "608c8cd679f00c00080fbace"
}
],
"shipments": [
{
"_id": "60936b987d5a2f0008e8bea6",
"shippedDate": "2021-05-06T04:07:47.654Z",
"shipToId": 978,
"shipmentCarrier": "USPS",
"shipmentCarrierUrl": "https://tools.usps.com/go/TrackConfirmAction?tRef=fullpage&tLc=2&text28777=&tLabels=65765798989",
"trackingNumber": 65765798989,
"lineItems": [
{
"_id": "60936b987d5a2f0008e8bea7",
"lineItemId": 1,
"quantity": 1,
"id": "60936b987d5a2f0008e8bea7"
}
],
"shipmentStatus": "ORDER_SHIPPED",
"id": "60936b987d5a2f0008e8bea6"
}
],
"revision": 2,
"totalQuantity": 2,
"statusDescriptions": "<array>",
"events": "<array>",
"createdAt": "2021-04-30T23:15:37.094Z",
"updatedAt": "2021-05-06T04:09:09.970Z",
"__v": 0
}
]
}{
"code": "<string>",
"message": "<string>"
}{
"message": "Forbidden"
}{
"code": "<string>",
"message": "<string>"
}Headers
Example:
"0LybWR49k95cCwYh3cu0waCYoh4H2Eux2J52wn4k"
The x-site-context header is a JSON object that contains information about the source you wish to pull from. The mandatory account is the 24 character identifier found in Copilot. The channel (Sales channel ID), stage (environment name), and date attributes can be used to further narrow the scope of your data source.
Example:
"{\"date\": \"2023-01-01T00:00:00.000Z\", \"channel\": 12, \"account\": \"1234abcd5678efgh9ijklmno\",\"stage\":\"production\"}"
Body
application/json
Was this page helpful?
⌘I
