Create POS order - Fabric

Documentation Index

Fetch the complete documentation index at: /llms.txt

Use this file to discover all available pages before exploring further.

Skip to main content

Create POS order

cURL

curl --request POST \
  --url https://prod01-apigw.yourcompany.fabric.zone/api-order/pos/orders \
  --header 'Content-Type: application/json' \
  --header 'x-site-context: <x-site-context>' \
  --data '
{
  "orderReference": 1234,
  "locationId": "5efcc26a5ee50d00079ca2ab",
  "status": "ORDER_CREATED",
  "channel": 12,
  "orderTotal": 125.33,
  "taxTotal": 5.23,
  "orderCurrency": "USD",
  "statusLog": "Order has been Shipped",
  "customerUserId": "5e3598e3007c5e00080d2bb8",
  "customerAccountId": "5e3598e3007c5e00080d2bb8",
  "customerEmail": "ino@fabric.inc",
  "customerPhone": {
    "number": "555-555-5555",
    "kind": "mobile"
  },
  "shipTo": [\
    {\
      "shipToId": 1000001,\
      "shipToType": "SHIP_TO_ADDRESS",\
      "address": {\
        "name": {\
          "first": "Mark",\
          "middle": "p",\
          "last": "styler"\
        },\
        "email": "mark@google.com",\
        "phone": {\
          "number": "555-555-5555",\
          "kind": "mobile"\
        },\
        "street1": "10400 NE 4th St",\
        "street2": "Suite 500",\
        "city": "Bellevue",\
        "state": "WA",\
        "country": "USA",\
        "zipCode": 98004,\
        "kind": "Ship to address"\
      },\
      "price": 24.8723423,\
      "currency": "USD",\
      "estimatedTax": 10,\
      "committedTax": 10,\
      "promosApplied": [\
        {\
          "name": "test1"\
        }\
      ],\
      "total": 34.87,\
      "taxCode": "FR020000",\
      "shipmentCarrier": "Fedex",\
      "shipmentMethod": "Express",\
      "shipmentMethodId": 10000001,\
      "promisedDeliveryDate": "2021-02-14",\
      "shipmentInstructions": "Leave at back door",\
      "shipmentStatus": "Delivered",\
      "items": [\
        {\
          "lineItemId": 1,\
          "itemId": 1000011127,\
          "sku": 1538910,\
          "group": [\
            "Group1"\
          ],\
          "title": "Luminous Cushion Lagoon",\
          "quantity": 10,\
          "price": 4.5,\
          "discount": 1,\
          "currency": "USD",\
          "shipToId": 1000001,\
          "estimatedTax": 10.25,\
          "committedTax": 10.25,\
          "promosApplied": [\
            {\
              "name": "test"\
            }\
          ],\
          "total": 4.54234234,\
          "taxCode": "FR020000",\
          "weight": 10,\
          "weightUnit": "lb"\
        }\
      ],\
      "shipments": "<array>",\
      "payments": [\
        {\
          "billToId": 1000001,\
          "shipToId": [\
            1000001\
          ],\
          "paymentIdentifier": {\
            "cardIdentifier": 4242\
          },\
          "paymentMethod": "Visa",\
          "paymentToken": {\
            "token": 12345689\
          },\
          "paymentKind": "Default payment",\
          "amount": 533.33,\
          "currency": "USD",\
          "conversion": 1,\
          "paymentStatus": "Pending",\
          "billToAddress": {\
            "name": {\
              "first": "Marl",\
              "middle": "p",\
              "last": "styler"\
            },\
            "email": "mark@google.com",\
            "phone": {\
              "number": "555-555-5555",\
              "kind": "mobile"\
            },\
            "street1": "10400 NE 4th St",\
            "street2": "Suite 500",\
            "city": "Bellevue",\
            "state": "WA",\
            "country": "USA",\
            "zipCode": 98004,\
            "kind": "Ship to address"\
          }\
        }\
      ]\
    }\
  ]
}
'
import requests

url = "https://prod01-apigw.yourcompany.fabric.zone/api-order/pos/orders"

