Skip to main content
GET
/
api-order
/
orders
/
user
Get order by user
curl --request GET \
  --url https://prod01-apigw.{customer_name}.fabric.zone/api-order/orders/user \
  --header 'Authorization: <authorization>' \
  --header 'x-site-context: <x-site-context>'
import requests

url = "https://prod01-apigw.{customer_name}.fabric.zone/api-order/orders/user"

headers = {
    "x-site-context": "<x-site-context>",
    "Authorization": "<authorization>"
}

response = requests.get(url, headers=headers)

print(response.text)
const options = {
  method: 'GET',
  headers: {'x-site-context': '<x-site-context>', Authorization: '<authorization>'}
};

fetch('https://prod01-apigw.{customer_name}.fabric.zone/api-order/orders/user', 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/user",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "Authorization: <authorization>",
    "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"
	"net/http"
	"io"
)

func main() {

	url := "https://prod01-apigw.{customer_name}.fabric.zone/api-order/orders/user"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("x-site-context", "<x-site-context>")
	req.Header.Add("Authorization", "<authorization>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://prod01-apigw.{customer_name}.fabric.zone/api-order/orders/user")
  .header("x-site-context", "<x-site-context>")
  .header("Authorization", "<authorization>")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://prod01-apigw.{customer_name}.fabric.zone/api-order/orders/user")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["x-site-context"] = '<x-site-context>'
request["Authorization"] = '<authorization>'

response = http.request(request)
puts response.read_body
{
  "query": {
    "limit": 2,
    "offset": 0,
    "count": 19,
    "orderTotalSum": 31719.46,
    "orderAverage": 1669.45,
    "totalQuantitySum": 132,
    "statusCounts": {
      "ORDER_CREATED": 13,
      "ORDER_CONFIRMED": 0,
      "ORDER_CANCELLED": 1,
      "ORDER_PARTIALLY_SHIPPED": 0,
      "ORDER_SHIPPED": 2,
      "ORDER_PARTIALLY_DELIVERED": 0,
      "ORDER_DELIVERED": 0,
      "ORDER_RETURNED": 0,
      "ORDER_PARTIALLY_RETURNED": 0,
      "ORDER_PAYMENT_AUTHORIZED": 2,
      "ORDER_PAYMENT_INVALID": 0,
      "ORDER_FULFILLED": 0,
      "ORDER_PARTIALLY_FULFILLED": 1
    }
  },
  "orders": [
    {
      "_id": "60ca5d3dc0fac00008e64c91",
      "tags": "<array>",
      "cartId": "60ca5b6ae3b5d900081ae44a",
      "customerUserId": "60c128045a38bf0009ad6502",
      "attributes": "<array>",
      "customerEmail": "mike@fabric.inc",
      "orderCurrency": "USD",
      "orderTotal": 90.5,
      "taxTotal": 0.5,
      "channel": 12,
      "status": "ORDER_CREATED",
      "statusLog": "Order has been created",
      "orderReference": "1635-8532-92190",
      "orderId": "8677-7648-19307",
      "shipTo": [
        {
          "pickupPerson": {
            "name": {
              "first": "John",
              "last": "Doe"
            },
            "phone": {
              "number": 8087769338,
              "kind": "Mobile"
            },
            "email": "us@fabric.inc"
          },
          "altPickupPerson": {
            "name": {
              "first": "first",
              "last": "last"
            },
            "phone": {
              "number": 8087769338,
              "kind": "Mobile"
            },
            "email": "first@fabric.inc"
          },
          "promosApplied": "<array>",
          "_id": "60ca5c1c9f490e0008020b28",
          "shipToType": "BOPIS",
          "taxCode": "FR1000",
          "shipToId": 390,
          "price": 0,
          "currency": null,
          "shipmentMethodId": null,
          "estimatedTax": 0.5,
          "shipmentCarrier": null,
          "shipmentMethod": null,
          "total": 0.5,
          "id": "60ca5c1c9f490e0008020b28"
        }
      ],
      "items": [
        {
          "group": [
            1.2312312312312322e+23
          ],
          "promosApplied": "<array>",
          "_id": "60ca5b6ae3b5d900081ae44b",
          "price": 90,
          "weightUnit": "lb",
          "isPickup": true,
          "itemId": 89,
          "quantity": 1,
          "priceListId": 100000,
          "sku": "GardenWoodSofa",
          "taxCode": "tytuy",
          "title": "Garden Wood Sofa",
          "weight": 2345,
          "lineItemId": 1,
          "attributeTotalPrice": 0,
          "attributes": "<array>",
          "warehouseId": "60bf9615e66d120008b37e5e",
          "currency": "USD",
          "shipToId": 390,
          "discount": 0,
          "estimatedTax": 0,
          "total": 90,
          "reservedLocation": [
            {
              "_id": "60ca5d3e06b91d0008427435",
              "warehouseId": "60bf9615e66d120008b37e5e",
              "quantity": 1,
              "id": "60ca5d3e06b91d0008427435"
            }
          ],
          "id": "60ca5b6ae3b5d900081ae44b"
        }
      ],
      "shipments": "<array>",
      "payments": [
        {
          "billToAddress": {
            "name": {
              "first": "John",
              "last": "Smith"
            },
            "phone": {
              "number": 7780811973,
              "kind": "mobile"
            },
            "email": "johnsmith@gmail.com",
            "street1": "600 Congress Ave",
            "street2": "suite 219",
            "city": "Austin",
            "state": "Tx",
            "country": "US",
            "zipCode": 10033
          },
          "shipToId": [
            390
          ],
          "_id": "60ca5d3dc0fac00008e64c94",
          "paymentStatus": "succeeded",
          "amount": 90.5,
          "currency": "USD",
          "paymentIdentifier": {
            "cardIdentifier": 4242
          },
          "paymentMethod": "visa",
          "paymentKind": "CARD_STRIPE",
          "conversion": 1,
          "paymentToken": {
            "token": "pi_1J35DCJxr7zyIFb9axtM3OKv",
            "type": "CARD_STRIPE"
          },
          "id": "60ca5d3dc0fac00008e64c94"
        }
      ],
      "revision": 0,
      "totalQuantity": 1,
      "statusDescriptions": "<array>",
      "events": "<array>",
      "pickups": "<array>",
      "createdAt": "2021-06-16T20:21:17.038Z",
      "updatedAt": "2021-06-16T20:21:18.355Z",
      "__v": 0
    }
  ]
}
{
  "code": "<string>",
  "message": "<string>"
}
{
  "message": "User is not authorized to access this resource with an explicit deny"
}
{
  "code": "<string>",
  "message": "<string>"
}

Headers

x-site-context
string
required

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\"}"

Authorization
string
required

Query Parameters

Pagination parameters
object

Response

Order

query
object
orders
object[]