curl --request POST \
--url https://prod01-apigw.{customer_name}.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.{customer_name}.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.{customer_name}.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.{customer_name}.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.{customer_name}.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.{customer_name}.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.{customer_name}.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{
"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>"
}Create POS order
Create POS order
curl --request POST \
--url https://prod01-apigw.{customer_name}.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.{customer_name}.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.{customer_name}.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.{customer_name}.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.{customer_name}.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.{customer_name}.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.{customer_name}.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{
"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>"
}Headers
"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.
"{\"date\": \"2023-01-01T00:00:00.000Z\", \"channel\": 12, \"account\": \"1234abcd5678efgh9ijklmno\",\"stage\":\"production\"}"
Body
1234
"5efcc26a5ee50d00079ca2ab"
"ORDER_CREATED"
12
125.33
5.23
"USD"
"Order has been Shipped"
"5e3598e3007c5e00080d2bb8"
"5e3598e3007c5e00080d2bb8"
"ino@fabric.inc"
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Response
Created POS order
"60944ade71cdfc0008a621a2"
12
"testorder"
125.33
5.23
"USD"
"ORDER_CREATED"
"Order has been created"
"5e3598e3007c5e00080d2bb8"
"5e3598e3007c5e00080d2bb8"
"ino@fabric.inc"
Show child attributes
Show child attributes
"7998-1161-63560"
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
0
10
"2021-05-06T20:00:30.143Z"
"2021-05-06T20:00:30.143Z"
Was this page helpful?