payload = {
    "orderReference": 1234,
    "locationId": "5efcc26a5ee50d00079ca2ab",
    "status": "ORDER_CREATED",
    "channel": 12,
    "orderTotal": 125.33,
    "taxTotal": 5.23,
    "orderCurrency": "USD",
    "statusLog": "Order has been Shipped",
    "customerUserId": "5e3598e3007c5e00080d2bb8",
    "customerAccountId": "5e3598e3007c5e00080d2bb8",
    "customerEmail": "ino@fabric.inc",
    "customerPhone": {
        "number": "555-555-5555",
        "kind": "mobile"
    },
    "shipTo": [\
        {\
            "shipToId": 1000001,\
            "shipToType": "SHIP_TO_ADDRESS",\
            "address": {\
                "name": {\
                    "first": "Mark",\
                    "middle": "p",\
                    "last": "styler"\
                },\
                "email": "mark@google.com",\
                "phone": {\
                    "number": "555-555-5555",\
                    "kind": "mobile"\
                },\
                "street1": "10400 NE 4th St",\
                "street2": "Suite 500",\
                "city": "Bellevue",\
                "state": "WA",\
                "country": "USA",\
                "zipCode": 98004,\
                "kind": "Ship to address"\
            },\
            "price": 24.8723423,\
            "currency": "USD",\
            "estimatedTax": 10,\
            "committedTax": 10,\
            "promosApplied": [{ "name": "test1" }],\
            "total": 34.87,\
            "taxCode": "FR020000",\
            "shipmentCarrier": "Fedex",\
            "shipmentMethod": "Express",\
            "shipmentMethodId": 10000001,\
            "promisedDeliveryDate": "2021-02-14",\
            "shipmentInstructions": "Leave at back door",\
            "shipmentStatus": "Delivered",\
            "items": [\
                {\
                    "lineItemId": 1,\
                    "itemId": 1000011127,\
                    "sku": 1538910,\
                    "group": ["Group1"],\
                    "title": "Luminous Cushion Lagoon",\
                    "quantity": 10,\
                    "price": 4.5,\
                    "discount": 1,\
                    "currency": "USD",\
                    "shipToId": 1000001,\
                    "estimatedTax": 10.25,\
                    "committedTax": 10.25,\
                    "promosApplied": [{ "name": "test" }],\
                    "total": 4.54234234,\
                    "taxCode": "FR020000",\
                    "weight": 10,\
                    "weightUnit": "lb"\
                }\
            ],\
            "shipments": "<array>",\
            "payments": [\
                {\
                    "billToId": 1000001,\
                    "shipToId": [1000001],\
                    "paymentIdentifier": { "cardIdentifier": 4242 },\
                    "paymentMethod": "Visa",\
                    "paymentToken": { "token": 12345689 },\
                    "paymentKind": "Default payment",\
                    "amount": 533.33,\
                    "currency": "USD",\
                    "conversion": 1,\
                    "paymentStatus": "Pending",\
                    "billToAddress": {\
                        "name": {\
                            "first": "Marl",\
                            "middle": "p",\
                            "last": "styler"\
                        },\
                        "email": "mark@google.com",\
                        "phone": {\
                            "number": "555-555-5555",\
                            "kind": "mobile"\
                        },\
                        "street1": "10400 NE 4th St",\
                        "street2": "Suite 500",\
                        "city": "Bellevue",\
                        "state": "WA",\
                        "country": "USA",\
                        "zipCode": 98004,\
                        "kind": "Ship to address"\
                    }\
                }\
            ]\
        }\
    ]
}
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({
    orderReference: 1234,
    locationId: '5efcc26a5ee50d00079ca2ab',
    status: 'ORDER_CREATED',
    channel: 12,
    orderTotal: 125.33,
    taxTotal: 5.23,
    orderCurrency: 'USD',
    statusLog: 'Order has been Shipped',
    customerUserId: '5e3598e3007c5e00080d2bb8',
    customerAccountId: '5e3598e3007c5e00080d2bb8',
    customerEmail: 'ino@fabric.inc',
    customerPhone: {number: '555-555-5555', kind: 'mobile'},
    shipTo: [\
      {\
        shipToId: 1000001,\
        shipToType: 'SHIP_TO_ADDRESS',\
        address: {\
          name: {first: 'Mark', middle: 'p', last: 'styler'},\
          email: 'mark@google.com',\
          phone: {number: '555-555-5555', kind: 'mobile'},\
          street1: '10400 NE 4th St',\
          street2: 'Suite 500',\
          city: 'Bellevue',\
          state: 'WA',\
          country: 'USA',\
          zipCode: 98004,\
          kind: 'Ship to address'\
        },\
        price: 24.8723423,\
        currency: 'USD',\
        estimatedTax: 10,\
        committedTax: 10,\
        promosApplied: [{name: 'test1'}],\
        total: 34.87,\
        taxCode: 'FR020000',\
        shipmentCarrier: 'Fedex',\
        shipmentMethod: 'Express',\
        shipmentMethodId: 10000001,\
        promisedDeliveryDate: '2021-02-14',\
        shipmentInstructions: 'Leave at back door',\
        shipmentStatus: 'Delivered',\
        items: [\
          {\
            lineItemId: 1,\
            itemId: 1000011127,\
            sku: 1538910,\
            group: ['Group1'],\
            title: 'Luminous Cushion Lagoon',\
            quantity: 10,\
            price: 4.5,\
            discount: 1,\
            currency: 'USD',\
            shipToId: 1000001,\
            estimatedTax: 10.25,\
            committedTax: 10.25,\
            promosApplied: [{name: 'test'}],\
            total: 4.54234234,\
            taxCode: 'FR020000',\
            weight: 10,\
            weightUnit: 'lb'\
          }\
        ],\
        shipments: '<array>',\
        payments: [\
          {\
            billToId: 1000001,\
            shipToId: [1000001],\
            paymentIdentifier: {cardIdentifier: 4242},\
            paymentMethod: 'Visa',\
            paymentToken: {token: 12345689},\
            paymentKind: 'Default payment',\
            amount: 533.33,\
            currency: 'USD',\
            conversion: 1,\
            paymentStatus: 'Pending',\
            billToAddress: {\
              name: {first: 'Marl', middle: 'p', last: 'styler'},\
              email: 'mark@google.com',\
              phone: {number: '555-555-5555', kind: 'mobile'},\
              street1: '10400 NE 4th St',\
              street2: 'Suite 500',\
              city: 'Bellevue',\
              state: 'WA',\
              country: 'USA',\
              zipCode: 98004,\
              kind: 'Ship to address'\
            }\
          }\
        ]\
      }\
    ]
  })
};

fetch('https://prod01-apigw.yourcompany.fabric.zone/api-order/pos/orders', 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.yourcompany.fabric.zone/api-order/pos/orders",\
  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([\
    'orderReference' => 1234,\
    'locationId' => '5efcc26a5ee50d00079ca2ab',\
    'status' => 'ORDER_CREATED',\
    'channel' => 12,\
    'orderTotal' => 125.33,\
    'taxTotal' => 5.23,\
    'orderCurrency' => 'USD',\
    'statusLog' => 'Order has been Shipped',\
    'customerUserId' => '5e3598e3007c5e00080d2bb8',\
    'customerAccountId' => '5e3598e3007c5e00080d2bb8',\
    'customerEmail' => 'ino@fabric.inc',\
    'customerPhone' => [\
        'number' => '555-555-5555',\
        'kind' => 'mobile'\
    ],\
    'shipTo' => [\
        [\
                'shipToId' => 1000001,\
                'shipToType' => 'SHIP_TO_ADDRESS',\
                'address' => [\
                                'name' => [\
                                                                'first' => 'Mark',\
                                                                'middle' => 'p',\
                                                                'last' => 'styler'\
                                ],\
                                'email' => 'mark@google.com',\
                                'phone' => [\
                                                                'number' => '555-555-5555',\
                                                                'kind' => 'mobile'\
                                ],\
                                'street1' => '10400 NE 4th St',\
                                'street2' => 'Suite 500',\
                                'city' => 'Bellevue',\
                                'state' => 'WA',\
                                'country' => 'USA',\
                                'zipCode' => 98004,\
                                'kind' => 'Ship to address'\
                ],\
                'price' => 24.8723423,\
                'currency' => 'USD',\
                'estimatedTax' => 10,\
                'committedTax' => 10,\
                'promosApplied' => [\
                                [\
                                                                'name' => 'test1'\
                                ]\
                ],\
                'total' => 34.87,\
                'taxCode' => 'FR020000',\
                'shipmentCarrier' => 'Fedex',\
                'shipmentMethod' => 'Express',\
                'shipmentMethodId' => 10000001,\
                'promisedDeliveryDate' => '2021-02-14',\
                'shipmentInstructions' => 'Leave at back door',\
                'shipmentStatus' => 'Delivered',\
                'items' => [\
                                [\
                                                                'lineItemId' => 1,\
                                                                'itemId' => 1000011127,\
                                                                'sku' => 1538910,\
                                                                'group' => [\
                                                                                                                                'Group1'\
                                                                ],\
                                                                'title' => 'Luminous Cushion Lagoon',\
                                                                'quantity' => 10,\
                                                                'price' => 4.5,\
                                                                'discount' => 1,\
                                                                'currency' => 'USD',\
                                                                'shipToId' => 1000001,\
                                                                'estimatedTax' => 10.25,\
                                                                'committedTax' => 10.25,\
                                                                'promosApplied' => [\
                                                                                                                                [\
                                                                                                                                                                                                                                                                'name' => 'test'\
                                                                                                                                ]\
                                                                ],\
                                                                'total' => 4.54234234,\
                                                                'taxCode' => 'FR020000',\
                                                                'weight' => 10,\
                                                                'weightUnit' => 'lb'\
                                ]\
                ],\
                'shipments' => '<array>',\
                'payments' => [\
                                [\
                                                                'billToId' => 1000001,\
                                                                'shipToId' => [\
                                                                                                                                1000001\
                                                                ],\
                                                                'paymentIdentifier' => [\
                                                                                                                                'cardIdentifier' => 4242\
                                                                ],\
                                                                'paymentMethod' => 'Visa',\
                                                                'paymentToken' => [\
                                                                                                                                'token' => 12345689\
                                                                ],\
                                                                'paymentKind' => 'Default payment',\
                                                                'amount' => 533.33,\
                                                                'currency' => 'USD',\
                                                                'conversion' => 1,\
                                                                'paymentStatus' => 'Pending',\
                                                                'billToAddress' => [\
                                                                                                                                'name' => [\
                                                                                                                                                                                                                                                                'first' => 'Marl',\
                                                                                                                                                                                                                                                                'middle' => 'p',\
                                                                                                                                                                                                                                                                'last' => 'styler'\
                                                                                                                                ],\
                                                                                                                                'email' => 'mark@google.com',\
                                                                                                                                'phone' => [\
                                                                                                                                                                                                                                                                'number' => '555-555-5555',\
                                                                                                                                                                                                                                                                'kind' => 'mobile'\
                                                                                                                                ],\
                                                                                                                                'street1' => '10400 NE 4th St',\
                                                                                                                                'street2' => 'Suite 500',\
                                                                                                                                'city' => 'Bellevue',\
                                                                                                                                'state' => 'WA',\
                                                                                                                                'country' => 'USA',\
                                                                                                                                'zipCode' => 98004,\
                                                                                                                                'kind' => 'Ship to address'\
                                                                ]\
                                ]\
                ]\
        ]\
    ]\
  ]),\
  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.yourcompany.fabric.zone/api-order/pos/orders"

payload := strings.NewReader("{\n  \"orderReference\": 1234,\n  \"locationId\": \"5efcc26a5ee50d00079ca2ab\",\n  \"status\": \"ORDER_CREATED\",\n  \"channel\": 12,\n  \"orderTotal\": 125.33,\n  \"taxTotal\": 5.23,\n  \"orderCurrency\": \"USD\",\n  \"statusLog\": \"Order has been Shipped\",\n  \"customerUserId\": \"5e3598e3007c5e00080d2bb8\",\n  \"customerAccountId\": \"5e3598e3007c5e00080d2bb8\",\n  \"customerEmail\": \"ino@fabric.inc\",\n  \"customerPhone\": {\n    \"number\": \"555-555-5555\",\n    \"kind\": \"mobile\"\n  },\n  \"shipTo\": [\n    {\n      \"shipToId\": 1000001,\n      \"shipToType\": \"SHIP_TO_ADDRESS\",\n      \"address\": {\n        \"name\": {\n          \"first\": \"Mark\",\n          \"middle\": \"p\",\n          \"last\": \"styler\"\n        },\n        \"email\": \"mark@google.com\",\n        \"phone\": {\n          \"number\": \"555-555-5555\",\n          \"kind\": \"mobile\"\n        },\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      \"price\": 24.8723423,\n      \"currency\": \"USD\",\n      \"estimatedTax\": 10,\n      \"committedTax\": 10,\n      \"promosApplied\": [\n        {\n          \"name\": \"test1\"\n        }\n      ],\n      \"total\": 34.87,\n      \"taxCode\": \"FR020000\",\n      \"shipmentCarrier\": \"Fedex\",\n      \"shipmentMethod\": \"Express\",\n      \"shipmentMethodId\": 10000001,\n      \"promisedDeliveryDate\": \"2021-02-14\",\n      \"shipmentInstructions\": \"Leave at back door\",\n      \"shipmentStatus\": \"Delivered\",\n      \"items\": [\n        {\n          \"lineItemId\": 1,\n          \"itemId\": 1000011127,\n          \"sku\": 1538910,\n          \"group\": [\n            \"Group1\"\n          ],\n          \"title\": \"Luminous Cushion Lagoon\",\n          \"quantity\": 10,\n          \"price\": 4.5,\n          \"discount\": 1,\n          \"currency\": \"USD\",\n          \"shipToId\": 1000001,\n          \"estimatedTax\": 10.25,\n          \"committedTax\": 10.25,\n          \"promosApplied\": [\n            {\n              \"name\": \"test\"\n            }\n          ],\n          \"total\": 4.54234234,\n          \"taxCode\": \"FR020000\",\n          \"weight\": 10,\n          \"weightUnit\": \"lb\"\n        }\n      ],\n      \"shipments\": \"<array>\",\n      \"payments\": [\n        {\n          \"billToId\": 1000001,\n          \"shipToId\": [\n            1000001\n          ],\n          \"paymentIdentifier\": {\n            \"cardIdentifier\": 4242\n          },\n          \"paymentMethod\": \"Visa\",\n          \"paymentToken\": {\n            \"token\": 12345689\n          },\n          \"paymentKind\": \"Default payment\",\n          \"amount\": 533.33,\n          \"currency\": \"USD\",\n          \"conversion\": 1,\n          \"paymentStatus\": \"Pending\",\n          \"billToAddress\": {\n            \"name\": {\n              \"first\": \"Marl\",\n              \"middle\": \"p\",\n              \"last\": \"styler\"\n            },\n            \"email\": \"mark@google.com\",\n            \"phone\": {\n              \"number\": \"555-555-5555\",\n              \"kind\": \"mobile\"\n            },\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        }\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.yourcompany.fabric.zone/api-order/pos/orders")
  .header("x-site-context", "<x-site-context>")
  .header("Content-Type", "application/json")
  .body("{\n  \"orderReference\": 1234,\n  \"locationId\": \"5efcc26a5ee50d00079ca2ab\",\n  \"status\": \"ORDER_CREATED\",\n  \"channel\": 12,\n  \"orderTotal\": 125.33,\n  \"taxTotal\": 5.23,\n  \"orderCurrency\": \"USD\",\n  \"statusLog\": \"Order has been Shipped\",\n  \"customerUserId\": \"5e3598e3007c5e00080d2bb8\",\n  \"customerAccountId\": \"5e3598e3007c5e00080d2bb8\",\n  \"customerEmail\": \"ino@fabric.inc\",\n  \"customerPhone\": {\n    \"number\": \"555-555-5555\",\n    \"kind\": \"mobile\"\n  },\n  \"shipTo\": [\n    {\n      \"shipToId\": 1000001,\n      \"shipToType\": \"SHIP_TO_ADDRESS\",\n      \"address\": {\n        \"name\": {\n          \"first\": \"Mark\",\n          \"middle\": \"p\",\n          \"last\": \"styler\"\n        },\n        \"email\": \"mark@google.com\",\n        \"phone\": {\n          \"number\": \"555-555-5555\",\n          \"kind\": \"mobile\"\n        },\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      \"price\": 24.8723423,\n      \"currency\": \"USD\",\n      \"estimatedTax\": 10,\n      \"committedTax\": 10,\n      \"promosApplied\": [\n        {\n          \"name\": \"test1\"\n        }\n      ],\n      \"total\": 34.87,\n      \"taxCode\": \"FR020000\",\n      \"shipmentCarrier\": \"Fedex\",\n      \"shipmentMethod\": \"Express\",\n      \"shipmentMethodId\": 10000001,\n      \"promisedDeliveryDate\": \"2021-02-14\",\n      \"shipmentInstructions\": \"Leave at back door\",\n      \"shipmentStatus\": \"Delivered\",\n      \"items\": [\n        {\n          \"lineItemId\": 1,\n          \"itemId\": 1000011127,\n          \"sku\": 1538910,\n          \"group\": [\n            \"Group1\"\n          ],\n          \"title\": \"Luminous Cushion Lagoon\",\n          \"quantity\": 10,\n          \"price\": 4.5,\n          \"discount\": 1,\n          \"currency\": \"USD\",\n          \"shipToId\": 1000001,\n          \"estimatedTax\": 10.25,\n          \"committedTax\": 10.25,\n          \"promosApplied\": [\n            {\n              \"name\": \"test\"\n            }\n          ],\n          \"total\": 4.54234234,\n          \"taxCode\": \"FR020000\",\n          \"weight\": 10,\n          \"weightUnit\": \"lb\"\n        }\n      ],\n      \"shipments\": \"<array>\",\n      \"payments\": [\n        {\n          \"billToId\": 1000001,\n          \"shipToId\": [\n            1000001\n          ],\n          \"paymentIdentifier\": {\n            \"cardIdentifier\": 4242\n          },\n          \"paymentMethod\": \"Visa\",\n          \"paymentToken\": {\n            \"token\": 12345689\n          },\n          \"paymentKind\": \"Default payment\",\n          \"amount\": 533.33,\n          \"currency\": \"USD\",\n          \"conversion\": 1,\n          \"paymentStatus\": \"Pending\",\n          \"billToAddress\": {\n            \"name\": {\n              \"first\": \"Marl\",\n              \"middle\": \"p\",\n              \"last\": \"styler\"\n            },\n            \"email\": \"mark@google.com\",\n            \"phone\": {\n              \"number\": \"555-555-5555\",\n              \"kind\": \"mobile\"\n            },\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        }\n      ]\n    }\n  ]\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://prod01-apigw.yourcompany.fabric.zone/api-order/pos/orders")

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  \"orderReference\": 1234,\n  \"locationId\": \"5efcc26a5ee50d00079ca2ab\",\n  \"status\": \"ORDER_CREATED\",\n  \"channel\": 12,\n  \"orderTotal\": 125.33,\n  \"taxTotal\": 5.23,\n  \"orderCurrency\": \"USD\",\n  \"statusLog\": \"Order has been Shipped\",\n  \"customerUserId\": \"5e3598e3007c5e00080d2bb8\",\n  \"customerAccountId\": \"5e3598e3007c5e00080d2bb8\",\n  \"customerEmail\": \"ino@fabric.inc\",\n  \"customerPhone\": {\n    \"number\": \"555-555-5555\",\n    \"kind\": \"mobile\"\n  },\n  \"shipTo\": [\n    {\n      \"shipToId\": 1000001,\n      \"shipToType\": \"SHIP_TO_ADDRESS\",\n      \"address\": {\n        \"name\": {\n          \"first\": \"Mark\",\n          \"middle\": \"p\",\n          \"last\": \"styler\"\n        },\n        \"email\": \"mark@google.com\",\n        \"phone\": {\n          \"number\": \"555-555-5555\",\n          \"kind\": \"mobile\"\n        },\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      \"price\": 24.8723423,\n      \"currency\": \"USD\",\n      \"estimatedTax\": 10,\n      \"committedTax\": 10,\n      \"promosApplied\": [\n        {\n          \"name\": \"test1\"\n        }\n      ],\n      \"total\": 34.87,\n      \"taxCode\": \"FR020000\",\n      \"shipmentCarrier\": \"Fedex\",\n      \"shipmentMethod\": \"Express\",\n      \"shipmentMethodId\": 10000001,\n      \"promisedDeliveryDate\": \"2021-02-14\",\n      \"shipmentInstructions\": \"Leave at back door\",\n      \"shipmentStatus\": \"Delivered\",\n      \"items\": [\n        {\n          \"lineItemId\": 1,\n          \"itemId\": 1000011127,\n          \"sku\": 1538910,\n          \"group\": [\n            \"Group1\"\n          ],\n          \"title\": \"Luminous Cushion Lagoon\",\n          \"quantity\": 10,\n          \"price\": 4.5,\n          \"discount\": 1,\n          \"currency\": \"USD\",\n          \"shipToId\": 1000001,\n          \"estimatedTax\": 10.25,\n          \"committedTax\": 10.25,\n          \"promosApplied\": [\n            {\n              \"name\": \"test\"\n            }\n          ],\n          \"total\": 4.54234234,\n          \"taxCode\": \"FR020000\",\n          \"weight\": 10,\n          \"weightUnit\": \"lb\"\n        }\n      ],\n      \"shipments\": \"<array>\",\n      \"payments\": [\n        {\n          \"billToId\": 1000001,\n          \"shipToId\": [\n            1000001\n          ],\n          \"paymentIdentifier\": {\n            \"cardIdentifier\": 4242\n          },\n          \"paymentMethod\": \"Visa\",\n          \"paymentToken\": {\n            \"token\": 12345689\n          },\n          \"paymentKind\": \"Default payment\",\n          \"amount\": 533.33,\n          \"currency\": \"USD\",\n          \"conversion\": 1,\n          \"paymentStatus\": \"Pending\",\n          \"billToAddress\": {\n            \"name\": {\n              \"first\": \"Marl\",\n              \"middle\": \"p\",\n              \"last\": \"styler\"\n            },\n            \"email\": \"mark@google.com\",\n            \"phone\": {\n              \"number\": \"555-555-5555\",\n              \"kind\": \"mobile\"\n            },\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        }\n      ]\n    }\n  ]\n}"

response = http.request(request)
puts response.read_body

200

400

403

500

{
  "tags": "<array>",
  "_id": "60944ade71cdfc0008a621a2",
  "channel": 12,
  "orderReference": "testorder",
  "orderTotal": 125.33,
  "taxTotal": 5.23,
  "orderCurrency": "USD",
  "status": "ORDER_CREATED",
  "statusLog": "Order has been created",
  "customerUserId": "5e3598e3007c5e00080d2bb8",
  "customerAccountId": "5e3598e3007c5e00080d2bb8",
  "customerEmail": "ino@fabric.inc",
  "customerPhone": {
    "number": "555-555-5555",
    "kind": "mobile"
  },
  "orderId": "7998-1161-63560",
  "shipTo": [\
    {\
      "address": {\
        "name": {\
          "first": "Mark",\
          "middle": "p",\
          "last": "styler"\
        },\
        "email": "mark@google.com",\
        "phone": {\
          "number": "555-555-5555",\
          "kind": "mobile"\
        },\
        "street1": "10400 NE 4th St",\
        "street2": "Suite 500",\
        "city": "Bellevue",\
        "state": "WA",\
        "country": "USA",\
        "zipCode": 98004,\
        "kind": "Ship to address"\
      },\
      "promosApplied": [\
        {\
          "name": "test1"\
        }\
      ],\
      "_id": "60944ade71cdfc0008a621a3",\
      "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"\
    }\
  ],
  "items": [\
    {\
      "group": [\
        "Group1"\
      ],\
      "promosApplied": [\
        {\
          "name": "test"\
        }\
      ],\
      "_id": "60944ade71cdfc0008a621a4",\
      "lineItemId": 1,\
      "itemId": 1000000051,\
      "priceListId": 100003,\
      "sku": 1538910,\
      "title": "Luminous Cushion Lagoon",\
      "quantity": 10,\
      "price": 4.5,\
      "discount": 1,\
      "currency": "USD",\
      "shipToId": 1000001,\
      "estimatedTax": 10.25,\
      "committedTax": 10.25,\
      "total": 4.54,\
      "taxCode": "FR020000",\
      "weight": 10,\
      "weightUnit": "lb",\
      "reservedLocation": "<array>",\
      "attributes": "<array>"\
    }\
  ],
  "shipments": "<array>",
  "payments": [\
    {\
      "billToAddress": {\
        "name": {\
          "first": "Marl",\
          "middle": "p",\
          "last": "styler"\
        },\
        "email": "mark@google.com",\
        "phone": {\
          "number": "555-555-5555",\
          "kind": "mobile"\
        },\
        "street1": "10400 NE 4th St",\
        "street2": "Suite 500",\
        "city": "Bellevue",\
        "state": "WA",\
        "country": "USA",\
        "zipCode": 98004,\
        "kind": "Ship to address"\
      },\
      "shipToId": [\
        1000001\
      ],\
      "_id": "60944ade71cdfc0008a621a5",\
      "billToId": 1000001,\
      "paymentIdentifier": {\
        "cardIdentifier": 4242\
      },\
      "paymentMethod": "Visa",\
      "paymentToken": {\
        "token": 12345689\
      },\
      "paymentKind": "Default payment",\
      "amount": 533.33,\
      "currency": "USD",\
      "conversion": 1,\
      "paymentStatus": "Pending"\
    }\
  ],
  "revision": 0,
  "totalQuantity": 10,
  "statusDescriptions": "<array>",
  "events": "<array>",
  "pickups": "<array>",
  "attributes": "<array>",
  "createdAt": "2021-05-06T20:00:30.143Z",
  "updatedAt": "2021-05-06T20:00:30.143Z"
}
{
  "code": "<string>",
  "message": "<string>"
}
{
  "message": "Forbidden"
}
{
  "code": "<string>",
  "message": "<string>"
}

POST

/

api-order

/

pos

/

orders

Try it

Create POS order

cURL

import requests

url = "https://prod01-apigw.yourcompany.fabric.zone/api-order/pos/orders"

response = requests.post(url, json=payload, headers=headers)

print(response.text)
<?php

$curl = curl_init();

$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.yourcompany.fabric.zone/api-order/pos/orders"

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))

}
require 'uri'
require 'net/http'

url = URI("https://prod01-apigw.yourcompany.fabric.zone/api-order/pos/orders")

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

response = http.request(request)
puts response.read_body

200

400

403

500

{
  "code": "<string>",
  "message": "<string>"
}
{
  "message": "Forbidden"
}
{
  "code": "<string>",
  "message": "<string>"
}

Headers

x-api-key

string

Example:

"0LybWR49k95cCwYh3cu0waCYoh4H2Eux2J52wn4k"

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

Body

application/json

orderReference

string

required

Example:

1234

locationId

string

required

Example:

"5efcc26a5ee50d00079ca2ab"

status

string

required

Example:

"ORDER_CREATED"

channel

number

Example:

12

orderTotal

number

Example:

125.33

taxTotal

number

Example:

5.23

orderCurrency

string

Example:

"USD"

statusLog

string

Example:

"Order has been Shipped"

customerUserId

string

Example:

"5e3598e3007c5e00080d2bb8"

customerAccountId

string

Example:

"5e3598e3007c5e00080d2bb8"

customerEmail

string

Example:

"ino@fabric.inc"

customerPhone

object

Showchild attributes

shipTo

object[]

Showchild attributes

Response

200

application/json

Created POS order

tags

array

_id

string

Example:

"60944ade71cdfc0008a621a2"

channel

number

Example:

12

orderReference

string

Example:

"testorder"

orderTotal

number

Example:

125.33

taxTotal

number

Example:

5.23

orderCurrency

string

Example:

"USD"

status

string

Example:

"ORDER_CREATED"

statusLog

string

Example:

"Order has been created"

customerUserId

string

Example:

"5e3598e3007c5e00080d2bb8"

customerAccountId

string

Example:

"5e3598e3007c5e00080d2bb8"

customerEmail

string

Example:

"ino@fabric.inc"

customerPhone

object

Showchild attributes

orderId

string

Example:

"7998-1161-63560"

shipTo

object[]

Showchild attributes

items

object[]

Showchild attributes

shipments

array

payments

object[]

Showchild attributes

revision

number

Example:

0

totalQuantity

number

Example:

10

statusDescriptions

array

events

array

pickups

array

attributes

array

createdAt

string

Example:

"2021-05-06T20:00:30.143Z"

updatedAt

string

Example:

"2021-05-06T20:00:30.143Z"

Was this page helpful?

YesNo

Bulk return orders Get order by email

Ctrl+I

Assistant

Responses are generated using AI and may contain mistakes.