curl --request POST \
--url https://api.fabric.inc/v3/orders \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-fabric-channel-id: <x-fabric-channel-id>' \
--header 'x-fabric-tenant-id: <x-fabric-tenant-id>' \
--data '
{
"items": [
{
"itemId": 1234,
"lineItemId": "b03b72dc-78d8-4ea4-90fc-2fe6a1fe6569",
"lineItemNumber": 1,
"shipToId": "b03b72dc-78d8-4ea4-90fc-2fe6a1fe6569",
"sku": "P1234",
"adjustments": [
{
"adjustmentCounter": 1,
"amount": 2.4,
"amountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"attributes": {
"number": "XlQZTmFDFtPFGMxJP6oiAqN3vo+qKZ"
},
"cancelQuantity": 2,
"invoiceQuantity": 10,
"notes": "Any additional info",
"quantity": 2,
"reasonCode": "RFC",
"returnQuantity": 1,
"subReasonCode": "Late shipping"
}
],
"attributes": {
"colorCode": "001",
"isDonation": "false",
"style": "570223020"
},
"currency": "USD",
"discounts": [
{
"amount": 2.4,
"amountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"promotionCode": "HNY2022",
"promotionId": "HNY2022",
"promotionName": "New Year",
"quantity": 2,
"type": "promotion",
"unit": "AMOUNT_OFF",
"value": 2
}
],
"employeeId": "62272e917b12209e68751d94",
"fees": [
{
"amount": 34.56,
"amountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"attributes": {},
"currency": "USD",
"name": "STATE",
"rate": 10,
"rateType": "PERCENTAGE",
"taxCode": "FR01"
}
],
"fulfillment": {
"isFulfillable": true,
"isInventoryManaged": true,
"locationNumber": 123,
"trackingDetails": {
"trackingNumber": "1ZH4E331YW37690225",
"trackingURL": "https://www.ups.com/track?tracknum=1ZH4E331YW37690225"
},
"attributes": {
"attribute1": "value"
}
},
"isBackorder": true,
"isDonation": true,
"isPreorder": true,
"itemAdjustmentTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"itemDiscountsTotal": 10,
"itemDiscountsTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"itemFeeTotal": 10,
"itemFeeTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"itemName": "Item",
"itemSubtotal": 600,
"itemSubtotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"itemSubtype": "Borderfree",
"itemTaxTotal": 10,
"itemTaxTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"itemTotal": 10,
"itemTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"itemUnitPrice": 10,
"itemUnitPriceInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"notes": [
{
"createdAt": "2022-05-12T09:30:31.198Z",
"notes": "Fragile - handle with care",
"user": "62272e917b12209e68751d94"
}
],
"orderedQuantity": 60,
"segment": "P1234",
"taxCode": "FR01",
"taxDetails": [
{
"amount": 34.56,
"amountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"attributes": {},
"currency": "USD",
"name": "STATE",
"rate": 10,
"rateType": "PERCENTAGE",
"taxCode": "FR01"
}
],
"type": "WEB_SHIP",
"uom": "EA",
"vendorId": "P1234"
}
],
"orderNumber": "309019176",
"statusCode": "ORDER_CREATED",
"adjustmentTotal": 123.45,
"adjustmentTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"adjustments": [
{
"adjustmentCounter": 1,
"amount": 2.4,
"amountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"attributes": {
"number": "XlQZTmFDFtPFGMxJP6oiAqN3vo+qKZ"
},
"cancelQuantity": 2,
"invoiceQuantity": 10,
"notes": "Any additional info",
"quantity": 2,
"reasonCode": "RFC",
"returnQuantity": 1,
"subReasonCode": "Late shipping"
}
],
"attributes": {
"fraudCheckStatus": "UPDATED",
"fraudStatus": "FRAUD_PASS"
},
"cartId": "b03b72dc-78d8-4ea4-90fc-2fe6a1fe6569",
"currencies": {
"groups": [
{
"currency": "USD",
"group": "SHOPPER",
"attributes": {
"fxId": "ID123"
},
"conversionRate": 1
}
],
"primaryCurrency": "SHOPPER"
},
"currency": "USD",
"customer": {
"accountId": "62272e917b12209e68751d94",
"company": "Demo Inc",
"email": "test@example.com",
"employeeId": "62272e917b12209e68751d94",
"name": {
"firstName": "Alex",
"lastName": "Doe",
"middleName": "E"
},
"phone": {
"number": "123-456-7890",
"type": "MOBILE"
},
"userId": "62272e917b12209e68751d94"
},
"discounts": [
{
"amount": 2.4,
"amountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"promotionCode": "HNY2022",
"promotionId": "HNY2022",
"promotionName": "New Year",
"quantity": 2,
"type": "promotion",
"unit": "AMOUNT_OFF",
"value": 2
}
],
"employeeId": "62272e917b12209e68751d94",
"feeTotal": 12.34,
"feeTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"fees": [
{
"amount": 34.56,
"amountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"attributes": {},
"currency": "USD",
"invoicedAmount": 34.56,
"invoicedAmountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"name": "STATE",
"rate": 10,
"rateType": "PERCENTAGE",
"taxCode": "FR01"
}
],
"notes": [
{
"createdAt": "2022-05-12T09:30:31.198Z",
"notes": "Fragile - handle with care",
"user": "62272e917b12209e68751d94"
}
],
"orderDiscount": 1.23,
"orderDiscountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"orderExternalId": "191763090_O1231",
"orderSubtotal": 123.45,
"orderSubtotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"orderTotal": 146.9,
"orderTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"orderedAt": "2022-05-12T09:30:31.198Z",
"payments": [
{
"attributes": {
"captureCurrencyCode": "USD",
"payerId": "M7AWTK3YK3B46",
"referenceId": "4DY41894J2904533S"
},
"authorizationExpirationDate": "2022-01-27T16:15:58-05:00",
"authorizedAmount": 123.2,
"authorizedAmountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"chargedAmount": 60,
"chargedAmountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"currency": "USD",
"paidAt": "2022-01-27T16:15:58-05:00",
"paymentCounter": 1,
"paymentIdentifier": {
"cardIdentifier": "3456",
"expirationMonth": "12",
"expirationYear": "2029",
"fabricPaymentReference": "f886c96c-5f65-11ed-9b6a-0242ac120002",
"paymentId": "62272e917b12209e68751d94"
},
"paymentMethod": "CREDIT_CARD",
"paymentProvider": "stripe",
"paymentStatus": "Paid",
"paymentToken": {
"paymentType": "VISA",
"token": "pi_34tr6787rt"
}
}
],
"retail": {
"cashierId": "C-123",
"locationNumber": "WH334",
"registerId": "113",
"transactionId": "328942333412"
},
"shipInfo": [
{
"shipToId": "b03b72dc-78d8-4ea4-90fc-2fe6a1fe6569",
"attributes": {
"giftMessage": "[]"
},
"discounts": [
{
"amount": 2.99,
"amountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"promotionCode": "SHIPFREE",
"promotionId": "SHIPFREE",
"promotionName": "Free Shipping",
"quantity": 1,
"unit": "AMOUNT_OFF",
"value": 10
}
],
"estimatedDeliveryDate": "2022-05-12T09:30:31.198Z",
"estimatedShipDate": "2022-05-12T09:30:31.198Z",
"isInvoiced": true,
"locationNumber": "WH334",
"pickups": [
{
"email": "test@example.com",
"name": {
"firstName": "Alex",
"lastName": "Doe",
"middleName": "E"
},
"phone": {
"number": "123-456-7890",
"type": "MOBILE"
},
"pickupType": "PRIMARY"
}
],
"shipMethod": "Parcel post delivery",
"shipToDiscount": 12.6,
"shipToDiscountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"shipToPrice": 20,
"shipToPriceInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"shipToTaxTotal": 12.6,
"shipToTaxTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"shipToType": "SHIP_TO_ADDRESS",
"shipToUnitPrice": 20,
"shipToUnitPriceInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"shipmentInstructions": "Handle with care",
"taxCode": "FR01",
"taxDetails": [
{
"amount": 34.56,
"amountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"attributes": {},
"currency": "USD",
"name": "STATE",
"rate": 10,
"rateType": "PERCENTAGE",
"taxCode": "FR01"
}
]
}
],
"statusDescription": "Order Created",
"subtype": "INTERNATIONAL",
"taxTotal": 12.34,
"taxTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"type": "WEB",
"requestContext": {
"id": "a05b72dc-78d8-4ea4-90fc-2fe6a1fe1111",
"type": "<string>",
"requestTime": "2022-04-12T09:30:31.198Z",
"attributes": {
"attribute": "N",
"someFlag": true
}
}
}
'import requests
url = "https://api.fabric.inc/v3/orders"
payload = {
"items": [
{
"itemId": 1234,
"lineItemId": "b03b72dc-78d8-4ea4-90fc-2fe6a1fe6569",
"lineItemNumber": 1,
"shipToId": "b03b72dc-78d8-4ea4-90fc-2fe6a1fe6569",
"sku": "P1234",
"adjustments": [
{
"adjustmentCounter": 1,
"amount": 2.4,
"amountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"attributes": { "number": "XlQZTmFDFtPFGMxJP6oiAqN3vo+qKZ" },
"cancelQuantity": 2,
"invoiceQuantity": 10,
"notes": "Any additional info",
"quantity": 2,
"reasonCode": "RFC",
"returnQuantity": 1,
"subReasonCode": "Late shipping"
}
],
"attributes": {
"colorCode": "001",
"isDonation": "false",
"style": "570223020"
},
"currency": "USD",
"discounts": [
{
"amount": 2.4,
"amountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"promotionCode": "HNY2022",
"promotionId": "HNY2022",
"promotionName": "New Year",
"quantity": 2,
"type": "promotion",
"unit": "AMOUNT_OFF",
"value": 2
}
],
"employeeId": "62272e917b12209e68751d94",
"fees": [
{
"amount": 34.56,
"amountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"attributes": {},
"currency": "USD",
"name": "STATE",
"rate": 10,
"rateType": "PERCENTAGE",
"taxCode": "FR01"
}
],
"fulfillment": {
"isFulfillable": True,
"isInventoryManaged": True,
"locationNumber": 123,
"trackingDetails": {
"trackingNumber": "1ZH4E331YW37690225",
"trackingURL": "https://www.ups.com/track?tracknum=1ZH4E331YW37690225"
},
"attributes": { "attribute1": "value" }
},
"isBackorder": True,
"isDonation": True,
"isPreorder": True,
"itemAdjustmentTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"itemDiscountsTotal": 10,
"itemDiscountsTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"itemFeeTotal": 10,
"itemFeeTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"itemName": "Item",
"itemSubtotal": 600,
"itemSubtotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"itemSubtype": "Borderfree",
"itemTaxTotal": 10,
"itemTaxTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"itemTotal": 10,
"itemTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"itemUnitPrice": 10,
"itemUnitPriceInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"notes": [
{
"createdAt": "2022-05-12T09:30:31.198Z",
"notes": "Fragile - handle with care",
"user": "62272e917b12209e68751d94"
}
],
"orderedQuantity": 60,
"segment": "P1234",
"taxCode": "FR01",
"taxDetails": [
{
"amount": 34.56,
"amountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"attributes": {},
"currency": "USD",
"name": "STATE",
"rate": 10,
"rateType": "PERCENTAGE",
"taxCode": "FR01"
}
],
"type": "WEB_SHIP",
"uom": "EA",
"vendorId": "P1234"
}
],
"orderNumber": "309019176",
"statusCode": "ORDER_CREATED",
"adjustmentTotal": 123.45,
"adjustmentTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"adjustments": [
{
"adjustmentCounter": 1,
"amount": 2.4,
"amountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"attributes": { "number": "XlQZTmFDFtPFGMxJP6oiAqN3vo+qKZ" },
"cancelQuantity": 2,
"invoiceQuantity": 10,
"notes": "Any additional info",
"quantity": 2,
"reasonCode": "RFC",
"returnQuantity": 1,
"subReasonCode": "Late shipping"
}
],
"attributes": {
"fraudCheckStatus": "UPDATED",
"fraudStatus": "FRAUD_PASS"
},
"cartId": "b03b72dc-78d8-4ea4-90fc-2fe6a1fe6569",
"currencies": {
"groups": [
{
"currency": "USD",
"group": "SHOPPER",
"attributes": { "fxId": "ID123" },
"conversionRate": 1
}
],
"primaryCurrency": "SHOPPER"
},
"currency": "USD",
"customer": {
"accountId": "62272e917b12209e68751d94",
"company": "Demo Inc",
"email": "test@example.com",
"employeeId": "62272e917b12209e68751d94",
"name": {
"firstName": "Alex",
"lastName": "Doe",
"middleName": "E"
},
"phone": {
"number": "123-456-7890",
"type": "MOBILE"
},
"userId": "62272e917b12209e68751d94"
},
"discounts": [
{
"amount": 2.4,
"amountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"promotionCode": "HNY2022",
"promotionId": "HNY2022",
"promotionName": "New Year",
"quantity": 2,
"type": "promotion",
"unit": "AMOUNT_OFF",
"value": 2
}
],
"employeeId": "62272e917b12209e68751d94",
"feeTotal": 12.34,
"feeTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"fees": [
{
"amount": 34.56,
"amountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"attributes": {},
"currency": "USD",
"invoicedAmount": 34.56,
"invoicedAmountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"name": "STATE",
"rate": 10,
"rateType": "PERCENTAGE",
"taxCode": "FR01"
}
],
"notes": [
{
"createdAt": "2022-05-12T09:30:31.198Z",
"notes": "Fragile - handle with care",
"user": "62272e917b12209e68751d94"
}
],
"orderDiscount": 1.23,
"orderDiscountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"orderExternalId": "191763090_O1231",
"orderSubtotal": 123.45,
"orderSubtotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"orderTotal": 146.9,
"orderTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"orderedAt": "2022-05-12T09:30:31.198Z",
"payments": [
{
"attributes": {
"captureCurrencyCode": "USD",
"payerId": "M7AWTK3YK3B46",
"referenceId": "4DY41894J2904533S"
},
"authorizationExpirationDate": "2022-01-27T16:15:58-05:00",
"authorizedAmount": 123.2,
"authorizedAmountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"chargedAmount": 60,
"chargedAmountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"currency": "USD",
"paidAt": "2022-01-27T16:15:58-05:00",
"paymentCounter": 1,
"paymentIdentifier": {
"cardIdentifier": "3456",
"expirationMonth": "12",
"expirationYear": "2029",
"fabricPaymentReference": "f886c96c-5f65-11ed-9b6a-0242ac120002",
"paymentId": "62272e917b12209e68751d94"
},
"paymentMethod": "CREDIT_CARD",
"paymentProvider": "stripe",
"paymentStatus": "Paid",
"paymentToken": {
"paymentType": "VISA",
"token": "pi_34tr6787rt"
}
}
],
"retail": {
"cashierId": "C-123",
"locationNumber": "WH334",
"registerId": "113",
"transactionId": "328942333412"
},
"shipInfo": [
{
"shipToId": "b03b72dc-78d8-4ea4-90fc-2fe6a1fe6569",
"attributes": { "giftMessage": "[]" },
"discounts": [
{
"amount": 2.99,
"amountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"promotionCode": "SHIPFREE",
"promotionId": "SHIPFREE",
"promotionName": "Free Shipping",
"quantity": 1,
"unit": "AMOUNT_OFF",
"value": 10
}
],
"estimatedDeliveryDate": "2022-05-12T09:30:31.198Z",
"estimatedShipDate": "2022-05-12T09:30:31.198Z",
"isInvoiced": True,
"locationNumber": "WH334",
"pickups": [
{
"email": "test@example.com",
"name": {
"firstName": "Alex",
"lastName": "Doe",
"middleName": "E"
},
"phone": {
"number": "123-456-7890",
"type": "MOBILE"
},
"pickupType": "PRIMARY"
}
],
"shipMethod": "Parcel post delivery",
"shipToDiscount": 12.6,
"shipToDiscountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"shipToPrice": 20,
"shipToPriceInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"shipToTaxTotal": 12.6,
"shipToTaxTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"shipToType": "SHIP_TO_ADDRESS",
"shipToUnitPrice": 20,
"shipToUnitPriceInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"shipmentInstructions": "Handle with care",
"taxCode": "FR01",
"taxDetails": [
{
"amount": 34.56,
"amountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"attributes": {},
"currency": "USD",
"name": "STATE",
"rate": 10,
"rateType": "PERCENTAGE",
"taxCode": "FR01"
}
]
}
],
"statusDescription": "Order Created",
"subtype": "INTERNATIONAL",
"taxTotal": 12.34,
"taxTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"type": "WEB",
"requestContext": {
"id": "a05b72dc-78d8-4ea4-90fc-2fe6a1fe1111",
"type": "<string>",
"requestTime": "2022-04-12T09:30:31.198Z",
"attributes": {
"attribute": "N",
"someFlag": True
}
}
}
headers = {
"x-fabric-tenant-id": "<x-fabric-tenant-id>",
"x-fabric-channel-id": "<x-fabric-channel-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-fabric-tenant-id': '<x-fabric-tenant-id>',
'x-fabric-channel-id': '<x-fabric-channel-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
items: [
{
itemId: 1234,
lineItemId: 'b03b72dc-78d8-4ea4-90fc-2fe6a1fe6569',
lineItemNumber: 1,
shipToId: 'b03b72dc-78d8-4ea4-90fc-2fe6a1fe6569',
sku: 'P1234',
adjustments: [
{
adjustmentCounter: 1,
amount: 2.4,
amountInCurrencies: [{currency: 'USD', group: 'SHOPPER', amount: 123.45}],
attributes: {number: 'XlQZTmFDFtPFGMxJP6oiAqN3vo+qKZ'},
cancelQuantity: 2,
invoiceQuantity: 10,
notes: 'Any additional info',
quantity: 2,
reasonCode: 'RFC',
returnQuantity: 1,
subReasonCode: 'Late shipping'
}
],
attributes: {colorCode: '001', isDonation: 'false', style: '570223020'},
currency: 'USD',
discounts: [
{
amount: 2.4,
amountInCurrencies: [{currency: 'USD', group: 'SHOPPER', amount: 123.45}],
promotionCode: 'HNY2022',
promotionId: 'HNY2022',
promotionName: 'New Year',
quantity: 2,
type: 'promotion',
unit: 'AMOUNT_OFF',
value: 2
}
],
employeeId: '62272e917b12209e68751d94',
fees: [
{
amount: 34.56,
amountInCurrencies: [{currency: 'USD', group: 'SHOPPER', amount: 123.45}],
attributes: {},
currency: 'USD',
name: 'STATE',
rate: 10,
rateType: 'PERCENTAGE',
taxCode: 'FR01'
}
],
fulfillment: {
isFulfillable: true,
isInventoryManaged: true,
locationNumber: 123,
trackingDetails: {
trackingNumber: '1ZH4E331YW37690225',
trackingURL: 'https://www.ups.com/track?tracknum=1ZH4E331YW37690225'
},
attributes: {attribute1: 'value'}
},
isBackorder: true,
isDonation: true,
isPreorder: true,
itemAdjustmentTotalInCurrencies: [{currency: 'USD', group: 'SHOPPER', amount: 123.45}],
itemDiscountsTotal: 10,
itemDiscountsTotalInCurrencies: [{currency: 'USD', group: 'SHOPPER', amount: 123.45}],
itemFeeTotal: 10,
itemFeeTotalInCurrencies: [{currency: 'USD', group: 'SHOPPER', amount: 123.45}],
itemName: 'Item',
itemSubtotal: 600,
itemSubtotalInCurrencies: [{currency: 'USD', group: 'SHOPPER', amount: 123.45}],
itemSubtype: 'Borderfree',
itemTaxTotal: 10,
itemTaxTotalInCurrencies: [{currency: 'USD', group: 'SHOPPER', amount: 123.45}],
itemTotal: 10,
itemTotalInCurrencies: [{currency: 'USD', group: 'SHOPPER', amount: 123.45}],
itemUnitPrice: 10,
itemUnitPriceInCurrencies: [{currency: 'USD', group: 'SHOPPER', amount: 123.45}],
notes: [
{
createdAt: '2022-05-12T09:30:31.198Z',
notes: 'Fragile - handle with care',
user: '62272e917b12209e68751d94'
}
],
orderedQuantity: 60,
segment: 'P1234',
taxCode: 'FR01',
taxDetails: [
{
amount: 34.56,
amountInCurrencies: [{currency: 'USD', group: 'SHOPPER', amount: 123.45}],
attributes: {},
currency: 'USD',
name: 'STATE',
rate: 10,
rateType: 'PERCENTAGE',
taxCode: 'FR01'
}
],
type: 'WEB_SHIP',
uom: 'EA',
vendorId: 'P1234'
}
],
orderNumber: '309019176',
statusCode: 'ORDER_CREATED',
adjustmentTotal: 123.45,
adjustmentTotalInCurrencies: [{currency: 'USD', group: 'SHOPPER', amount: 123.45}],
adjustments: [
{
adjustmentCounter: 1,
amount: 2.4,
amountInCurrencies: [{currency: 'USD', group: 'SHOPPER', amount: 123.45}],
attributes: {number: 'XlQZTmFDFtPFGMxJP6oiAqN3vo+qKZ'},
cancelQuantity: 2,
invoiceQuantity: 10,
notes: 'Any additional info',
quantity: 2,
reasonCode: 'RFC',
returnQuantity: 1,
subReasonCode: 'Late shipping'
}
],
attributes: {fraudCheckStatus: 'UPDATED', fraudStatus: 'FRAUD_PASS'},
cartId: 'b03b72dc-78d8-4ea4-90fc-2fe6a1fe6569',
currencies: {
groups: [
{
currency: 'USD',
group: 'SHOPPER',
attributes: {fxId: 'ID123'},
conversionRate: 1
}
],
primaryCurrency: 'SHOPPER'
},
currency: 'USD',
customer: {
accountId: '62272e917b12209e68751d94',
company: 'Demo Inc',
email: 'test@example.com',
employeeId: '62272e917b12209e68751d94',
name: {firstName: 'Alex', lastName: 'Doe', middleName: 'E'},
phone: {number: '123-456-7890', type: 'MOBILE'},
userId: '62272e917b12209e68751d94'
},
discounts: [
{
amount: 2.4,
amountInCurrencies: [{currency: 'USD', group: 'SHOPPER', amount: 123.45}],
promotionCode: 'HNY2022',
promotionId: 'HNY2022',
promotionName: 'New Year',
quantity: 2,
type: 'promotion',
unit: 'AMOUNT_OFF',
value: 2
}
],
employeeId: '62272e917b12209e68751d94',
feeTotal: 12.34,
feeTotalInCurrencies: [{currency: 'USD', group: 'SHOPPER', amount: 123.45}],
fees: [
{
amount: 34.56,
amountInCurrencies: [{currency: 'USD', group: 'SHOPPER', amount: 123.45}],
attributes: {},
currency: 'USD',
invoicedAmount: 34.56,
invoicedAmountInCurrencies: [{currency: 'USD', group: 'SHOPPER', amount: 123.45}],
name: 'STATE',
rate: 10,
rateType: 'PERCENTAGE',
taxCode: 'FR01'
}
],
notes: [
{
createdAt: '2022-05-12T09:30:31.198Z',
notes: 'Fragile - handle with care',
user: '62272e917b12209e68751d94'
}
],
orderDiscount: 1.23,
orderDiscountInCurrencies: [{currency: 'USD', group: 'SHOPPER', amount: 123.45}],
orderExternalId: '191763090_O1231',
orderSubtotal: 123.45,
orderSubtotalInCurrencies: [{currency: 'USD', group: 'SHOPPER', amount: 123.45}],
orderTotal: 146.9,
orderTotalInCurrencies: [{currency: 'USD', group: 'SHOPPER', amount: 123.45}],
orderedAt: '2022-05-12T09:30:31.198Z',
payments: [
{
attributes: {
captureCurrencyCode: 'USD',
payerId: 'M7AWTK3YK3B46',
referenceId: '4DY41894J2904533S'
},
authorizationExpirationDate: '2022-01-27T16:15:58-05:00',
authorizedAmount: 123.2,
authorizedAmountInCurrencies: [{currency: 'USD', group: 'SHOPPER', amount: 123.45}],
chargedAmount: 60,
chargedAmountInCurrencies: [{currency: 'USD', group: 'SHOPPER', amount: 123.45}],
currency: 'USD',
paidAt: '2022-01-27T16:15:58-05:00',
paymentCounter: 1,
paymentIdentifier: {
cardIdentifier: '3456',
expirationMonth: '12',
expirationYear: '2029',
fabricPaymentReference: 'f886c96c-5f65-11ed-9b6a-0242ac120002',
paymentId: '62272e917b12209e68751d94'
},
paymentMethod: 'CREDIT_CARD',
paymentProvider: 'stripe',
paymentStatus: 'Paid',
paymentToken: {paymentType: 'VISA', token: 'pi_34tr6787rt'}
}
],
retail: {
cashierId: 'C-123',
locationNumber: 'WH334',
registerId: '113',
transactionId: '328942333412'
},
shipInfo: [
{
shipToId: 'b03b72dc-78d8-4ea4-90fc-2fe6a1fe6569',
attributes: {giftMessage: '[]'},
discounts: [
{
amount: 2.99,
amountInCurrencies: [{currency: 'USD', group: 'SHOPPER', amount: 123.45}],
promotionCode: 'SHIPFREE',
promotionId: 'SHIPFREE',
promotionName: 'Free Shipping',
quantity: 1,
unit: 'AMOUNT_OFF',
value: 10
}
],
estimatedDeliveryDate: '2022-05-12T09:30:31.198Z',
estimatedShipDate: '2022-05-12T09:30:31.198Z',
isInvoiced: true,
locationNumber: 'WH334',
pickups: [
{
email: 'test@example.com',
name: {firstName: 'Alex', lastName: 'Doe', middleName: 'E'},
phone: {number: '123-456-7890', type: 'MOBILE'},
pickupType: 'PRIMARY'
}
],
shipMethod: 'Parcel post delivery',
shipToDiscount: 12.6,
shipToDiscountInCurrencies: [{currency: 'USD', group: 'SHOPPER', amount: 123.45}],
shipToPrice: 20,
shipToPriceInCurrencies: [{currency: 'USD', group: 'SHOPPER', amount: 123.45}],
shipToTaxTotal: 12.6,
shipToTaxTotalInCurrencies: [{currency: 'USD', group: 'SHOPPER', amount: 123.45}],
shipToType: 'SHIP_TO_ADDRESS',
shipToUnitPrice: 20,
shipToUnitPriceInCurrencies: [{currency: 'USD', group: 'SHOPPER', amount: 123.45}],
shipmentInstructions: 'Handle with care',
taxCode: 'FR01',
taxDetails: [
{
amount: 34.56,
amountInCurrencies: [{currency: 'USD', group: 'SHOPPER', amount: 123.45}],
attributes: {},
currency: 'USD',
name: 'STATE',
rate: 10,
rateType: 'PERCENTAGE',
taxCode: 'FR01'
}
]
}
],
statusDescription: 'Order Created',
subtype: 'INTERNATIONAL',
taxTotal: 12.34,
taxTotalInCurrencies: [{currency: 'USD', group: 'SHOPPER', amount: 123.45}],
type: 'WEB',
requestContext: {
id: 'a05b72dc-78d8-4ea4-90fc-2fe6a1fe1111',
type: '<string>',
requestTime: '2022-04-12T09:30:31.198Z',
attributes: {attribute: 'N', someFlag: true}
}
})
};
fetch('https://api.fabric.inc/v3/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://api.fabric.inc/v3/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([
'items' => [
[
'itemId' => 1234,
'lineItemId' => 'b03b72dc-78d8-4ea4-90fc-2fe6a1fe6569',
'lineItemNumber' => 1,
'shipToId' => 'b03b72dc-78d8-4ea4-90fc-2fe6a1fe6569',
'sku' => 'P1234',
'adjustments' => [
[
'adjustmentCounter' => 1,
'amount' => 2.4,
'amountInCurrencies' => [
[
'currency' => 'USD',
'group' => 'SHOPPER',
'amount' => 123.45
]
],
'attributes' => [
'number' => 'XlQZTmFDFtPFGMxJP6oiAqN3vo+qKZ'
],
'cancelQuantity' => 2,
'invoiceQuantity' => 10,
'notes' => 'Any additional info',
'quantity' => 2,
'reasonCode' => 'RFC',
'returnQuantity' => 1,
'subReasonCode' => 'Late shipping'
]
],
'attributes' => [
'colorCode' => '001',
'isDonation' => 'false',
'style' => '570223020'
],
'currency' => 'USD',
'discounts' => [
[
'amount' => 2.4,
'amountInCurrencies' => [
[
'currency' => 'USD',
'group' => 'SHOPPER',
'amount' => 123.45
]
],
'promotionCode' => 'HNY2022',
'promotionId' => 'HNY2022',
'promotionName' => 'New Year',
'quantity' => 2,
'type' => 'promotion',
'unit' => 'AMOUNT_OFF',
'value' => 2
]
],
'employeeId' => '62272e917b12209e68751d94',
'fees' => [
[
'amount' => 34.56,
'amountInCurrencies' => [
[
'currency' => 'USD',
'group' => 'SHOPPER',
'amount' => 123.45
]
],
'attributes' => [
],
'currency' => 'USD',
'name' => 'STATE',
'rate' => 10,
'rateType' => 'PERCENTAGE',
'taxCode' => 'FR01'
]
],
'fulfillment' => [
'isFulfillable' => true,
'isInventoryManaged' => true,
'locationNumber' => 123,
'trackingDetails' => [
'trackingNumber' => '1ZH4E331YW37690225',
'trackingURL' => 'https://www.ups.com/track?tracknum=1ZH4E331YW37690225'
],
'attributes' => [
'attribute1' => 'value'
]
],
'isBackorder' => true,
'isDonation' => true,
'isPreorder' => true,
'itemAdjustmentTotalInCurrencies' => [
[
'currency' => 'USD',
'group' => 'SHOPPER',
'amount' => 123.45
]
],
'itemDiscountsTotal' => 10,
'itemDiscountsTotalInCurrencies' => [
[
'currency' => 'USD',
'group' => 'SHOPPER',
'amount' => 123.45
]
],
'itemFeeTotal' => 10,
'itemFeeTotalInCurrencies' => [
[
'currency' => 'USD',
'group' => 'SHOPPER',
'amount' => 123.45
]
],
'itemName' => 'Item',
'itemSubtotal' => 600,
'itemSubtotalInCurrencies' => [
[
'currency' => 'USD',
'group' => 'SHOPPER',
'amount' => 123.45
]
],
'itemSubtype' => 'Borderfree',
'itemTaxTotal' => 10,
'itemTaxTotalInCurrencies' => [
[
'currency' => 'USD',
'group' => 'SHOPPER',
'amount' => 123.45
]
],
'itemTotal' => 10,
'itemTotalInCurrencies' => [
[
'currency' => 'USD',
'group' => 'SHOPPER',
'amount' => 123.45
]
],
'itemUnitPrice' => 10,
'itemUnitPriceInCurrencies' => [
[
'currency' => 'USD',
'group' => 'SHOPPER',
'amount' => 123.45
]
],
'notes' => [
[
'createdAt' => '2022-05-12T09:30:31.198Z',
'notes' => 'Fragile - handle with care',
'user' => '62272e917b12209e68751d94'
]
],
'orderedQuantity' => 60,
'segment' => 'P1234',
'taxCode' => 'FR01',
'taxDetails' => [
[
'amount' => 34.56,
'amountInCurrencies' => [
[
'currency' => 'USD',
'group' => 'SHOPPER',
'amount' => 123.45
]
],
'attributes' => [
],
'currency' => 'USD',
'name' => 'STATE',
'rate' => 10,
'rateType' => 'PERCENTAGE',
'taxCode' => 'FR01'
]
],
'type' => 'WEB_SHIP',
'uom' => 'EA',
'vendorId' => 'P1234'
]
],
'orderNumber' => '309019176',
'statusCode' => 'ORDER_CREATED',
'adjustmentTotal' => 123.45,
'adjustmentTotalInCurrencies' => [
[
'currency' => 'USD',
'group' => 'SHOPPER',
'amount' => 123.45
]
],
'adjustments' => [
[
'adjustmentCounter' => 1,
'amount' => 2.4,
'amountInCurrencies' => [
[
'currency' => 'USD',
'group' => 'SHOPPER',
'amount' => 123.45
]
],
'attributes' => [
'number' => 'XlQZTmFDFtPFGMxJP6oiAqN3vo+qKZ'
],
'cancelQuantity' => 2,
'invoiceQuantity' => 10,
'notes' => 'Any additional info',
'quantity' => 2,
'reasonCode' => 'RFC',
'returnQuantity' => 1,
'subReasonCode' => 'Late shipping'
]
],
'attributes' => [
'fraudCheckStatus' => 'UPDATED',
'fraudStatus' => 'FRAUD_PASS'
],
'cartId' => 'b03b72dc-78d8-4ea4-90fc-2fe6a1fe6569',
'currencies' => [
'groups' => [
[
'currency' => 'USD',
'group' => 'SHOPPER',
'attributes' => [
'fxId' => 'ID123'
],
'conversionRate' => 1
]
],
'primaryCurrency' => 'SHOPPER'
],
'currency' => 'USD',
'customer' => [
'accountId' => '62272e917b12209e68751d94',
'company' => 'Demo Inc',
'email' => 'test@example.com',
'employeeId' => '62272e917b12209e68751d94',
'name' => [
'firstName' => 'Alex',
'lastName' => 'Doe',
'middleName' => 'E'
],
'phone' => [
'number' => '123-456-7890',
'type' => 'MOBILE'
],
'userId' => '62272e917b12209e68751d94'
],
'discounts' => [
[
'amount' => 2.4,
'amountInCurrencies' => [
[
'currency' => 'USD',
'group' => 'SHOPPER',
'amount' => 123.45
]
],
'promotionCode' => 'HNY2022',
'promotionId' => 'HNY2022',
'promotionName' => 'New Year',
'quantity' => 2,
'type' => 'promotion',
'unit' => 'AMOUNT_OFF',
'value' => 2
]
],
'employeeId' => '62272e917b12209e68751d94',
'feeTotal' => 12.34,
'feeTotalInCurrencies' => [
[
'currency' => 'USD',
'group' => 'SHOPPER',
'amount' => 123.45
]
],
'fees' => [
[
'amount' => 34.56,
'amountInCurrencies' => [
[
'currency' => 'USD',
'group' => 'SHOPPER',
'amount' => 123.45
]
],
'attributes' => [
],
'currency' => 'USD',
'invoicedAmount' => 34.56,
'invoicedAmountInCurrencies' => [
[
'currency' => 'USD',
'group' => 'SHOPPER',
'amount' => 123.45
]
],
'name' => 'STATE',
'rate' => 10,
'rateType' => 'PERCENTAGE',
'taxCode' => 'FR01'
]
],
'notes' => [
[
'createdAt' => '2022-05-12T09:30:31.198Z',
'notes' => 'Fragile - handle with care',
'user' => '62272e917b12209e68751d94'
]
],
'orderDiscount' => 1.23,
'orderDiscountInCurrencies' => [
[
'currency' => 'USD',
'group' => 'SHOPPER',
'amount' => 123.45
]
],
'orderExternalId' => '191763090_O1231',
'orderSubtotal' => 123.45,
'orderSubtotalInCurrencies' => [
[
'currency' => 'USD',
'group' => 'SHOPPER',
'amount' => 123.45
]
],
'orderTotal' => 146.9,
'orderTotalInCurrencies' => [
[
'currency' => 'USD',
'group' => 'SHOPPER',
'amount' => 123.45
]
],
'orderedAt' => '2022-05-12T09:30:31.198Z',
'payments' => [
[
'attributes' => [
'captureCurrencyCode' => 'USD',
'payerId' => 'M7AWTK3YK3B46',
'referenceId' => '4DY41894J2904533S'
],
'authorizationExpirationDate' => '2022-01-27T16:15:58-05:00',
'authorizedAmount' => 123.2,
'authorizedAmountInCurrencies' => [
[
'currency' => 'USD',
'group' => 'SHOPPER',
'amount' => 123.45
]
],
'chargedAmount' => 60,
'chargedAmountInCurrencies' => [
[
'currency' => 'USD',
'group' => 'SHOPPER',
'amount' => 123.45
]
],
'currency' => 'USD',
'paidAt' => '2022-01-27T16:15:58-05:00',
'paymentCounter' => 1,
'paymentIdentifier' => [
'cardIdentifier' => '3456',
'expirationMonth' => '12',
'expirationYear' => '2029',
'fabricPaymentReference' => 'f886c96c-5f65-11ed-9b6a-0242ac120002',
'paymentId' => '62272e917b12209e68751d94'
],
'paymentMethod' => 'CREDIT_CARD',
'paymentProvider' => 'stripe',
'paymentStatus' => 'Paid',
'paymentToken' => [
'paymentType' => 'VISA',
'token' => 'pi_34tr6787rt'
]
]
],
'retail' => [
'cashierId' => 'C-123',
'locationNumber' => 'WH334',
'registerId' => '113',
'transactionId' => '328942333412'
],
'shipInfo' => [
[
'shipToId' => 'b03b72dc-78d8-4ea4-90fc-2fe6a1fe6569',
'attributes' => [
'giftMessage' => '[]'
],
'discounts' => [
[
'amount' => 2.99,
'amountInCurrencies' => [
[
'currency' => 'USD',
'group' => 'SHOPPER',
'amount' => 123.45
]
],
'promotionCode' => 'SHIPFREE',
'promotionId' => 'SHIPFREE',
'promotionName' => 'Free Shipping',
'quantity' => 1,
'unit' => 'AMOUNT_OFF',
'value' => 10
]
],
'estimatedDeliveryDate' => '2022-05-12T09:30:31.198Z',
'estimatedShipDate' => '2022-05-12T09:30:31.198Z',
'isInvoiced' => true,
'locationNumber' => 'WH334',
'pickups' => [
[
'email' => 'test@example.com',
'name' => [
'firstName' => 'Alex',
'lastName' => 'Doe',
'middleName' => 'E'
],
'phone' => [
'number' => '123-456-7890',
'type' => 'MOBILE'
],
'pickupType' => 'PRIMARY'
]
],
'shipMethod' => 'Parcel post delivery',
'shipToDiscount' => 12.6,
'shipToDiscountInCurrencies' => [
[
'currency' => 'USD',
'group' => 'SHOPPER',
'amount' => 123.45
]
],
'shipToPrice' => 20,
'shipToPriceInCurrencies' => [
[
'currency' => 'USD',
'group' => 'SHOPPER',
'amount' => 123.45
]
],
'shipToTaxTotal' => 12.6,
'shipToTaxTotalInCurrencies' => [
[
'currency' => 'USD',
'group' => 'SHOPPER',
'amount' => 123.45
]
],
'shipToType' => 'SHIP_TO_ADDRESS',
'shipToUnitPrice' => 20,
'shipToUnitPriceInCurrencies' => [
[
'currency' => 'USD',
'group' => 'SHOPPER',
'amount' => 123.45
]
],
'shipmentInstructions' => 'Handle with care',
'taxCode' => 'FR01',
'taxDetails' => [
[
'amount' => 34.56,
'amountInCurrencies' => [
[
'currency' => 'USD',
'group' => 'SHOPPER',
'amount' => 123.45
]
],
'attributes' => [
],
'currency' => 'USD',
'name' => 'STATE',
'rate' => 10,
'rateType' => 'PERCENTAGE',
'taxCode' => 'FR01'
]
]
]
],
'statusDescription' => 'Order Created',
'subtype' => 'INTERNATIONAL',
'taxTotal' => 12.34,
'taxTotalInCurrencies' => [
[
'currency' => 'USD',
'group' => 'SHOPPER',
'amount' => 123.45
]
],
'type' => 'WEB',
'requestContext' => [
'id' => 'a05b72dc-78d8-4ea4-90fc-2fe6a1fe1111',
'type' => '<string>',
'requestTime' => '2022-04-12T09:30:31.198Z',
'attributes' => [
'attribute' => 'N',
'someFlag' => true
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-fabric-channel-id: <x-fabric-channel-id>",
"x-fabric-tenant-id: <x-fabric-tenant-id>"
],
]);
$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://api.fabric.inc/v3/orders"
payload := strings.NewReader("{\n \"items\": [\n {\n \"itemId\": 1234,\n \"lineItemId\": \"b03b72dc-78d8-4ea4-90fc-2fe6a1fe6569\",\n \"lineItemNumber\": 1,\n \"shipToId\": \"b03b72dc-78d8-4ea4-90fc-2fe6a1fe6569\",\n \"sku\": \"P1234\",\n \"adjustments\": [\n {\n \"adjustmentCounter\": 1,\n \"amount\": 2.4,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"attributes\": {\n \"number\": \"XlQZTmFDFtPFGMxJP6oiAqN3vo+qKZ\"\n },\n \"cancelQuantity\": 2,\n \"invoiceQuantity\": 10,\n \"notes\": \"Any additional info\",\n \"quantity\": 2,\n \"reasonCode\": \"RFC\",\n \"returnQuantity\": 1,\n \"subReasonCode\": \"Late shipping\"\n }\n ],\n \"attributes\": {\n \"colorCode\": \"001\",\n \"isDonation\": \"false\",\n \"style\": \"570223020\"\n },\n \"currency\": \"USD\",\n \"discounts\": [\n {\n \"amount\": 2.4,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"promotionCode\": \"HNY2022\",\n \"promotionId\": \"HNY2022\",\n \"promotionName\": \"New Year\",\n \"quantity\": 2,\n \"type\": \"promotion\",\n \"unit\": \"AMOUNT_OFF\",\n \"value\": 2\n }\n ],\n \"employeeId\": \"62272e917b12209e68751d94\",\n \"fees\": [\n {\n \"amount\": 34.56,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"attributes\": {},\n \"currency\": \"USD\",\n \"name\": \"STATE\",\n \"rate\": 10,\n \"rateType\": \"PERCENTAGE\",\n \"taxCode\": \"FR01\"\n }\n ],\n \"fulfillment\": {\n \"isFulfillable\": true,\n \"isInventoryManaged\": true,\n \"locationNumber\": 123,\n \"trackingDetails\": {\n \"trackingNumber\": \"1ZH4E331YW37690225\",\n \"trackingURL\": \"https://www.ups.com/track?tracknum=1ZH4E331YW37690225\"\n },\n \"attributes\": {\n \"attribute1\": \"value\"\n }\n },\n \"isBackorder\": true,\n \"isDonation\": true,\n \"isPreorder\": true,\n \"itemAdjustmentTotalInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"itemDiscountsTotal\": 10,\n \"itemDiscountsTotalInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"itemFeeTotal\": 10,\n \"itemFeeTotalInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"itemName\": \"Item\",\n \"itemSubtotal\": 600,\n \"itemSubtotalInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"itemSubtype\": \"Borderfree\",\n \"itemTaxTotal\": 10,\n \"itemTaxTotalInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"itemTotal\": 10,\n \"itemTotalInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"itemUnitPrice\": 10,\n \"itemUnitPriceInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"notes\": [\n {\n \"createdAt\": \"2022-05-12T09:30:31.198Z\",\n \"notes\": \"Fragile - handle with care\",\n \"user\": \"62272e917b12209e68751d94\"\n }\n ],\n \"orderedQuantity\": 60,\n \"segment\": \"P1234\",\n \"taxCode\": \"FR01\",\n \"taxDetails\": [\n {\n \"amount\": 34.56,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"attributes\": {},\n \"currency\": \"USD\",\n \"name\": \"STATE\",\n \"rate\": 10,\n \"rateType\": \"PERCENTAGE\",\n \"taxCode\": \"FR01\"\n }\n ],\n \"type\": \"WEB_SHIP\",\n \"uom\": \"EA\",\n \"vendorId\": \"P1234\"\n }\n ],\n \"orderNumber\": \"309019176\",\n \"statusCode\": \"ORDER_CREATED\",\n \"adjustmentTotal\": 123.45,\n \"adjustmentTotalInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"adjustments\": [\n {\n \"adjustmentCounter\": 1,\n \"amount\": 2.4,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"attributes\": {\n \"number\": \"XlQZTmFDFtPFGMxJP6oiAqN3vo+qKZ\"\n },\n \"cancelQuantity\": 2,\n \"invoiceQuantity\": 10,\n \"notes\": \"Any additional info\",\n \"quantity\": 2,\n \"reasonCode\": \"RFC\",\n \"returnQuantity\": 1,\n \"subReasonCode\": \"Late shipping\"\n }\n ],\n \"attributes\": {\n \"fraudCheckStatus\": \"UPDATED\",\n \"fraudStatus\": \"FRAUD_PASS\"\n },\n \"cartId\": \"b03b72dc-78d8-4ea4-90fc-2fe6a1fe6569\",\n \"currencies\": {\n \"groups\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"attributes\": {\n \"fxId\": \"ID123\"\n },\n \"conversionRate\": 1\n }\n ],\n \"primaryCurrency\": \"SHOPPER\"\n },\n \"currency\": \"USD\",\n \"customer\": {\n \"accountId\": \"62272e917b12209e68751d94\",\n \"company\": \"Demo Inc\",\n \"email\": \"test@example.com\",\n \"employeeId\": \"62272e917b12209e68751d94\",\n \"name\": {\n \"firstName\": \"Alex\",\n \"lastName\": \"Doe\",\n \"middleName\": \"E\"\n },\n \"phone\": {\n \"number\": \"123-456-7890\",\n \"type\": \"MOBILE\"\n },\n \"userId\": \"62272e917b12209e68751d94\"\n },\n \"discounts\": [\n {\n \"amount\": 2.4,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"promotionCode\": \"HNY2022\",\n \"promotionId\": \"HNY2022\",\n \"promotionName\": \"New Year\",\n \"quantity\": 2,\n \"type\": \"promotion\",\n \"unit\": \"AMOUNT_OFF\",\n \"value\": 2\n }\n ],\n \"employeeId\": \"62272e917b12209e68751d94\",\n \"feeTotal\": 12.34,\n \"feeTotalInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"fees\": [\n {\n \"amount\": 34.56,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"attributes\": {},\n \"currency\": \"USD\",\n \"invoicedAmount\": 34.56,\n \"invoicedAmountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"name\": \"STATE\",\n \"rate\": 10,\n \"rateType\": \"PERCENTAGE\",\n \"taxCode\": \"FR01\"\n }\n ],\n \"notes\": [\n {\n \"createdAt\": \"2022-05-12T09:30:31.198Z\",\n \"notes\": \"Fragile - handle with care\",\n \"user\": \"62272e917b12209e68751d94\"\n }\n ],\n \"orderDiscount\": 1.23,\n \"orderDiscountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"orderExternalId\": \"191763090_O1231\",\n \"orderSubtotal\": 123.45,\n \"orderSubtotalInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"orderTotal\": 146.9,\n \"orderTotalInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"orderedAt\": \"2022-05-12T09:30:31.198Z\",\n \"payments\": [\n {\n \"attributes\": {\n \"captureCurrencyCode\": \"USD\",\n \"payerId\": \"M7AWTK3YK3B46\",\n \"referenceId\": \"4DY41894J2904533S\"\n },\n \"authorizationExpirationDate\": \"2022-01-27T16:15:58-05:00\",\n \"authorizedAmount\": 123.2,\n \"authorizedAmountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"chargedAmount\": 60,\n \"chargedAmountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"currency\": \"USD\",\n \"paidAt\": \"2022-01-27T16:15:58-05:00\",\n \"paymentCounter\": 1,\n \"paymentIdentifier\": {\n \"cardIdentifier\": \"3456\",\n \"expirationMonth\": \"12\",\n \"expirationYear\": \"2029\",\n \"fabricPaymentReference\": \"f886c96c-5f65-11ed-9b6a-0242ac120002\",\n \"paymentId\": \"62272e917b12209e68751d94\"\n },\n \"paymentMethod\": \"CREDIT_CARD\",\n \"paymentProvider\": \"stripe\",\n \"paymentStatus\": \"Paid\",\n \"paymentToken\": {\n \"paymentType\": \"VISA\",\n \"token\": \"pi_34tr6787rt\"\n }\n }\n ],\n \"retail\": {\n \"cashierId\": \"C-123\",\n \"locationNumber\": \"WH334\",\n \"registerId\": \"113\",\n \"transactionId\": \"328942333412\"\n },\n \"shipInfo\": [\n {\n \"shipToId\": \"b03b72dc-78d8-4ea4-90fc-2fe6a1fe6569\",\n \"attributes\": {\n \"giftMessage\": \"[]\"\n },\n \"discounts\": [\n {\n \"amount\": 2.99,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"promotionCode\": \"SHIPFREE\",\n \"promotionId\": \"SHIPFREE\",\n \"promotionName\": \"Free Shipping\",\n \"quantity\": 1,\n \"unit\": \"AMOUNT_OFF\",\n \"value\": 10\n }\n ],\n \"estimatedDeliveryDate\": \"2022-05-12T09:30:31.198Z\",\n \"estimatedShipDate\": \"2022-05-12T09:30:31.198Z\",\n \"isInvoiced\": true,\n \"locationNumber\": \"WH334\",\n \"pickups\": [\n {\n \"email\": \"test@example.com\",\n \"name\": {\n \"firstName\": \"Alex\",\n \"lastName\": \"Doe\",\n \"middleName\": \"E\"\n },\n \"phone\": {\n \"number\": \"123-456-7890\",\n \"type\": \"MOBILE\"\n },\n \"pickupType\": \"PRIMARY\"\n }\n ],\n \"shipMethod\": \"Parcel post delivery\",\n \"shipToDiscount\": 12.6,\n \"shipToDiscountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"shipToPrice\": 20,\n \"shipToPriceInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"shipToTaxTotal\": 12.6,\n \"shipToTaxTotalInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"shipToType\": \"SHIP_TO_ADDRESS\",\n \"shipToUnitPrice\": 20,\n \"shipToUnitPriceInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"shipmentInstructions\": \"Handle with care\",\n \"taxCode\": \"FR01\",\n \"taxDetails\": [\n {\n \"amount\": 34.56,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"attributes\": {},\n \"currency\": \"USD\",\n \"name\": \"STATE\",\n \"rate\": 10,\n \"rateType\": \"PERCENTAGE\",\n \"taxCode\": \"FR01\"\n }\n ]\n }\n ],\n \"statusDescription\": \"Order Created\",\n \"subtype\": \"INTERNATIONAL\",\n \"taxTotal\": 12.34,\n \"taxTotalInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"type\": \"WEB\",\n \"requestContext\": {\n \"id\": \"a05b72dc-78d8-4ea4-90fc-2fe6a1fe1111\",\n \"type\": \"<string>\",\n \"requestTime\": \"2022-04-12T09:30:31.198Z\",\n \"attributes\": {\n \"attribute\": \"N\",\n \"someFlag\": true\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-fabric-tenant-id", "<x-fabric-tenant-id>")
req.Header.Add("x-fabric-channel-id", "<x-fabric-channel-id>")
req.Header.Add("Authorization", "Bearer <token>")
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://api.fabric.inc/v3/orders")
.header("x-fabric-tenant-id", "<x-fabric-tenant-id>")
.header("x-fabric-channel-id", "<x-fabric-channel-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"items\": [\n {\n \"itemId\": 1234,\n \"lineItemId\": \"b03b72dc-78d8-4ea4-90fc-2fe6a1fe6569\",\n \"lineItemNumber\": 1,\n \"shipToId\": \"b03b72dc-78d8-4ea4-90fc-2fe6a1fe6569\",\n \"sku\": \"P1234\",\n \"adjustments\": [\n {\n \"adjustmentCounter\": 1,\n \"amount\": 2.4,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"attributes\": {\n \"number\": \"XlQZTmFDFtPFGMxJP6oiAqN3vo+qKZ\"\n },\n \"cancelQuantity\": 2,\n \"invoiceQuantity\": 10,\n \"notes\": \"Any additional info\",\n \"quantity\": 2,\n \"reasonCode\": \"RFC\",\n \"returnQuantity\": 1,\n \"subReasonCode\": \"Late shipping\"\n }\n ],\n \"attributes\": {\n \"colorCode\": \"001\",\n \"isDonation\": \"false\",\n \"style\": \"570223020\"\n },\n \"currency\": \"USD\",\n \"discounts\": [\n {\n \"amount\": 2.4,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"promotionCode\": \"HNY2022\",\n \"promotionId\": \"HNY2022\",\n \"promotionName\": \"New Year\",\n \"quantity\": 2,\n \"type\": \"promotion\",\n \"unit\": \"AMOUNT_OFF\",\n \"value\": 2\n }\n ],\n \"employeeId\": \"62272e917b12209e68751d94\",\n \"fees\": [\n {\n \"amount\": 34.56,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"attributes\": {},\n \"currency\": \"USD\",\n \"name\": \"STATE\",\n \"rate\": 10,\n \"rateType\": \"PERCENTAGE\",\n \"taxCode\": \"FR01\"\n }\n ],\n \"fulfillment\": {\n \"isFulfillable\": true,\n \"isInventoryManaged\": true,\n \"locationNumber\": 123,\n \"trackingDetails\": {\n \"trackingNumber\": \"1ZH4E331YW37690225\",\n \"trackingURL\": \"https://www.ups.com/track?tracknum=1ZH4E331YW37690225\"\n },\n \"attributes\": {\n \"attribute1\": \"value\"\n }\n },\n \"isBackorder\": true,\n \"isDonation\": true,\n \"isPreorder\": true,\n \"itemAdjustmentTotalInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"itemDiscountsTotal\": 10,\n \"itemDiscountsTotalInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"itemFeeTotal\": 10,\n \"itemFeeTotalInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"itemName\": \"Item\",\n \"itemSubtotal\": 600,\n \"itemSubtotalInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"itemSubtype\": \"Borderfree\",\n \"itemTaxTotal\": 10,\n \"itemTaxTotalInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"itemTotal\": 10,\n \"itemTotalInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"itemUnitPrice\": 10,\n \"itemUnitPriceInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"notes\": [\n {\n \"createdAt\": \"2022-05-12T09:30:31.198Z\",\n \"notes\": \"Fragile - handle with care\",\n \"user\": \"62272e917b12209e68751d94\"\n }\n ],\n \"orderedQuantity\": 60,\n \"segment\": \"P1234\",\n \"taxCode\": \"FR01\",\n \"taxDetails\": [\n {\n \"amount\": 34.56,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"attributes\": {},\n \"currency\": \"USD\",\n \"name\": \"STATE\",\n \"rate\": 10,\n \"rateType\": \"PERCENTAGE\",\n \"taxCode\": \"FR01\"\n }\n ],\n \"type\": \"WEB_SHIP\",\n \"uom\": \"EA\",\n \"vendorId\": \"P1234\"\n }\n ],\n \"orderNumber\": \"309019176\",\n \"statusCode\": \"ORDER_CREATED\",\n \"adjustmentTotal\": 123.45,\n \"adjustmentTotalInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"adjustments\": [\n {\n \"adjustmentCounter\": 1,\n \"amount\": 2.4,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"attributes\": {\n \"number\": \"XlQZTmFDFtPFGMxJP6oiAqN3vo+qKZ\"\n },\n \"cancelQuantity\": 2,\n \"invoiceQuantity\": 10,\n \"notes\": \"Any additional info\",\n \"quantity\": 2,\n \"reasonCode\": \"RFC\",\n \"returnQuantity\": 1,\n \"subReasonCode\": \"Late shipping\"\n }\n ],\n \"attributes\": {\n \"fraudCheckStatus\": \"UPDATED\",\n \"fraudStatus\": \"FRAUD_PASS\"\n },\n \"cartId\": \"b03b72dc-78d8-4ea4-90fc-2fe6a1fe6569\",\n \"currencies\": {\n \"groups\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"attributes\": {\n \"fxId\": \"ID123\"\n },\n \"conversionRate\": 1\n }\n ],\n \"primaryCurrency\": \"SHOPPER\"\n },\n \"currency\": \"USD\",\n \"customer\": {\n \"accountId\": \"62272e917b12209e68751d94\",\n \"company\": \"Demo Inc\",\n \"email\": \"test@example.com\",\n \"employeeId\": \"62272e917b12209e68751d94\",\n \"name\": {\n \"firstName\": \"Alex\",\n \"lastName\": \"Doe\",\n \"middleName\": \"E\"\n },\n \"phone\": {\n \"number\": \"123-456-7890\",\n \"type\": \"MOBILE\"\n },\n \"userId\": \"62272e917b12209e68751d94\"\n },\n \"discounts\": [\n {\n \"amount\": 2.4,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"promotionCode\": \"HNY2022\",\n \"promotionId\": \"HNY2022\",\n \"promotionName\": \"New Year\",\n \"quantity\": 2,\n \"type\": \"promotion\",\n \"unit\": \"AMOUNT_OFF\",\n \"value\": 2\n }\n ],\n \"employeeId\": \"62272e917b12209e68751d94\",\n \"feeTotal\": 12.34,\n \"feeTotalInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"fees\": [\n {\n \"amount\": 34.56,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"attributes\": {},\n \"currency\": \"USD\",\n \"invoicedAmount\": 34.56,\n \"invoicedAmountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"name\": \"STATE\",\n \"rate\": 10,\n \"rateType\": \"PERCENTAGE\",\n \"taxCode\": \"FR01\"\n }\n ],\n \"notes\": [\n {\n \"createdAt\": \"2022-05-12T09:30:31.198Z\",\n \"notes\": \"Fragile - handle with care\",\n \"user\": \"62272e917b12209e68751d94\"\n }\n ],\n \"orderDiscount\": 1.23,\n \"orderDiscountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"orderExternalId\": \"191763090_O1231\",\n \"orderSubtotal\": 123.45,\n \"orderSubtotalInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"orderTotal\": 146.9,\n \"orderTotalInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"orderedAt\": \"2022-05-12T09:30:31.198Z\",\n \"payments\": [\n {\n \"attributes\": {\n \"captureCurrencyCode\": \"USD\",\n \"payerId\": \"M7AWTK3YK3B46\",\n \"referenceId\": \"4DY41894J2904533S\"\n },\n \"authorizationExpirationDate\": \"2022-01-27T16:15:58-05:00\",\n \"authorizedAmount\": 123.2,\n \"authorizedAmountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"chargedAmount\": 60,\n \"chargedAmountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"currency\": \"USD\",\n \"paidAt\": \"2022-01-27T16:15:58-05:00\",\n \"paymentCounter\": 1,\n \"paymentIdentifier\": {\n \"cardIdentifier\": \"3456\",\n \"expirationMonth\": \"12\",\n \"expirationYear\": \"2029\",\n \"fabricPaymentReference\": \"f886c96c-5f65-11ed-9b6a-0242ac120002\",\n \"paymentId\": \"62272e917b12209e68751d94\"\n },\n \"paymentMethod\": \"CREDIT_CARD\",\n \"paymentProvider\": \"stripe\",\n \"paymentStatus\": \"Paid\",\n \"paymentToken\": {\n \"paymentType\": \"VISA\",\n \"token\": \"pi_34tr6787rt\"\n }\n }\n ],\n \"retail\": {\n \"cashierId\": \"C-123\",\n \"locationNumber\": \"WH334\",\n \"registerId\": \"113\",\n \"transactionId\": \"328942333412\"\n },\n \"shipInfo\": [\n {\n \"shipToId\": \"b03b72dc-78d8-4ea4-90fc-2fe6a1fe6569\",\n \"attributes\": {\n \"giftMessage\": \"[]\"\n },\n \"discounts\": [\n {\n \"amount\": 2.99,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"promotionCode\": \"SHIPFREE\",\n \"promotionId\": \"SHIPFREE\",\n \"promotionName\": \"Free Shipping\",\n \"quantity\": 1,\n \"unit\": \"AMOUNT_OFF\",\n \"value\": 10\n }\n ],\n \"estimatedDeliveryDate\": \"2022-05-12T09:30:31.198Z\",\n \"estimatedShipDate\": \"2022-05-12T09:30:31.198Z\",\n \"isInvoiced\": true,\n \"locationNumber\": \"WH334\",\n \"pickups\": [\n {\n \"email\": \"test@example.com\",\n \"name\": {\n \"firstName\": \"Alex\",\n \"lastName\": \"Doe\",\n \"middleName\": \"E\"\n },\n \"phone\": {\n \"number\": \"123-456-7890\",\n \"type\": \"MOBILE\"\n },\n \"pickupType\": \"PRIMARY\"\n }\n ],\n \"shipMethod\": \"Parcel post delivery\",\n \"shipToDiscount\": 12.6,\n \"shipToDiscountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"shipToPrice\": 20,\n \"shipToPriceInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"shipToTaxTotal\": 12.6,\n \"shipToTaxTotalInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"shipToType\": \"SHIP_TO_ADDRESS\",\n \"shipToUnitPrice\": 20,\n \"shipToUnitPriceInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"shipmentInstructions\": \"Handle with care\",\n \"taxCode\": \"FR01\",\n \"taxDetails\": [\n {\n \"amount\": 34.56,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"attributes\": {},\n \"currency\": \"USD\",\n \"name\": \"STATE\",\n \"rate\": 10,\n \"rateType\": \"PERCENTAGE\",\n \"taxCode\": \"FR01\"\n }\n ]\n }\n ],\n \"statusDescription\": \"Order Created\",\n \"subtype\": \"INTERNATIONAL\",\n \"taxTotal\": 12.34,\n \"taxTotalInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"type\": \"WEB\",\n \"requestContext\": {\n \"id\": \"a05b72dc-78d8-4ea4-90fc-2fe6a1fe1111\",\n \"type\": \"<string>\",\n \"requestTime\": \"2022-04-12T09:30:31.198Z\",\n \"attributes\": {\n \"attribute\": \"N\",\n \"someFlag\": true\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fabric.inc/v3/orders")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-fabric-tenant-id"] = '<x-fabric-tenant-id>'
request["x-fabric-channel-id"] = '<x-fabric-channel-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"items\": [\n {\n \"itemId\": 1234,\n \"lineItemId\": \"b03b72dc-78d8-4ea4-90fc-2fe6a1fe6569\",\n \"lineItemNumber\": 1,\n \"shipToId\": \"b03b72dc-78d8-4ea4-90fc-2fe6a1fe6569\",\n \"sku\": \"P1234\",\n \"adjustments\": [\n {\n \"adjustmentCounter\": 1,\n \"amount\": 2.4,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"attributes\": {\n \"number\": \"XlQZTmFDFtPFGMxJP6oiAqN3vo+qKZ\"\n },\n \"cancelQuantity\": 2,\n \"invoiceQuantity\": 10,\n \"notes\": \"Any additional info\",\n \"quantity\": 2,\n \"reasonCode\": \"RFC\",\n \"returnQuantity\": 1,\n \"subReasonCode\": \"Late shipping\"\n }\n ],\n \"attributes\": {\n \"colorCode\": \"001\",\n \"isDonation\": \"false\",\n \"style\": \"570223020\"\n },\n \"currency\": \"USD\",\n \"discounts\": [\n {\n \"amount\": 2.4,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"promotionCode\": \"HNY2022\",\n \"promotionId\": \"HNY2022\",\n \"promotionName\": \"New Year\",\n \"quantity\": 2,\n \"type\": \"promotion\",\n \"unit\": \"AMOUNT_OFF\",\n \"value\": 2\n }\n ],\n \"employeeId\": \"62272e917b12209e68751d94\",\n \"fees\": [\n {\n \"amount\": 34.56,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"attributes\": {},\n \"currency\": \"USD\",\n \"name\": \"STATE\",\n \"rate\": 10,\n \"rateType\": \"PERCENTAGE\",\n \"taxCode\": \"FR01\"\n }\n ],\n \"fulfillment\": {\n \"isFulfillable\": true,\n \"isInventoryManaged\": true,\n \"locationNumber\": 123,\n \"trackingDetails\": {\n \"trackingNumber\": \"1ZH4E331YW37690225\",\n \"trackingURL\": \"https://www.ups.com/track?tracknum=1ZH4E331YW37690225\"\n },\n \"attributes\": {\n \"attribute1\": \"value\"\n }\n },\n \"isBackorder\": true,\n \"isDonation\": true,\n \"isPreorder\": true,\n \"itemAdjustmentTotalInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"itemDiscountsTotal\": 10,\n \"itemDiscountsTotalInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"itemFeeTotal\": 10,\n \"itemFeeTotalInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"itemName\": \"Item\",\n \"itemSubtotal\": 600,\n \"itemSubtotalInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"itemSubtype\": \"Borderfree\",\n \"itemTaxTotal\": 10,\n \"itemTaxTotalInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"itemTotal\": 10,\n \"itemTotalInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"itemUnitPrice\": 10,\n \"itemUnitPriceInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"notes\": [\n {\n \"createdAt\": \"2022-05-12T09:30:31.198Z\",\n \"notes\": \"Fragile - handle with care\",\n \"user\": \"62272e917b12209e68751d94\"\n }\n ],\n \"orderedQuantity\": 60,\n \"segment\": \"P1234\",\n \"taxCode\": \"FR01\",\n \"taxDetails\": [\n {\n \"amount\": 34.56,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"attributes\": {},\n \"currency\": \"USD\",\n \"name\": \"STATE\",\n \"rate\": 10,\n \"rateType\": \"PERCENTAGE\",\n \"taxCode\": \"FR01\"\n }\n ],\n \"type\": \"WEB_SHIP\",\n \"uom\": \"EA\",\n \"vendorId\": \"P1234\"\n }\n ],\n \"orderNumber\": \"309019176\",\n \"statusCode\": \"ORDER_CREATED\",\n \"adjustmentTotal\": 123.45,\n \"adjustmentTotalInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"adjustments\": [\n {\n \"adjustmentCounter\": 1,\n \"amount\": 2.4,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"attributes\": {\n \"number\": \"XlQZTmFDFtPFGMxJP6oiAqN3vo+qKZ\"\n },\n \"cancelQuantity\": 2,\n \"invoiceQuantity\": 10,\n \"notes\": \"Any additional info\",\n \"quantity\": 2,\n \"reasonCode\": \"RFC\",\n \"returnQuantity\": 1,\n \"subReasonCode\": \"Late shipping\"\n }\n ],\n \"attributes\": {\n \"fraudCheckStatus\": \"UPDATED\",\n \"fraudStatus\": \"FRAUD_PASS\"\n },\n \"cartId\": \"b03b72dc-78d8-4ea4-90fc-2fe6a1fe6569\",\n \"currencies\": {\n \"groups\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"attributes\": {\n \"fxId\": \"ID123\"\n },\n \"conversionRate\": 1\n }\n ],\n \"primaryCurrency\": \"SHOPPER\"\n },\n \"currency\": \"USD\",\n \"customer\": {\n \"accountId\": \"62272e917b12209e68751d94\",\n \"company\": \"Demo Inc\",\n \"email\": \"test@example.com\",\n \"employeeId\": \"62272e917b12209e68751d94\",\n \"name\": {\n \"firstName\": \"Alex\",\n \"lastName\": \"Doe\",\n \"middleName\": \"E\"\n },\n \"phone\": {\n \"number\": \"123-456-7890\",\n \"type\": \"MOBILE\"\n },\n \"userId\": \"62272e917b12209e68751d94\"\n },\n \"discounts\": [\n {\n \"amount\": 2.4,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"promotionCode\": \"HNY2022\",\n \"promotionId\": \"HNY2022\",\n \"promotionName\": \"New Year\",\n \"quantity\": 2,\n \"type\": \"promotion\",\n \"unit\": \"AMOUNT_OFF\",\n \"value\": 2\n }\n ],\n \"employeeId\": \"62272e917b12209e68751d94\",\n \"feeTotal\": 12.34,\n \"feeTotalInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"fees\": [\n {\n \"amount\": 34.56,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"attributes\": {},\n \"currency\": \"USD\",\n \"invoicedAmount\": 34.56,\n \"invoicedAmountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"name\": \"STATE\",\n \"rate\": 10,\n \"rateType\": \"PERCENTAGE\",\n \"taxCode\": \"FR01\"\n }\n ],\n \"notes\": [\n {\n \"createdAt\": \"2022-05-12T09:30:31.198Z\",\n \"notes\": \"Fragile - handle with care\",\n \"user\": \"62272e917b12209e68751d94\"\n }\n ],\n \"orderDiscount\": 1.23,\n \"orderDiscountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"orderExternalId\": \"191763090_O1231\",\n \"orderSubtotal\": 123.45,\n \"orderSubtotalInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"orderTotal\": 146.9,\n \"orderTotalInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"orderedAt\": \"2022-05-12T09:30:31.198Z\",\n \"payments\": [\n {\n \"attributes\": {\n \"captureCurrencyCode\": \"USD\",\n \"payerId\": \"M7AWTK3YK3B46\",\n \"referenceId\": \"4DY41894J2904533S\"\n },\n \"authorizationExpirationDate\": \"2022-01-27T16:15:58-05:00\",\n \"authorizedAmount\": 123.2,\n \"authorizedAmountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"chargedAmount\": 60,\n \"chargedAmountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"currency\": \"USD\",\n \"paidAt\": \"2022-01-27T16:15:58-05:00\",\n \"paymentCounter\": 1,\n \"paymentIdentifier\": {\n \"cardIdentifier\": \"3456\",\n \"expirationMonth\": \"12\",\n \"expirationYear\": \"2029\",\n \"fabricPaymentReference\": \"f886c96c-5f65-11ed-9b6a-0242ac120002\",\n \"paymentId\": \"62272e917b12209e68751d94\"\n },\n \"paymentMethod\": \"CREDIT_CARD\",\n \"paymentProvider\": \"stripe\",\n \"paymentStatus\": \"Paid\",\n \"paymentToken\": {\n \"paymentType\": \"VISA\",\n \"token\": \"pi_34tr6787rt\"\n }\n }\n ],\n \"retail\": {\n \"cashierId\": \"C-123\",\n \"locationNumber\": \"WH334\",\n \"registerId\": \"113\",\n \"transactionId\": \"328942333412\"\n },\n \"shipInfo\": [\n {\n \"shipToId\": \"b03b72dc-78d8-4ea4-90fc-2fe6a1fe6569\",\n \"attributes\": {\n \"giftMessage\": \"[]\"\n },\n \"discounts\": [\n {\n \"amount\": 2.99,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"promotionCode\": \"SHIPFREE\",\n \"promotionId\": \"SHIPFREE\",\n \"promotionName\": \"Free Shipping\",\n \"quantity\": 1,\n \"unit\": \"AMOUNT_OFF\",\n \"value\": 10\n }\n ],\n \"estimatedDeliveryDate\": \"2022-05-12T09:30:31.198Z\",\n \"estimatedShipDate\": \"2022-05-12T09:30:31.198Z\",\n \"isInvoiced\": true,\n \"locationNumber\": \"WH334\",\n \"pickups\": [\n {\n \"email\": \"test@example.com\",\n \"name\": {\n \"firstName\": \"Alex\",\n \"lastName\": \"Doe\",\n \"middleName\": \"E\"\n },\n \"phone\": {\n \"number\": \"123-456-7890\",\n \"type\": \"MOBILE\"\n },\n \"pickupType\": \"PRIMARY\"\n }\n ],\n \"shipMethod\": \"Parcel post delivery\",\n \"shipToDiscount\": 12.6,\n \"shipToDiscountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"shipToPrice\": 20,\n \"shipToPriceInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"shipToTaxTotal\": 12.6,\n \"shipToTaxTotalInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"shipToType\": \"SHIP_TO_ADDRESS\",\n \"shipToUnitPrice\": 20,\n \"shipToUnitPriceInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"shipmentInstructions\": \"Handle with care\",\n \"taxCode\": \"FR01\",\n \"taxDetails\": [\n {\n \"amount\": 34.56,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"attributes\": {},\n \"currency\": \"USD\",\n \"name\": \"STATE\",\n \"rate\": 10,\n \"rateType\": \"PERCENTAGE\",\n \"taxCode\": \"FR01\"\n }\n ]\n }\n ],\n \"statusDescription\": \"Order Created\",\n \"subtype\": \"INTERNATIONAL\",\n \"taxTotal\": 12.34,\n \"taxTotalInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"type\": \"WEB\",\n \"requestContext\": {\n \"id\": \"a05b72dc-78d8-4ea4-90fc-2fe6a1fe1111\",\n \"type\": \"<string>\",\n \"requestTime\": \"2022-04-12T09:30:31.198Z\",\n \"attributes\": {\n \"attribute\": \"N\",\n \"someFlag\": true\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"channelId": "12",
"items": [
{
"itemId": 1234,
"lineItemId": "d538b1f1-0e45-43c6-bfc6-9666fc1188ca",
"lineItemNumber": 1,
"shipToId": "b03b72dc-78d8-4ea4-90fc-2fe6a1fe6569",
"sku": "P1234",
"adjustments": [
{
"adjustmentCounter": 1,
"amount": 2.4,
"amountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"attributes": {
"number": "XlQZTmFDFtPFGMxJP6oiAqN3vo+qKZ"
},
"cancelQuantity": 2,
"invoiceQuantity": 10,
"notes": "Any additional info",
"quantity": 2,
"reasonCode": "RFC",
"returnQuantity": 1,
"subReasonCode": "Late shipping"
}
],
"appeasementTotal": 5.5,
"appeasementTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"appeasements": [
{
"amount": 34.56,
"amountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"appeasementCounter": 1,
"attributes": {
"number": "XlQZTmFDFtPFGMxJP6oiAqN3vo+qKZ"
},
"invoicedAmount": 34.56,
"invoicedAmountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"payments": [
{
"paymentCounter": 1,
"refundAmount": 34.56,
"refundAmountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
]
}
],
"reasonCode": "Incorrect Item",
"refunds": [
{
"amount": "-10.",
"amountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"name": "Name",
"type": "ITEM"
}
],
"source": "CSR",
"subReasonCode": "Late shipping"
}
],
"attributes": {
"colorCode": "001",
"isDonation": "false",
"style": "570223020"
},
"backOrderedQuantity": 10,
"cancellations": [
{
"amount": "-20.",
"amountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"attributes": {},
"cancellationCounter": 1,
"invoicedAmount": "-20.",
"invoicedAmountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"payments": [
{
"paymentCounter": 1,
"amount": 60,
"amountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
]
}
],
"quantity": 10,
"reasonCode": "Order line cancel",
"refunds": [
{
"amount": "-10.",
"amountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"name": "Name",
"type": "ITEM"
}
],
"source": "CSR",
"status": "PROCESSING",
"subReasonCode": "Late shipping"
}
],
"cancelledAmount": 12.4,
"cancelledAmountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"cancelledQuantity": 10,
"channelId": "WHBM",
"currency": "USD",
"deliveredQuantity": 10,
"discounts": [
{
"amount": 2.99,
"amountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"invoiceQuantity": 10,
"promotionCode": "HNY2022",
"promotionId": "HNY2022",
"promotionName": "New Year",
"quantity": 1,
"unit": "AMOUNT_OFF",
"value": 10
}
],
"employeeId": "5345HJH",
"exchangeQuantity": 13,
"fees": [
{
"amount": 34.56,
"amountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"attributes": {},
"currency": "USD",
"invoiceQuantity": 10,
"name": "STATE",
"quantity": 12,
"refundAmount": 21.5,
"refundAmountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"taxCode": "FR01"
}
],
"fulfillment": {
"isFulfillable": true,
"isInventoryManaged": true,
"locationNumber": 123,
"shipFromAddress": {
"addressLine1": "123 Main St.",
"city": "Seattle",
"countryCode": "US",
"latitude": 47.6205,
"longitude": -122.3493,
"postalCode": "98121",
"region": "WA",
"type": "Home",
"addressLine2": "Suite 100",
"addressLine3": "Seventh floor",
"addressLine4": "Attention: Pat E. Kake",
"email": "test@example.com",
"name": {
"firstName": "Alex",
"lastName": "Doe",
"middleName": "E"
},
"phone": {
"number": "123-456-7890",
"type": "MOBILE"
}
},
"trackingDetails": {
"trackingNumber": "1ZH4E331YW37690225",
"trackingURL": "https://www.ups.com/track?tracknum=1ZH4E331YW37690225"
},
"attributes": {
"attribute1": "value"
}
},
"hasInfiniteConsent": true,
"invoiceTotal": 800,
"invoiceTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"invoicedQuantity": 10,
"isBackorder": true,
"isDonation": true,
"isExchangeItem": true,
"isGifting": true,
"isPreorder": true,
"isFulfillable": true,
"isInventoryManaged": true,
"itemAdjustmentTotal": 123.45,
"itemAdjustmentTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"itemDiscountsTotal": 80,
"itemDiscountsTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"itemFeeTotal": 200,
"itemFeeTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"itemName": "Item",
"itemShippingTotal": 10,
"itemShippingTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"itemSubtotal": 600,
"itemSubtotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"itemSubtype": "Borderfree",
"itemTaxTotal": 80,
"itemTaxTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"itemTotal": 800,
"itemTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"itemUnitPrice": 10,
"itemUnitPriceInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"lineOrderStatus": "VALID",
"notes": [
{
"createdAt": "2022-05-12T09:30:31.198Z",
"notes": "Fragile - handle with care",
"user": "62272e917b12209e68751d94"
}
],
"orderedQuantity": 60,
"orderedQuantityToShip": 10,
"originalDiscounts": 50,
"originalDiscountsInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"originalFeeTotal": 300,
"originalFeeTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"originalItemAdjustmentTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"originalItemSubtotal": 800,
"originalItemSubtotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"originalItemTotal": 500,
"originalItemTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"originalOutstandingItemTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"originalShippingTotal": 80,
"originalShippingTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"originalTaxTotal": 90,
"originalTaxTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"outstandingItemTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"parentLineItemNumber": 12,
"pendingExchangeQuantity": 12,
"pendingReturnQuantity": 10,
"pendingShippedBackOrderQuantity": 10,
"processingReturnQuantity": 10,
"quantityInStatus": {
"cancelled": 10,
"created": 10,
"delivered": 10,
"hold": 10,
"pendingShipped": 10,
"returned": 10,
"shipped": 10
},
"refundAmount": 21.5,
"refundAmountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"rejectedReturnQuantity": 10,
"reshippedQuantity": 10,
"returnedQuantity": 10,
"returns": [
{
"attributes": {
"transactionId": "0R12TQ46"
},
"exchangeLineItemId": "62f3dfc438bcab1951be0a19",
"fees": [
{
"amount": 34.56,
"amountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"name": "RETURN_FEE",
"reason": "Return fee",
"type": "FEE"
}
],
"invoicedAmount": 11.29,
"isExchangeItemReturned": true,
"reasonCode": "Incorrect item",
"refundAmount": 11.29,
"refunds": [
{
"amount": 34.56,
"amountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"name": "RETURN_FEE",
"reason": "Return fee",
"type": "FEE"
}
],
"returnRequestCounter": 1,
"returnsReceivedAt": "2022-09-14T14:07:36.861Z",
"shipmentId": "62b37697c67b204dd18a7465",
"shipmentInvoice": {
"invoiceId": "62ff5c0bec0aed3c86202c32",
"invoiceNumber": "23940791",
"invoicedAt": "2022-08-01T20:03:28.483971941Z"
},
"shipmentLineItemId": "234",
"shipmentQuantity": 1,
"source": "CSR"
}
],
"shippedQuantity": 10,
"taxCode": "FR01",
"taxDetails": [
{
"amount": 34.56,
"amountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"attributes": {},
"currency": "USD",
"name": "STATE",
"rate": 10,
"rateType": "PERCENTAGE",
"taxCode": "FR01"
}
],
"type": "WEB_SHIP",
"uom": "EA",
"vendorId": "P1234"
}
],
"orderNumber": "309019176",
"shipInfo": [
{
"shipToId": "b03b72dc-78d8-4ea4-90fc-2fe6a1fe6569",
"attributes": {
"giftMessage": "[]"
},
"discounts": [
{
"amount": 2.99,
"amountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"promotionCode": "SHIPFREE",
"promotionId": "SHIPFREE",
"promotionName": "Free Shipping",
"quantity": 1,
"unit": "AMOUNT_OFF",
"value": 10
}
],
"estimatedDeliveryDate": "2022-05-12T09:30:31.198Z",
"estimatedShipDate": "2022-05-12T09:30:31.198Z",
"isInvoiced": true,
"locationNumber": "WH334",
"pickups": [
{
"email": "test@example.com",
"name": {
"firstName": "Alex",
"lastName": "Doe",
"middleName": "E"
},
"phone": {
"number": "123-456-7890",
"type": "MOBILE"
},
"pickupType": "PRIMARY"
}
],
"shipMethod": "Parcel post delivery",
"shipToAddress": {
"addressLine1": "123 Main St.",
"city": "Seattle",
"countryCode": "US",
"latitude": 47.6205,
"longitude": -122.3493,
"postalCode": "98121",
"region": "WA",
"type": "Home",
"addressLine2": "Suite 100",
"addressLine3": "Seventh floor",
"addressLine4": "Attention: Pat E. Kake",
"email": "test@example.com",
"name": {
"firstName": "Alex",
"lastName": "Doe",
"middleName": "E"
},
"phone": {
"number": "123-456-7890",
"type": "MOBILE"
}
},
"shipToDiscount": 12.6,
"shipToDiscountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"shipToPrice": 20,
"shipToPriceInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"shipToTaxTotal": 12.6,
"shipToTaxTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"shipToType": "SHIP_TO_ADDRESS",
"shipToUnitPrice": 20,
"shipToUnitPriceInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"shipmentInstructions": "Handle with care",
"taxCode": "FR01",
"taxDetails": [
{
"amount": 34.56,
"amountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"attributes": {},
"currency": "USD",
"name": "STATE",
"rate": 10,
"rateType": "PERCENTAGE",
"taxCode": "FR01"
}
]
}
],
"statusCode": "ORDER_CREATED",
"version": 2,
"adjustmentTotal": 123.45,
"adjustmentTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"adjustments": [
{
"adjustmentCounter": 1,
"amount": 2.4,
"amountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"attributes": {
"number": "XlQZTmFDFtPFGMxJP6oiAqN3vo+qKZ"
},
"cancelQuantity": 2,
"invoiceQuantity": 10,
"notes": "Any additional info",
"quantity": 2,
"reasonCode": "RFC",
"returnQuantity": 1,
"subReasonCode": "Late shipping"
}
],
"allocatedAt": "2022-05-12T09:30:31.198Z",
"appeasementTotal": 12.34,
"appeasementTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"appeasements": [
{
"amount": 34.56,
"amountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"appeasementCounter": 1,
"attributes": {
"number": "XlQZTmFDFtPFGMxJP6oiAqN3vo+qKZ"
},
"invoicedAmount": 34.56,
"invoicedAmountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"payments": [
{
"paymentCounter": 1,
"refundAmount": 34.56,
"refundAmountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
]
}
],
"reasonCode": "Incorrect Item",
"refunds": [
{
"amount": "-10.",
"amountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"name": "Name",
"type": "ITEM"
}
],
"source": "CSR",
"subReasonCode": "Late shipping"
}
],
"attributes": {
"fraudCheckStatus": "UPDATED",
"loyaltyStatus": "N"
},
"auditLogs": [
{
"amount": 2.4,
"attributes": {
"key": "value"
},
"auditId": "a05b72dc-78d8-4ea4-90fc-2fe6a1fe1111",
"auditType": "CANCEL",
"auditedAt": "2023-03-12T09:24:54.804Z",
"employeeId": "6227",
"isSuccess": true,
"lineItemId": "b03b72dc-78d8-4ea4-90fc-2fe6a1fe6569",
"lineItemNumber": 1,
"note": "Note",
"paymentToken": {
"paymentType": "VISA",
"token": "pi_34tr6787rt"
},
"policyCode": "POS",
"quantity": 1,
"reasonCode": "Scratched item",
"sku": "SKU0023",
"source": "POS",
"subReasonCode": "Scratched item",
"updatedFields": [
{
"fieldName": "UOM",
"fieldOriginalValue": "PK"
}
]
}
],
"cancelTotal": 12.34,
"cancelTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"cancellations": [
{
"amount": "-20.",
"amountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"attributes": {
"number": "XlQZTmFDFtPFGMxJP6oiAqN3vo+qKZ"
},
"cancellationCounter": 1,
"invoicedAmount": "-20.",
"invoicedAmountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"payments": [
{
"paymentCounter": 1,
"amount": 60,
"amountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
]
}
],
"reasonCode": "Order Line Cancel",
"refunds": [
{
"amount": "-10.",
"amountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"name": "Name",
"type": "ITEM"
}
],
"source": "CSR",
"status": "PROCESSING",
"subReasonCode": "Late shipping"
}
],
"cancelledAt": "2022-05-12T09:30:31.198Z",
"cartId": "b03b72dc-78d8-4ea4-90fc-2fe6a1fe6569",
"createdAt": "2022-05-12T09:30:31.198Z",
"currencies": {
"groups": [
{
"currency": "USD",
"group": "SHOPPER",
"attributes": {
"fxId": "ID123"
},
"conversionRate": 1
}
],
"primaryCurrency": "SHOPPER"
},
"currency": "USD",
"customer": {
"accountId": "62272e917b12209e68751d94",
"company": "Demo Inc",
"email": "test@example.com",
"employeeId": "62272e917b12209e68751d94",
"name": {
"firstName": "Alex",
"lastName": "Doe",
"middleName": "E"
},
"phone": {
"number": "123-456-7890",
"type": "MOBILE"
},
"userId": "62272e917b12209e68751d94"
},
"discounts": [
{
"amount": 2.99,
"amountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"invoiceQuantity": 10,
"promotionCode": "HNY2022",
"promotionId": "HNY2022",
"promotionName": "New Year",
"quantity": 1,
"unit": "AMOUNT_OFF",
"value": 10
}
],
"employeeId": "43278",
"erroredFields": [
{
"amended": false,
"errorMessage": "Invalid email address",
"fieldName": "shipInfo.shipToAddress.email"
}
],
"feeTotal": 12.34,
"feeTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"fees": [
{
"amount": 34.56,
"amountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"attributes": {},
"currency": "USD",
"invoicedAmount": 34.56,
"invoicedAmountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"name": "STATE",
"rate": 10,
"rateType": "PERCENTAGE",
"taxCode": "FR01"
}
],
"invoiceTotal": 12.34,
"invoiceTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"notes": [
{
"createdAt": "2022-05-12T09:30:31.198Z",
"notes": "Fragile - handle with care",
"user": "62272e917b12209e68751d94"
}
],
"orderDiscount": 1.23,
"orderDiscountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"orderId": "5349b4ddd2781d08c09890f4",
"orderExternalId": "191763090_O1231",
"orderReleasedAt": "2022-05-12T09:30:31.198Z",
"orderSubtotal": 123.45,
"orderSubtotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"orderTotal": 146.9,
"orderTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"orderedAt": "2022-05-12T09:30:31.198Z",
"originalAdjustmentTotal": 123.45,
"originalAdjustmentTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"originalDiscount": 1.45,
"originalDiscountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"originalFeeTotal": 12.34,
"originalFeeTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"originalOrderTotal": 146.9,
"originalOrderTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"originalSubtotal": 113.45,
"originalSubtotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"originalTaxTotal": 12.34,
"originalTaxTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"payments": [
{
"attributes": {
"captureCurrencyCode": "USD",
"payerId": "M7AWTK3YK3B46",
"referenceId": "4DY41894J2904533S"
},
"authorizationAttempts": 0,
"authorizedAmount": 123.2,
"authorizedAmountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"billToAddress": {
"addressLine1": "123 Main St.",
"city": "Seattle",
"countryCode": "US",
"latitude": 47.6205,
"longitude": -122.3493,
"postalCode": "98121",
"region": "WA",
"type": "Home",
"addressLine2": "Suite 100",
"addressLine3": "Seventh floor",
"addressLine4": "Attention: Pat E. Kake",
"email": "test@example.com",
"name": {
"firstName": "Alex",
"lastName": "Doe",
"middleName": "E"
},
"phone": {
"number": "123-456-7890",
"type": "MOBILE"
}
},
"chargedAmount": 60,
"chargedAmountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"currency": "USD",
"isFinalCapture": false,
"isPartialCapture": false,
"paidAt": "2022-01-27T16:15:58-05:00",
"paymentCounter": 1,
"paymentIdentifier": {
"cardIdentifier": "3456",
"expirationMonth": "12",
"expirationYear": "2029",
"fabricPaymentReference": "f886c96c-5f65-11ed-9b6a-0242ac120002",
"paymentId": "62272e917b12209e68751d94"
},
"paymentLogs": [
{
"amount": -12.4,
"amountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"attributes": {
"key": "value"
},
"data": {
"body": {
"attributes": {
"key": "value"
},
"errors": [
{
"key": "value"
}
],
"responseCode": "OK",
"status": "Authorized",
"transactionId": "328942333412",
"transactionTimestamp": "2022-04-10T23:00:45:12.111Z"
},
"paymentStatusCode": "200"
},
"id": "328942333412",
"paymentId": "328942333412",
"paymentLogId": "328942333412",
"paymentLogRefId": "328942333412",
"status": "Authorized",
"type": "REFUND"
}
],
"paymentMethod": "CREDIT_CARD",
"paymentProvider": "stripe",
"paymentStatus": "Paid",
"paymentToken": {
"paymentType": "VISA",
"token": "pi_34tr6787rt"
},
"reauthorizationAttempts": 0,
"refundAmount": 21.5,
"refundAmountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
]
}
],
"retail": {
"cashierId": "C-123",
"locationNumber": "WH334",
"registerId": "113",
"transactionId": "328942333412"
},
"returnTotal": 12.34,
"returnTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"returns": [
{
"attributes": {
"transactionId": "0R12TQ46"
},
"fees": [
{
"amount": 34.56,
"amountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"name": "RETURN_FEE",
"reason": "Return fee",
"type": "FEE"
}
],
"invoicedAmount": 11.29,
"invoicedAmountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"paymentCounterRefundDetails": [
{
"amount": 34.56,
"amountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"paymentCounter": 1
}
],
"refunds": [
{
"amount": 34.56,
"amountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"name": "RETURN_FEE",
"reason": "Return fee",
"type": "FEE"
}
],
"returnCounter": 1,
"totalRefundAmount": 11.29,
"totalRefundAmountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
]
}
],
"statusDescription": "Order Created",
"subtype": "INTERNATIONAL",
"taxTotal": 12.34,
"taxTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"type": "WEB",
"transactionLogs": [
{
"id": "a05b72dc-78d8-4ea4-90fc-2fe6a1fe1111",
"type": "<string>",
"requestId": "<string>",
"requestTime": "2022-04-12T09:30:31.198Z",
"attributes": {
"attribute": "N",
"someFlag": true
}
}
],
"updatedAt": "2022-05-12T09:30:31.198Z"
}{
"errors": [
{
"message": "Invalid request",
"type": "CLIENT_ERROR"
}
],
"message": "Bad request",
"type": "CLIENT_ERROR"
}{
"message": "Unauthorized request",
"type": "CLIENT_ERROR"
}{
"message": "Internal server error",
"type": "SERVER_ERROR"
}Create new order
This endpoint creates a new order in the fabric Orders (OMS) system, regardless of whether it originates from fabric CnC service or an external system. The response includes an order ID, which is required for subsequent calls such as updating pickup information, getting order details, verifying eligibility for order cancellations, returns, exchanges, as well as creating appeasements, and processing order returns, cancellations, and exchanges.
curl --request POST \
--url https://api.fabric.inc/v3/orders \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-fabric-channel-id: <x-fabric-channel-id>' \
--header 'x-fabric-tenant-id: <x-fabric-tenant-id>' \
--data '
{
"items": [
{
"itemId": 1234,
"lineItemId": "b03b72dc-78d8-4ea4-90fc-2fe6a1fe6569",
"lineItemNumber": 1,
"shipToId": "b03b72dc-78d8-4ea4-90fc-2fe6a1fe6569",
"sku": "P1234",
"adjustments": [
{
"adjustmentCounter": 1,
"amount": 2.4,
"amountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"attributes": {
"number": "XlQZTmFDFtPFGMxJP6oiAqN3vo+qKZ"
},
"cancelQuantity": 2,
"invoiceQuantity": 10,
"notes": "Any additional info",
"quantity": 2,
"reasonCode": "RFC",
"returnQuantity": 1,
"subReasonCode": "Late shipping"
}
],
"attributes": {
"colorCode": "001",
"isDonation": "false",
"style": "570223020"
},
"currency": "USD",
"discounts": [
{
"amount": 2.4,
"amountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"promotionCode": "HNY2022",
"promotionId": "HNY2022",
"promotionName": "New Year",
"quantity": 2,
"type": "promotion",
"unit": "AMOUNT_OFF",
"value": 2
}
],
"employeeId": "62272e917b12209e68751d94",
"fees": [
{
"amount": 34.56,
"amountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"attributes": {},
"currency": "USD",
"name": "STATE",
"rate": 10,
"rateType": "PERCENTAGE",
"taxCode": "FR01"
}
],
"fulfillment": {
"isFulfillable": true,
"isInventoryManaged": true,
"locationNumber": 123,
"trackingDetails": {
"trackingNumber": "1ZH4E331YW37690225",
"trackingURL": "https://www.ups.com/track?tracknum=1ZH4E331YW37690225"
},
"attributes": {
"attribute1": "value"
}
},
"isBackorder": true,
"isDonation": true,
"isPreorder": true,
"itemAdjustmentTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"itemDiscountsTotal": 10,
"itemDiscountsTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"itemFeeTotal": 10,
"itemFeeTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"itemName": "Item",
"itemSubtotal": 600,
"itemSubtotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"itemSubtype": "Borderfree",
"itemTaxTotal": 10,
"itemTaxTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"itemTotal": 10,
"itemTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"itemUnitPrice": 10,
"itemUnitPriceInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"notes": [
{
"createdAt": "2022-05-12T09:30:31.198Z",
"notes": "Fragile - handle with care",
"user": "62272e917b12209e68751d94"
}
],
"orderedQuantity": 60,
"segment": "P1234",
"taxCode": "FR01",
"taxDetails": [
{
"amount": 34.56,
"amountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"attributes": {},
"currency": "USD",
"name": "STATE",
"rate": 10,
"rateType": "PERCENTAGE",
"taxCode": "FR01"
}
],
"type": "WEB_SHIP",
"uom": "EA",
"vendorId": "P1234"
}
],
"orderNumber": "309019176",
"statusCode": "ORDER_CREATED",
"adjustmentTotal": 123.45,
"adjustmentTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"adjustments": [
{
"adjustmentCounter": 1,
"amount": 2.4,
"amountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"attributes": {
"number": "XlQZTmFDFtPFGMxJP6oiAqN3vo+qKZ"
},
"cancelQuantity": 2,
"invoiceQuantity": 10,
"notes": "Any additional info",
"quantity": 2,
"reasonCode": "RFC",
"returnQuantity": 1,
"subReasonCode": "Late shipping"
}
],
"attributes": {
"fraudCheckStatus": "UPDATED",
"fraudStatus": "FRAUD_PASS"
},
"cartId": "b03b72dc-78d8-4ea4-90fc-2fe6a1fe6569",
"currencies": {
"groups": [
{
"currency": "USD",
"group": "SHOPPER",
"attributes": {
"fxId": "ID123"
},
"conversionRate": 1
}
],
"primaryCurrency": "SHOPPER"
},
"currency": "USD",
"customer": {
"accountId": "62272e917b12209e68751d94",
"company": "Demo Inc",
"email": "test@example.com",
"employeeId": "62272e917b12209e68751d94",
"name": {
"firstName": "Alex",
"lastName": "Doe",
"middleName": "E"
},
"phone": {
"number": "123-456-7890",
"type": "MOBILE"
},
"userId": "62272e917b12209e68751d94"
},
"discounts": [
{
"amount": 2.4,
"amountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"promotionCode": "HNY2022",
"promotionId": "HNY2022",
"promotionName": "New Year",
"quantity": 2,
"type": "promotion",
"unit": "AMOUNT_OFF",
"value": 2
}
],
"employeeId": "62272e917b12209e68751d94",
"feeTotal": 12.34,
"feeTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"fees": [
{
"amount": 34.56,
"amountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"attributes": {},
"currency": "USD",
"invoicedAmount": 34.56,
"invoicedAmountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"name": "STATE",
"rate": 10,
"rateType": "PERCENTAGE",
"taxCode": "FR01"
}
],
"notes": [
{
"createdAt": "2022-05-12T09:30:31.198Z",
"notes": "Fragile - handle with care",
"user": "62272e917b12209e68751d94"
}
],
"orderDiscount": 1.23,
"orderDiscountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"orderExternalId": "191763090_O1231",
"orderSubtotal": 123.45,
"orderSubtotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"orderTotal": 146.9,
"orderTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"orderedAt": "2022-05-12T09:30:31.198Z",
"payments": [
{
"attributes": {
"captureCurrencyCode": "USD",
"payerId": "M7AWTK3YK3B46",
"referenceId": "4DY41894J2904533S"
},
"authorizationExpirationDate": "2022-01-27T16:15:58-05:00",
"authorizedAmount": 123.2,
"authorizedAmountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"chargedAmount": 60,
"chargedAmountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"currency": "USD",
"paidAt": "2022-01-27T16:15:58-05:00",
"paymentCounter": 1,
"paymentIdentifier": {
"cardIdentifier": "3456",
"expirationMonth": "12",
"expirationYear": "2029",
"fabricPaymentReference": "f886c96c-5f65-11ed-9b6a-0242ac120002",
"paymentId": "62272e917b12209e68751d94"
},
"paymentMethod": "CREDIT_CARD",
"paymentProvider": "stripe",
"paymentStatus": "Paid",
"paymentToken": {
"paymentType": "VISA",
"token": "pi_34tr6787rt"
}
}
],
"retail": {
"cashierId": "C-123",
"locationNumber": "WH334",
"registerId": "113",
"transactionId": "328942333412"
},
"shipInfo": [
{
"shipToId": "b03b72dc-78d8-4ea4-90fc-2fe6a1fe6569",
"attributes": {
"giftMessage": "[]"
},
"discounts": [
{
"amount": 2.99,
"amountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"promotionCode": "SHIPFREE",
"promotionId": "SHIPFREE",
"promotionName": "Free Shipping",
"quantity": 1,
"unit": "AMOUNT_OFF",
"value": 10
}
],
"estimatedDeliveryDate": "2022-05-12T09:30:31.198Z",
"estimatedShipDate": "2022-05-12T09:30:31.198Z",
"isInvoiced": true,
"locationNumber": "WH334",
"pickups": [
{
"email": "test@example.com",
"name": {
"firstName": "Alex",
"lastName": "Doe",
"middleName": "E"
},
"phone": {
"number": "123-456-7890",
"type": "MOBILE"
},
"pickupType": "PRIMARY"
}
],
"shipMethod": "Parcel post delivery",
"shipToDiscount": 12.6,
"shipToDiscountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"shipToPrice": 20,
"shipToPriceInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"shipToTaxTotal": 12.6,
"shipToTaxTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"shipToType": "SHIP_TO_ADDRESS",
"shipToUnitPrice": 20,
"shipToUnitPriceInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"shipmentInstructions": "Handle with care",
"taxCode": "FR01",
"taxDetails": [
{
"amount": 34.56,
"amountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"attributes": {},
"currency": "USD",
"name": "STATE",
"rate": 10,
"rateType": "PERCENTAGE",
"taxCode": "FR01"
}
]
}
],
"statusDescription": "Order Created",
"subtype": "INTERNATIONAL",
"taxTotal": 12.34,
"taxTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"type": "WEB",
"requestContext": {
"id": "a05b72dc-78d8-4ea4-90fc-2fe6a1fe1111",
"type": "<string>",
"requestTime": "2022-04-12T09:30:31.198Z",
"attributes": {
"attribute": "N",
"someFlag": true
}
}
}
'import requests
url = "https://api.fabric.inc/v3/orders"
payload = {
"items": [
{
"itemId": 1234,
"lineItemId": "b03b72dc-78d8-4ea4-90fc-2fe6a1fe6569",
"lineItemNumber": 1,
"shipToId": "b03b72dc-78d8-4ea4-90fc-2fe6a1fe6569",
"sku": "P1234",
"adjustments": [
{
"adjustmentCounter": 1,
"amount": 2.4,
"amountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"attributes": { "number": "XlQZTmFDFtPFGMxJP6oiAqN3vo+qKZ" },
"cancelQuantity": 2,
"invoiceQuantity": 10,
"notes": "Any additional info",
"quantity": 2,
"reasonCode": "RFC",
"returnQuantity": 1,
"subReasonCode": "Late shipping"
}
],
"attributes": {
"colorCode": "001",
"isDonation": "false",
"style": "570223020"
},
"currency": "USD",
"discounts": [
{
"amount": 2.4,
"amountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"promotionCode": "HNY2022",
"promotionId": "HNY2022",
"promotionName": "New Year",
"quantity": 2,
"type": "promotion",
"unit": "AMOUNT_OFF",
"value": 2
}
],
"employeeId": "62272e917b12209e68751d94",
"fees": [
{
"amount": 34.56,
"amountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"attributes": {},
"currency": "USD",
"name": "STATE",
"rate": 10,
"rateType": "PERCENTAGE",
"taxCode": "FR01"
}
],
"fulfillment": {
"isFulfillable": True,
"isInventoryManaged": True,
"locationNumber": 123,
"trackingDetails": {
"trackingNumber": "1ZH4E331YW37690225",
"trackingURL": "https://www.ups.com/track?tracknum=1ZH4E331YW37690225"
},
"attributes": { "attribute1": "value" }
},
"isBackorder": True,
"isDonation": True,
"isPreorder": True,
"itemAdjustmentTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"itemDiscountsTotal": 10,
"itemDiscountsTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"itemFeeTotal": 10,
"itemFeeTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"itemName": "Item",
"itemSubtotal": 600,
"itemSubtotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"itemSubtype": "Borderfree",
"itemTaxTotal": 10,
"itemTaxTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"itemTotal": 10,
"itemTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"itemUnitPrice": 10,
"itemUnitPriceInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"notes": [
{
"createdAt": "2022-05-12T09:30:31.198Z",
"notes": "Fragile - handle with care",
"user": "62272e917b12209e68751d94"
}
],
"orderedQuantity": 60,
"segment": "P1234",
"taxCode": "FR01",
"taxDetails": [
{
"amount": 34.56,
"amountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"attributes": {},
"currency": "USD",
"name": "STATE",
"rate": 10,
"rateType": "PERCENTAGE",
"taxCode": "FR01"
}
],
"type": "WEB_SHIP",
"uom": "EA",
"vendorId": "P1234"
}
],
"orderNumber": "309019176",
"statusCode": "ORDER_CREATED",
"adjustmentTotal": 123.45,
"adjustmentTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"adjustments": [
{
"adjustmentCounter": 1,
"amount": 2.4,
"amountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"attributes": { "number": "XlQZTmFDFtPFGMxJP6oiAqN3vo+qKZ" },
"cancelQuantity": 2,
"invoiceQuantity": 10,
"notes": "Any additional info",
"quantity": 2,
"reasonCode": "RFC",
"returnQuantity": 1,
"subReasonCode": "Late shipping"
}
],
"attributes": {
"fraudCheckStatus": "UPDATED",
"fraudStatus": "FRAUD_PASS"
},
"cartId": "b03b72dc-78d8-4ea4-90fc-2fe6a1fe6569",
"currencies": {
"groups": [
{
"currency": "USD",
"group": "SHOPPER",
"attributes": { "fxId": "ID123" },
"conversionRate": 1
}
],
"primaryCurrency": "SHOPPER"
},
"currency": "USD",
"customer": {
"accountId": "62272e917b12209e68751d94",
"company": "Demo Inc",
"email": "test@example.com",
"employeeId": "62272e917b12209e68751d94",
"name": {
"firstName": "Alex",
"lastName": "Doe",
"middleName": "E"
},
"phone": {
"number": "123-456-7890",
"type": "MOBILE"
},
"userId": "62272e917b12209e68751d94"
},
"discounts": [
{
"amount": 2.4,
"amountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"promotionCode": "HNY2022",
"promotionId": "HNY2022",
"promotionName": "New Year",
"quantity": 2,
"type": "promotion",
"unit": "AMOUNT_OFF",
"value": 2
}
],
"employeeId": "62272e917b12209e68751d94",
"feeTotal": 12.34,
"feeTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"fees": [
{
"amount": 34.56,
"amountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"attributes": {},
"currency": "USD",
"invoicedAmount": 34.56,
"invoicedAmountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"name": "STATE",
"rate": 10,
"rateType": "PERCENTAGE",
"taxCode": "FR01"
}
],
"notes": [
{
"createdAt": "2022-05-12T09:30:31.198Z",
"notes": "Fragile - handle with care",
"user": "62272e917b12209e68751d94"
}
],
"orderDiscount": 1.23,
"orderDiscountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"orderExternalId": "191763090_O1231",
"orderSubtotal": 123.45,
"orderSubtotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"orderTotal": 146.9,
"orderTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"orderedAt": "2022-05-12T09:30:31.198Z",
"payments": [
{
"attributes": {
"captureCurrencyCode": "USD",
"payerId": "M7AWTK3YK3B46",
"referenceId": "4DY41894J2904533S"
},
"authorizationExpirationDate": "2022-01-27T16:15:58-05:00",
"authorizedAmount": 123.2,
"authorizedAmountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"chargedAmount": 60,
"chargedAmountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"currency": "USD",
"paidAt": "2022-01-27T16:15:58-05:00",
"paymentCounter": 1,
"paymentIdentifier": {
"cardIdentifier": "3456",
"expirationMonth": "12",
"expirationYear": "2029",
"fabricPaymentReference": "f886c96c-5f65-11ed-9b6a-0242ac120002",
"paymentId": "62272e917b12209e68751d94"
},
"paymentMethod": "CREDIT_CARD",
"paymentProvider": "stripe",
"paymentStatus": "Paid",
"paymentToken": {
"paymentType": "VISA",
"token": "pi_34tr6787rt"
}
}
],
"retail": {
"cashierId": "C-123",
"locationNumber": "WH334",
"registerId": "113",
"transactionId": "328942333412"
},
"shipInfo": [
{
"shipToId": "b03b72dc-78d8-4ea4-90fc-2fe6a1fe6569",
"attributes": { "giftMessage": "[]" },
"discounts": [
{
"amount": 2.99,
"amountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"promotionCode": "SHIPFREE",
"promotionId": "SHIPFREE",
"promotionName": "Free Shipping",
"quantity": 1,
"unit": "AMOUNT_OFF",
"value": 10
}
],
"estimatedDeliveryDate": "2022-05-12T09:30:31.198Z",
"estimatedShipDate": "2022-05-12T09:30:31.198Z",
"isInvoiced": True,
"locationNumber": "WH334",
"pickups": [
{
"email": "test@example.com",
"name": {
"firstName": "Alex",
"lastName": "Doe",
"middleName": "E"
},
"phone": {
"number": "123-456-7890",
"type": "MOBILE"
},
"pickupType": "PRIMARY"
}
],
"shipMethod": "Parcel post delivery",
"shipToDiscount": 12.6,
"shipToDiscountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"shipToPrice": 20,
"shipToPriceInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"shipToTaxTotal": 12.6,
"shipToTaxTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"shipToType": "SHIP_TO_ADDRESS",
"shipToUnitPrice": 20,
"shipToUnitPriceInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"shipmentInstructions": "Handle with care",
"taxCode": "FR01",
"taxDetails": [
{
"amount": 34.56,
"amountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"attributes": {},
"currency": "USD",
"name": "STATE",
"rate": 10,
"rateType": "PERCENTAGE",
"taxCode": "FR01"
}
]
}
],
"statusDescription": "Order Created",
"subtype": "INTERNATIONAL",
"taxTotal": 12.34,
"taxTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"type": "WEB",
"requestContext": {
"id": "a05b72dc-78d8-4ea4-90fc-2fe6a1fe1111",
"type": "<string>",
"requestTime": "2022-04-12T09:30:31.198Z",
"attributes": {
"attribute": "N",
"someFlag": True
}
}
}
headers = {
"x-fabric-tenant-id": "<x-fabric-tenant-id>",
"x-fabric-channel-id": "<x-fabric-channel-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-fabric-tenant-id': '<x-fabric-tenant-id>',
'x-fabric-channel-id': '<x-fabric-channel-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
items: [
{
itemId: 1234,
lineItemId: 'b03b72dc-78d8-4ea4-90fc-2fe6a1fe6569',
lineItemNumber: 1,
shipToId: 'b03b72dc-78d8-4ea4-90fc-2fe6a1fe6569',
sku: 'P1234',
adjustments: [
{
adjustmentCounter: 1,
amount: 2.4,
amountInCurrencies: [{currency: 'USD', group: 'SHOPPER', amount: 123.45}],
attributes: {number: 'XlQZTmFDFtPFGMxJP6oiAqN3vo+qKZ'},
cancelQuantity: 2,
invoiceQuantity: 10,
notes: 'Any additional info',
quantity: 2,
reasonCode: 'RFC',
returnQuantity: 1,
subReasonCode: 'Late shipping'
}
],
attributes: {colorCode: '001', isDonation: 'false', style: '570223020'},
currency: 'USD',
discounts: [
{
amount: 2.4,
amountInCurrencies: [{currency: 'USD', group: 'SHOPPER', amount: 123.45}],
promotionCode: 'HNY2022',
promotionId: 'HNY2022',
promotionName: 'New Year',
quantity: 2,
type: 'promotion',
unit: 'AMOUNT_OFF',
value: 2
}
],
employeeId: '62272e917b12209e68751d94',
fees: [
{
amount: 34.56,
amountInCurrencies: [{currency: 'USD', group: 'SHOPPER', amount: 123.45}],
attributes: {},
currency: 'USD',
name: 'STATE',
rate: 10,
rateType: 'PERCENTAGE',
taxCode: 'FR01'
}
],
fulfillment: {
isFulfillable: true,
isInventoryManaged: true,
locationNumber: 123,
trackingDetails: {
trackingNumber: '1ZH4E331YW37690225',
trackingURL: 'https://www.ups.com/track?tracknum=1ZH4E331YW37690225'
},
attributes: {attribute1: 'value'}
},
isBackorder: true,
isDonation: true,
isPreorder: true,
itemAdjustmentTotalInCurrencies: [{currency: 'USD', group: 'SHOPPER', amount: 123.45}],
itemDiscountsTotal: 10,
itemDiscountsTotalInCurrencies: [{currency: 'USD', group: 'SHOPPER', amount: 123.45}],
itemFeeTotal: 10,
itemFeeTotalInCurrencies: [{currency: 'USD', group: 'SHOPPER', amount: 123.45}],
itemName: 'Item',
itemSubtotal: 600,
itemSubtotalInCurrencies: [{currency: 'USD', group: 'SHOPPER', amount: 123.45}],
itemSubtype: 'Borderfree',
itemTaxTotal: 10,
itemTaxTotalInCurrencies: [{currency: 'USD', group: 'SHOPPER', amount: 123.45}],
itemTotal: 10,
itemTotalInCurrencies: [{currency: 'USD', group: 'SHOPPER', amount: 123.45}],
itemUnitPrice: 10,
itemUnitPriceInCurrencies: [{currency: 'USD', group: 'SHOPPER', amount: 123.45}],
notes: [
{
createdAt: '2022-05-12T09:30:31.198Z',
notes: 'Fragile - handle with care',
user: '62272e917b12209e68751d94'
}
],
orderedQuantity: 60,
segment: 'P1234',
taxCode: 'FR01',
taxDetails: [
{
amount: 34.56,
amountInCurrencies: [{currency: 'USD', group: 'SHOPPER', amount: 123.45}],
attributes: {},
currency: 'USD',
name: 'STATE',
rate: 10,
rateType: 'PERCENTAGE',
taxCode: 'FR01'
}
],
type: 'WEB_SHIP',
uom: 'EA',
vendorId: 'P1234'
}
],
orderNumber: '309019176',
statusCode: 'ORDER_CREATED',
adjustmentTotal: 123.45,
adjustmentTotalInCurrencies: [{currency: 'USD', group: 'SHOPPER', amount: 123.45}],
adjustments: [
{
adjustmentCounter: 1,
amount: 2.4,
amountInCurrencies: [{currency: 'USD', group: 'SHOPPER', amount: 123.45}],
attributes: {number: 'XlQZTmFDFtPFGMxJP6oiAqN3vo+qKZ'},
cancelQuantity: 2,
invoiceQuantity: 10,
notes: 'Any additional info',
quantity: 2,
reasonCode: 'RFC',
returnQuantity: 1,
subReasonCode: 'Late shipping'
}
],
attributes: {fraudCheckStatus: 'UPDATED', fraudStatus: 'FRAUD_PASS'},
cartId: 'b03b72dc-78d8-4ea4-90fc-2fe6a1fe6569',
currencies: {
groups: [
{
currency: 'USD',
group: 'SHOPPER',
attributes: {fxId: 'ID123'},
conversionRate: 1
}
],
primaryCurrency: 'SHOPPER'
},
currency: 'USD',
customer: {
accountId: '62272e917b12209e68751d94',
company: 'Demo Inc',
email: 'test@example.com',
employeeId: '62272e917b12209e68751d94',
name: {firstName: 'Alex', lastName: 'Doe', middleName: 'E'},
phone: {number: '123-456-7890', type: 'MOBILE'},
userId: '62272e917b12209e68751d94'
},
discounts: [
{
amount: 2.4,
amountInCurrencies: [{currency: 'USD', group: 'SHOPPER', amount: 123.45}],
promotionCode: 'HNY2022',
promotionId: 'HNY2022',
promotionName: 'New Year',
quantity: 2,
type: 'promotion',
unit: 'AMOUNT_OFF',
value: 2
}
],
employeeId: '62272e917b12209e68751d94',
feeTotal: 12.34,
feeTotalInCurrencies: [{currency: 'USD', group: 'SHOPPER', amount: 123.45}],
fees: [
{
amount: 34.56,
amountInCurrencies: [{currency: 'USD', group: 'SHOPPER', amount: 123.45}],
attributes: {},
currency: 'USD',
invoicedAmount: 34.56,
invoicedAmountInCurrencies: [{currency: 'USD', group: 'SHOPPER', amount: 123.45}],
name: 'STATE',
rate: 10,
rateType: 'PERCENTAGE',
taxCode: 'FR01'
}
],
notes: [
{
createdAt: '2022-05-12T09:30:31.198Z',
notes: 'Fragile - handle with care',
user: '62272e917b12209e68751d94'
}
],
orderDiscount: 1.23,
orderDiscountInCurrencies: [{currency: 'USD', group: 'SHOPPER', amount: 123.45}],
orderExternalId: '191763090_O1231',
orderSubtotal: 123.45,
orderSubtotalInCurrencies: [{currency: 'USD', group: 'SHOPPER', amount: 123.45}],
orderTotal: 146.9,
orderTotalInCurrencies: [{currency: 'USD', group: 'SHOPPER', amount: 123.45}],
orderedAt: '2022-05-12T09:30:31.198Z',
payments: [
{
attributes: {
captureCurrencyCode: 'USD',
payerId: 'M7AWTK3YK3B46',
referenceId: '4DY41894J2904533S'
},
authorizationExpirationDate: '2022-01-27T16:15:58-05:00',
authorizedAmount: 123.2,
authorizedAmountInCurrencies: [{currency: 'USD', group: 'SHOPPER', amount: 123.45}],
chargedAmount: 60,
chargedAmountInCurrencies: [{currency: 'USD', group: 'SHOPPER', amount: 123.45}],
currency: 'USD',
paidAt: '2022-01-27T16:15:58-05:00',
paymentCounter: 1,
paymentIdentifier: {
cardIdentifier: '3456',
expirationMonth: '12',
expirationYear: '2029',
fabricPaymentReference: 'f886c96c-5f65-11ed-9b6a-0242ac120002',
paymentId: '62272e917b12209e68751d94'
},
paymentMethod: 'CREDIT_CARD',
paymentProvider: 'stripe',
paymentStatus: 'Paid',
paymentToken: {paymentType: 'VISA', token: 'pi_34tr6787rt'}
}
],
retail: {
cashierId: 'C-123',
locationNumber: 'WH334',
registerId: '113',
transactionId: '328942333412'
},
shipInfo: [
{
shipToId: 'b03b72dc-78d8-4ea4-90fc-2fe6a1fe6569',
attributes: {giftMessage: '[]'},
discounts: [
{
amount: 2.99,
amountInCurrencies: [{currency: 'USD', group: 'SHOPPER', amount: 123.45}],
promotionCode: 'SHIPFREE',
promotionId: 'SHIPFREE',
promotionName: 'Free Shipping',
quantity: 1,
unit: 'AMOUNT_OFF',
value: 10
}
],
estimatedDeliveryDate: '2022-05-12T09:30:31.198Z',
estimatedShipDate: '2022-05-12T09:30:31.198Z',
isInvoiced: true,
locationNumber: 'WH334',
pickups: [
{
email: 'test@example.com',
name: {firstName: 'Alex', lastName: 'Doe', middleName: 'E'},
phone: {number: '123-456-7890', type: 'MOBILE'},
pickupType: 'PRIMARY'
}
],
shipMethod: 'Parcel post delivery',
shipToDiscount: 12.6,
shipToDiscountInCurrencies: [{currency: 'USD', group: 'SHOPPER', amount: 123.45}],
shipToPrice: 20,
shipToPriceInCurrencies: [{currency: 'USD', group: 'SHOPPER', amount: 123.45}],
shipToTaxTotal: 12.6,
shipToTaxTotalInCurrencies: [{currency: 'USD', group: 'SHOPPER', amount: 123.45}],
shipToType: 'SHIP_TO_ADDRESS',
shipToUnitPrice: 20,
shipToUnitPriceInCurrencies: [{currency: 'USD', group: 'SHOPPER', amount: 123.45}],
shipmentInstructions: 'Handle with care',
taxCode: 'FR01',
taxDetails: [
{
amount: 34.56,
amountInCurrencies: [{currency: 'USD', group: 'SHOPPER', amount: 123.45}],
attributes: {},
currency: 'USD',
name: 'STATE',
rate: 10,
rateType: 'PERCENTAGE',
taxCode: 'FR01'
}
]
}
],
statusDescription: 'Order Created',
subtype: 'INTERNATIONAL',
taxTotal: 12.34,
taxTotalInCurrencies: [{currency: 'USD', group: 'SHOPPER', amount: 123.45}],
type: 'WEB',
requestContext: {
id: 'a05b72dc-78d8-4ea4-90fc-2fe6a1fe1111',
type: '<string>',
requestTime: '2022-04-12T09:30:31.198Z',
attributes: {attribute: 'N', someFlag: true}
}
})
};
fetch('https://api.fabric.inc/v3/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://api.fabric.inc/v3/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([
'items' => [
[
'itemId' => 1234,
'lineItemId' => 'b03b72dc-78d8-4ea4-90fc-2fe6a1fe6569',
'lineItemNumber' => 1,
'shipToId' => 'b03b72dc-78d8-4ea4-90fc-2fe6a1fe6569',
'sku' => 'P1234',
'adjustments' => [
[
'adjustmentCounter' => 1,
'amount' => 2.4,
'amountInCurrencies' => [
[
'currency' => 'USD',
'group' => 'SHOPPER',
'amount' => 123.45
]
],
'attributes' => [
'number' => 'XlQZTmFDFtPFGMxJP6oiAqN3vo+qKZ'
],
'cancelQuantity' => 2,
'invoiceQuantity' => 10,
'notes' => 'Any additional info',
'quantity' => 2,
'reasonCode' => 'RFC',
'returnQuantity' => 1,
'subReasonCode' => 'Late shipping'
]
],
'attributes' => [
'colorCode' => '001',
'isDonation' => 'false',
'style' => '570223020'
],
'currency' => 'USD',
'discounts' => [
[
'amount' => 2.4,
'amountInCurrencies' => [
[
'currency' => 'USD',
'group' => 'SHOPPER',
'amount' => 123.45
]
],
'promotionCode' => 'HNY2022',
'promotionId' => 'HNY2022',
'promotionName' => 'New Year',
'quantity' => 2,
'type' => 'promotion',
'unit' => 'AMOUNT_OFF',
'value' => 2
]
],
'employeeId' => '62272e917b12209e68751d94',
'fees' => [
[
'amount' => 34.56,
'amountInCurrencies' => [
[
'currency' => 'USD',
'group' => 'SHOPPER',
'amount' => 123.45
]
],
'attributes' => [
],
'currency' => 'USD',
'name' => 'STATE',
'rate' => 10,
'rateType' => 'PERCENTAGE',
'taxCode' => 'FR01'
]
],
'fulfillment' => [
'isFulfillable' => true,
'isInventoryManaged' => true,
'locationNumber' => 123,
'trackingDetails' => [
'trackingNumber' => '1ZH4E331YW37690225',
'trackingURL' => 'https://www.ups.com/track?tracknum=1ZH4E331YW37690225'
],
'attributes' => [
'attribute1' => 'value'
]
],
'isBackorder' => true,
'isDonation' => true,
'isPreorder' => true,
'itemAdjustmentTotalInCurrencies' => [
[
'currency' => 'USD',
'group' => 'SHOPPER',
'amount' => 123.45
]
],
'itemDiscountsTotal' => 10,
'itemDiscountsTotalInCurrencies' => [
[
'currency' => 'USD',
'group' => 'SHOPPER',
'amount' => 123.45
]
],
'itemFeeTotal' => 10,
'itemFeeTotalInCurrencies' => [
[
'currency' => 'USD',
'group' => 'SHOPPER',
'amount' => 123.45
]
],
'itemName' => 'Item',
'itemSubtotal' => 600,
'itemSubtotalInCurrencies' => [
[
'currency' => 'USD',
'group' => 'SHOPPER',
'amount' => 123.45
]
],
'itemSubtype' => 'Borderfree',
'itemTaxTotal' => 10,
'itemTaxTotalInCurrencies' => [
[
'currency' => 'USD',
'group' => 'SHOPPER',
'amount' => 123.45
]
],
'itemTotal' => 10,
'itemTotalInCurrencies' => [
[
'currency' => 'USD',
'group' => 'SHOPPER',
'amount' => 123.45
]
],
'itemUnitPrice' => 10,
'itemUnitPriceInCurrencies' => [
[
'currency' => 'USD',
'group' => 'SHOPPER',
'amount' => 123.45
]
],
'notes' => [
[
'createdAt' => '2022-05-12T09:30:31.198Z',
'notes' => 'Fragile - handle with care',
'user' => '62272e917b12209e68751d94'
]
],
'orderedQuantity' => 60,
'segment' => 'P1234',
'taxCode' => 'FR01',
'taxDetails' => [
[
'amount' => 34.56,
'amountInCurrencies' => [
[
'currency' => 'USD',
'group' => 'SHOPPER',
'amount' => 123.45
]
],
'attributes' => [
],
'currency' => 'USD',
'name' => 'STATE',
'rate' => 10,
'rateType' => 'PERCENTAGE',
'taxCode' => 'FR01'
]
],
'type' => 'WEB_SHIP',
'uom' => 'EA',
'vendorId' => 'P1234'
]
],
'orderNumber' => '309019176',
'statusCode' => 'ORDER_CREATED',
'adjustmentTotal' => 123.45,
'adjustmentTotalInCurrencies' => [
[
'currency' => 'USD',
'group' => 'SHOPPER',
'amount' => 123.45
]
],
'adjustments' => [
[
'adjustmentCounter' => 1,
'amount' => 2.4,
'amountInCurrencies' => [
[
'currency' => 'USD',
'group' => 'SHOPPER',
'amount' => 123.45
]
],
'attributes' => [
'number' => 'XlQZTmFDFtPFGMxJP6oiAqN3vo+qKZ'
],
'cancelQuantity' => 2,
'invoiceQuantity' => 10,
'notes' => 'Any additional info',
'quantity' => 2,
'reasonCode' => 'RFC',
'returnQuantity' => 1,
'subReasonCode' => 'Late shipping'
]
],
'attributes' => [
'fraudCheckStatus' => 'UPDATED',
'fraudStatus' => 'FRAUD_PASS'
],
'cartId' => 'b03b72dc-78d8-4ea4-90fc-2fe6a1fe6569',
'currencies' => [
'groups' => [
[
'currency' => 'USD',
'group' => 'SHOPPER',
'attributes' => [
'fxId' => 'ID123'
],
'conversionRate' => 1
]
],
'primaryCurrency' => 'SHOPPER'
],
'currency' => 'USD',
'customer' => [
'accountId' => '62272e917b12209e68751d94',
'company' => 'Demo Inc',
'email' => 'test@example.com',
'employeeId' => '62272e917b12209e68751d94',
'name' => [
'firstName' => 'Alex',
'lastName' => 'Doe',
'middleName' => 'E'
],
'phone' => [
'number' => '123-456-7890',
'type' => 'MOBILE'
],
'userId' => '62272e917b12209e68751d94'
],
'discounts' => [
[
'amount' => 2.4,
'amountInCurrencies' => [
[
'currency' => 'USD',
'group' => 'SHOPPER',
'amount' => 123.45
]
],
'promotionCode' => 'HNY2022',
'promotionId' => 'HNY2022',
'promotionName' => 'New Year',
'quantity' => 2,
'type' => 'promotion',
'unit' => 'AMOUNT_OFF',
'value' => 2
]
],
'employeeId' => '62272e917b12209e68751d94',
'feeTotal' => 12.34,
'feeTotalInCurrencies' => [
[
'currency' => 'USD',
'group' => 'SHOPPER',
'amount' => 123.45
]
],
'fees' => [
[
'amount' => 34.56,
'amountInCurrencies' => [
[
'currency' => 'USD',
'group' => 'SHOPPER',
'amount' => 123.45
]
],
'attributes' => [
],
'currency' => 'USD',
'invoicedAmount' => 34.56,
'invoicedAmountInCurrencies' => [
[
'currency' => 'USD',
'group' => 'SHOPPER',
'amount' => 123.45
]
],
'name' => 'STATE',
'rate' => 10,
'rateType' => 'PERCENTAGE',
'taxCode' => 'FR01'
]
],
'notes' => [
[
'createdAt' => '2022-05-12T09:30:31.198Z',
'notes' => 'Fragile - handle with care',
'user' => '62272e917b12209e68751d94'
]
],
'orderDiscount' => 1.23,
'orderDiscountInCurrencies' => [
[
'currency' => 'USD',
'group' => 'SHOPPER',
'amount' => 123.45
]
],
'orderExternalId' => '191763090_O1231',
'orderSubtotal' => 123.45,
'orderSubtotalInCurrencies' => [
[
'currency' => 'USD',
'group' => 'SHOPPER',
'amount' => 123.45
]
],
'orderTotal' => 146.9,
'orderTotalInCurrencies' => [
[
'currency' => 'USD',
'group' => 'SHOPPER',
'amount' => 123.45
]
],
'orderedAt' => '2022-05-12T09:30:31.198Z',
'payments' => [
[
'attributes' => [
'captureCurrencyCode' => 'USD',
'payerId' => 'M7AWTK3YK3B46',
'referenceId' => '4DY41894J2904533S'
],
'authorizationExpirationDate' => '2022-01-27T16:15:58-05:00',
'authorizedAmount' => 123.2,
'authorizedAmountInCurrencies' => [
[
'currency' => 'USD',
'group' => 'SHOPPER',
'amount' => 123.45
]
],
'chargedAmount' => 60,
'chargedAmountInCurrencies' => [
[
'currency' => 'USD',
'group' => 'SHOPPER',
'amount' => 123.45
]
],
'currency' => 'USD',
'paidAt' => '2022-01-27T16:15:58-05:00',
'paymentCounter' => 1,
'paymentIdentifier' => [
'cardIdentifier' => '3456',
'expirationMonth' => '12',
'expirationYear' => '2029',
'fabricPaymentReference' => 'f886c96c-5f65-11ed-9b6a-0242ac120002',
'paymentId' => '62272e917b12209e68751d94'
],
'paymentMethod' => 'CREDIT_CARD',
'paymentProvider' => 'stripe',
'paymentStatus' => 'Paid',
'paymentToken' => [
'paymentType' => 'VISA',
'token' => 'pi_34tr6787rt'
]
]
],
'retail' => [
'cashierId' => 'C-123',
'locationNumber' => 'WH334',
'registerId' => '113',
'transactionId' => '328942333412'
],
'shipInfo' => [
[
'shipToId' => 'b03b72dc-78d8-4ea4-90fc-2fe6a1fe6569',
'attributes' => [
'giftMessage' => '[]'
],
'discounts' => [
[
'amount' => 2.99,
'amountInCurrencies' => [
[
'currency' => 'USD',
'group' => 'SHOPPER',
'amount' => 123.45
]
],
'promotionCode' => 'SHIPFREE',
'promotionId' => 'SHIPFREE',
'promotionName' => 'Free Shipping',
'quantity' => 1,
'unit' => 'AMOUNT_OFF',
'value' => 10
]
],
'estimatedDeliveryDate' => '2022-05-12T09:30:31.198Z',
'estimatedShipDate' => '2022-05-12T09:30:31.198Z',
'isInvoiced' => true,
'locationNumber' => 'WH334',
'pickups' => [
[
'email' => 'test@example.com',
'name' => [
'firstName' => 'Alex',
'lastName' => 'Doe',
'middleName' => 'E'
],
'phone' => [
'number' => '123-456-7890',
'type' => 'MOBILE'
],
'pickupType' => 'PRIMARY'
]
],
'shipMethod' => 'Parcel post delivery',
'shipToDiscount' => 12.6,
'shipToDiscountInCurrencies' => [
[
'currency' => 'USD',
'group' => 'SHOPPER',
'amount' => 123.45
]
],
'shipToPrice' => 20,
'shipToPriceInCurrencies' => [
[
'currency' => 'USD',
'group' => 'SHOPPER',
'amount' => 123.45
]
],
'shipToTaxTotal' => 12.6,
'shipToTaxTotalInCurrencies' => [
[
'currency' => 'USD',
'group' => 'SHOPPER',
'amount' => 123.45
]
],
'shipToType' => 'SHIP_TO_ADDRESS',
'shipToUnitPrice' => 20,
'shipToUnitPriceInCurrencies' => [
[
'currency' => 'USD',
'group' => 'SHOPPER',
'amount' => 123.45
]
],
'shipmentInstructions' => 'Handle with care',
'taxCode' => 'FR01',
'taxDetails' => [
[
'amount' => 34.56,
'amountInCurrencies' => [
[
'currency' => 'USD',
'group' => 'SHOPPER',
'amount' => 123.45
]
],
'attributes' => [
],
'currency' => 'USD',
'name' => 'STATE',
'rate' => 10,
'rateType' => 'PERCENTAGE',
'taxCode' => 'FR01'
]
]
]
],
'statusDescription' => 'Order Created',
'subtype' => 'INTERNATIONAL',
'taxTotal' => 12.34,
'taxTotalInCurrencies' => [
[
'currency' => 'USD',
'group' => 'SHOPPER',
'amount' => 123.45
]
],
'type' => 'WEB',
'requestContext' => [
'id' => 'a05b72dc-78d8-4ea4-90fc-2fe6a1fe1111',
'type' => '<string>',
'requestTime' => '2022-04-12T09:30:31.198Z',
'attributes' => [
'attribute' => 'N',
'someFlag' => true
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-fabric-channel-id: <x-fabric-channel-id>",
"x-fabric-tenant-id: <x-fabric-tenant-id>"
],
]);
$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://api.fabric.inc/v3/orders"
payload := strings.NewReader("{\n \"items\": [\n {\n \"itemId\": 1234,\n \"lineItemId\": \"b03b72dc-78d8-4ea4-90fc-2fe6a1fe6569\",\n \"lineItemNumber\": 1,\n \"shipToId\": \"b03b72dc-78d8-4ea4-90fc-2fe6a1fe6569\",\n \"sku\": \"P1234\",\n \"adjustments\": [\n {\n \"adjustmentCounter\": 1,\n \"amount\": 2.4,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"attributes\": {\n \"number\": \"XlQZTmFDFtPFGMxJP6oiAqN3vo+qKZ\"\n },\n \"cancelQuantity\": 2,\n \"invoiceQuantity\": 10,\n \"notes\": \"Any additional info\",\n \"quantity\": 2,\n \"reasonCode\": \"RFC\",\n \"returnQuantity\": 1,\n \"subReasonCode\": \"Late shipping\"\n }\n ],\n \"attributes\": {\n \"colorCode\": \"001\",\n \"isDonation\": \"false\",\n \"style\": \"570223020\"\n },\n \"currency\": \"USD\",\n \"discounts\": [\n {\n \"amount\": 2.4,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"promotionCode\": \"HNY2022\",\n \"promotionId\": \"HNY2022\",\n \"promotionName\": \"New Year\",\n \"quantity\": 2,\n \"type\": \"promotion\",\n \"unit\": \"AMOUNT_OFF\",\n \"value\": 2\n }\n ],\n \"employeeId\": \"62272e917b12209e68751d94\",\n \"fees\": [\n {\n \"amount\": 34.56,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"attributes\": {},\n \"currency\": \"USD\",\n \"name\": \"STATE\",\n \"rate\": 10,\n \"rateType\": \"PERCENTAGE\",\n \"taxCode\": \"FR01\"\n }\n ],\n \"fulfillment\": {\n \"isFulfillable\": true,\n \"isInventoryManaged\": true,\n \"locationNumber\": 123,\n \"trackingDetails\": {\n \"trackingNumber\": \"1ZH4E331YW37690225\",\n \"trackingURL\": \"https://www.ups.com/track?tracknum=1ZH4E331YW37690225\"\n },\n \"attributes\": {\n \"attribute1\": \"value\"\n }\n },\n \"isBackorder\": true,\n \"isDonation\": true,\n \"isPreorder\": true,\n \"itemAdjustmentTotalInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"itemDiscountsTotal\": 10,\n \"itemDiscountsTotalInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"itemFeeTotal\": 10,\n \"itemFeeTotalInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"itemName\": \"Item\",\n \"itemSubtotal\": 600,\n \"itemSubtotalInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"itemSubtype\": \"Borderfree\",\n \"itemTaxTotal\": 10,\n \"itemTaxTotalInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"itemTotal\": 10,\n \"itemTotalInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"itemUnitPrice\": 10,\n \"itemUnitPriceInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"notes\": [\n {\n \"createdAt\": \"2022-05-12T09:30:31.198Z\",\n \"notes\": \"Fragile - handle with care\",\n \"user\": \"62272e917b12209e68751d94\"\n }\n ],\n \"orderedQuantity\": 60,\n \"segment\": \"P1234\",\n \"taxCode\": \"FR01\",\n \"taxDetails\": [\n {\n \"amount\": 34.56,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"attributes\": {},\n \"currency\": \"USD\",\n \"name\": \"STATE\",\n \"rate\": 10,\n \"rateType\": \"PERCENTAGE\",\n \"taxCode\": \"FR01\"\n }\n ],\n \"type\": \"WEB_SHIP\",\n \"uom\": \"EA\",\n \"vendorId\": \"P1234\"\n }\n ],\n \"orderNumber\": \"309019176\",\n \"statusCode\": \"ORDER_CREATED\",\n \"adjustmentTotal\": 123.45,\n \"adjustmentTotalInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"adjustments\": [\n {\n \"adjustmentCounter\": 1,\n \"amount\": 2.4,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"attributes\": {\n \"number\": \"XlQZTmFDFtPFGMxJP6oiAqN3vo+qKZ\"\n },\n \"cancelQuantity\": 2,\n \"invoiceQuantity\": 10,\n \"notes\": \"Any additional info\",\n \"quantity\": 2,\n \"reasonCode\": \"RFC\",\n \"returnQuantity\": 1,\n \"subReasonCode\": \"Late shipping\"\n }\n ],\n \"attributes\": {\n \"fraudCheckStatus\": \"UPDATED\",\n \"fraudStatus\": \"FRAUD_PASS\"\n },\n \"cartId\": \"b03b72dc-78d8-4ea4-90fc-2fe6a1fe6569\",\n \"currencies\": {\n \"groups\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"attributes\": {\n \"fxId\": \"ID123\"\n },\n \"conversionRate\": 1\n }\n ],\n \"primaryCurrency\": \"SHOPPER\"\n },\n \"currency\": \"USD\",\n \"customer\": {\n \"accountId\": \"62272e917b12209e68751d94\",\n \"company\": \"Demo Inc\",\n \"email\": \"test@example.com\",\n \"employeeId\": \"62272e917b12209e68751d94\",\n \"name\": {\n \"firstName\": \"Alex\",\n \"lastName\": \"Doe\",\n \"middleName\": \"E\"\n },\n \"phone\": {\n \"number\": \"123-456-7890\",\n \"type\": \"MOBILE\"\n },\n \"userId\": \"62272e917b12209e68751d94\"\n },\n \"discounts\": [\n {\n \"amount\": 2.4,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"promotionCode\": \"HNY2022\",\n \"promotionId\": \"HNY2022\",\n \"promotionName\": \"New Year\",\n \"quantity\": 2,\n \"type\": \"promotion\",\n \"unit\": \"AMOUNT_OFF\",\n \"value\": 2\n }\n ],\n \"employeeId\": \"62272e917b12209e68751d94\",\n \"feeTotal\": 12.34,\n \"feeTotalInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"fees\": [\n {\n \"amount\": 34.56,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"attributes\": {},\n \"currency\": \"USD\",\n \"invoicedAmount\": 34.56,\n \"invoicedAmountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"name\": \"STATE\",\n \"rate\": 10,\n \"rateType\": \"PERCENTAGE\",\n \"taxCode\": \"FR01\"\n }\n ],\n \"notes\": [\n {\n \"createdAt\": \"2022-05-12T09:30:31.198Z\",\n \"notes\": \"Fragile - handle with care\",\n \"user\": \"62272e917b12209e68751d94\"\n }\n ],\n \"orderDiscount\": 1.23,\n \"orderDiscountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"orderExternalId\": \"191763090_O1231\",\n \"orderSubtotal\": 123.45,\n \"orderSubtotalInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"orderTotal\": 146.9,\n \"orderTotalInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"orderedAt\": \"2022-05-12T09:30:31.198Z\",\n \"payments\": [\n {\n \"attributes\": {\n \"captureCurrencyCode\": \"USD\",\n \"payerId\": \"M7AWTK3YK3B46\",\n \"referenceId\": \"4DY41894J2904533S\"\n },\n \"authorizationExpirationDate\": \"2022-01-27T16:15:58-05:00\",\n \"authorizedAmount\": 123.2,\n \"authorizedAmountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"chargedAmount\": 60,\n \"chargedAmountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"currency\": \"USD\",\n \"paidAt\": \"2022-01-27T16:15:58-05:00\",\n \"paymentCounter\": 1,\n \"paymentIdentifier\": {\n \"cardIdentifier\": \"3456\",\n \"expirationMonth\": \"12\",\n \"expirationYear\": \"2029\",\n \"fabricPaymentReference\": \"f886c96c-5f65-11ed-9b6a-0242ac120002\",\n \"paymentId\": \"62272e917b12209e68751d94\"\n },\n \"paymentMethod\": \"CREDIT_CARD\",\n \"paymentProvider\": \"stripe\",\n \"paymentStatus\": \"Paid\",\n \"paymentToken\": {\n \"paymentType\": \"VISA\",\n \"token\": \"pi_34tr6787rt\"\n }\n }\n ],\n \"retail\": {\n \"cashierId\": \"C-123\",\n \"locationNumber\": \"WH334\",\n \"registerId\": \"113\",\n \"transactionId\": \"328942333412\"\n },\n \"shipInfo\": [\n {\n \"shipToId\": \"b03b72dc-78d8-4ea4-90fc-2fe6a1fe6569\",\n \"attributes\": {\n \"giftMessage\": \"[]\"\n },\n \"discounts\": [\n {\n \"amount\": 2.99,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"promotionCode\": \"SHIPFREE\",\n \"promotionId\": \"SHIPFREE\",\n \"promotionName\": \"Free Shipping\",\n \"quantity\": 1,\n \"unit\": \"AMOUNT_OFF\",\n \"value\": 10\n }\n ],\n \"estimatedDeliveryDate\": \"2022-05-12T09:30:31.198Z\",\n \"estimatedShipDate\": \"2022-05-12T09:30:31.198Z\",\n \"isInvoiced\": true,\n \"locationNumber\": \"WH334\",\n \"pickups\": [\n {\n \"email\": \"test@example.com\",\n \"name\": {\n \"firstName\": \"Alex\",\n \"lastName\": \"Doe\",\n \"middleName\": \"E\"\n },\n \"phone\": {\n \"number\": \"123-456-7890\",\n \"type\": \"MOBILE\"\n },\n \"pickupType\": \"PRIMARY\"\n }\n ],\n \"shipMethod\": \"Parcel post delivery\",\n \"shipToDiscount\": 12.6,\n \"shipToDiscountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"shipToPrice\": 20,\n \"shipToPriceInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"shipToTaxTotal\": 12.6,\n \"shipToTaxTotalInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"shipToType\": \"SHIP_TO_ADDRESS\",\n \"shipToUnitPrice\": 20,\n \"shipToUnitPriceInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"shipmentInstructions\": \"Handle with care\",\n \"taxCode\": \"FR01\",\n \"taxDetails\": [\n {\n \"amount\": 34.56,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"attributes\": {},\n \"currency\": \"USD\",\n \"name\": \"STATE\",\n \"rate\": 10,\n \"rateType\": \"PERCENTAGE\",\n \"taxCode\": \"FR01\"\n }\n ]\n }\n ],\n \"statusDescription\": \"Order Created\",\n \"subtype\": \"INTERNATIONAL\",\n \"taxTotal\": 12.34,\n \"taxTotalInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"type\": \"WEB\",\n \"requestContext\": {\n \"id\": \"a05b72dc-78d8-4ea4-90fc-2fe6a1fe1111\",\n \"type\": \"<string>\",\n \"requestTime\": \"2022-04-12T09:30:31.198Z\",\n \"attributes\": {\n \"attribute\": \"N\",\n \"someFlag\": true\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-fabric-tenant-id", "<x-fabric-tenant-id>")
req.Header.Add("x-fabric-channel-id", "<x-fabric-channel-id>")
req.Header.Add("Authorization", "Bearer <token>")
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://api.fabric.inc/v3/orders")
.header("x-fabric-tenant-id", "<x-fabric-tenant-id>")
.header("x-fabric-channel-id", "<x-fabric-channel-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"items\": [\n {\n \"itemId\": 1234,\n \"lineItemId\": \"b03b72dc-78d8-4ea4-90fc-2fe6a1fe6569\",\n \"lineItemNumber\": 1,\n \"shipToId\": \"b03b72dc-78d8-4ea4-90fc-2fe6a1fe6569\",\n \"sku\": \"P1234\",\n \"adjustments\": [\n {\n \"adjustmentCounter\": 1,\n \"amount\": 2.4,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"attributes\": {\n \"number\": \"XlQZTmFDFtPFGMxJP6oiAqN3vo+qKZ\"\n },\n \"cancelQuantity\": 2,\n \"invoiceQuantity\": 10,\n \"notes\": \"Any additional info\",\n \"quantity\": 2,\n \"reasonCode\": \"RFC\",\n \"returnQuantity\": 1,\n \"subReasonCode\": \"Late shipping\"\n }\n ],\n \"attributes\": {\n \"colorCode\": \"001\",\n \"isDonation\": \"false\",\n \"style\": \"570223020\"\n },\n \"currency\": \"USD\",\n \"discounts\": [\n {\n \"amount\": 2.4,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"promotionCode\": \"HNY2022\",\n \"promotionId\": \"HNY2022\",\n \"promotionName\": \"New Year\",\n \"quantity\": 2,\n \"type\": \"promotion\",\n \"unit\": \"AMOUNT_OFF\",\n \"value\": 2\n }\n ],\n \"employeeId\": \"62272e917b12209e68751d94\",\n \"fees\": [\n {\n \"amount\": 34.56,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"attributes\": {},\n \"currency\": \"USD\",\n \"name\": \"STATE\",\n \"rate\": 10,\n \"rateType\": \"PERCENTAGE\",\n \"taxCode\": \"FR01\"\n }\n ],\n \"fulfillment\": {\n \"isFulfillable\": true,\n \"isInventoryManaged\": true,\n \"locationNumber\": 123,\n \"trackingDetails\": {\n \"trackingNumber\": \"1ZH4E331YW37690225\",\n \"trackingURL\": \"https://www.ups.com/track?tracknum=1ZH4E331YW37690225\"\n },\n \"attributes\": {\n \"attribute1\": \"value\"\n }\n },\n \"isBackorder\": true,\n \"isDonation\": true,\n \"isPreorder\": true,\n \"itemAdjustmentTotalInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"itemDiscountsTotal\": 10,\n \"itemDiscountsTotalInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"itemFeeTotal\": 10,\n \"itemFeeTotalInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"itemName\": \"Item\",\n \"itemSubtotal\": 600,\n \"itemSubtotalInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"itemSubtype\": \"Borderfree\",\n \"itemTaxTotal\": 10,\n \"itemTaxTotalInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"itemTotal\": 10,\n \"itemTotalInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"itemUnitPrice\": 10,\n \"itemUnitPriceInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"notes\": [\n {\n \"createdAt\": \"2022-05-12T09:30:31.198Z\",\n \"notes\": \"Fragile - handle with care\",\n \"user\": \"62272e917b12209e68751d94\"\n }\n ],\n \"orderedQuantity\": 60,\n \"segment\": \"P1234\",\n \"taxCode\": \"FR01\",\n \"taxDetails\": [\n {\n \"amount\": 34.56,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"attributes\": {},\n \"currency\": \"USD\",\n \"name\": \"STATE\",\n \"rate\": 10,\n \"rateType\": \"PERCENTAGE\",\n \"taxCode\": \"FR01\"\n }\n ],\n \"type\": \"WEB_SHIP\",\n \"uom\": \"EA\",\n \"vendorId\": \"P1234\"\n }\n ],\n \"orderNumber\": \"309019176\",\n \"statusCode\": \"ORDER_CREATED\",\n \"adjustmentTotal\": 123.45,\n \"adjustmentTotalInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"adjustments\": [\n {\n \"adjustmentCounter\": 1,\n \"amount\": 2.4,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"attributes\": {\n \"number\": \"XlQZTmFDFtPFGMxJP6oiAqN3vo+qKZ\"\n },\n \"cancelQuantity\": 2,\n \"invoiceQuantity\": 10,\n \"notes\": \"Any additional info\",\n \"quantity\": 2,\n \"reasonCode\": \"RFC\",\n \"returnQuantity\": 1,\n \"subReasonCode\": \"Late shipping\"\n }\n ],\n \"attributes\": {\n \"fraudCheckStatus\": \"UPDATED\",\n \"fraudStatus\": \"FRAUD_PASS\"\n },\n \"cartId\": \"b03b72dc-78d8-4ea4-90fc-2fe6a1fe6569\",\n \"currencies\": {\n \"groups\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"attributes\": {\n \"fxId\": \"ID123\"\n },\n \"conversionRate\": 1\n }\n ],\n \"primaryCurrency\": \"SHOPPER\"\n },\n \"currency\": \"USD\",\n \"customer\": {\n \"accountId\": \"62272e917b12209e68751d94\",\n \"company\": \"Demo Inc\",\n \"email\": \"test@example.com\",\n \"employeeId\": \"62272e917b12209e68751d94\",\n \"name\": {\n \"firstName\": \"Alex\",\n \"lastName\": \"Doe\",\n \"middleName\": \"E\"\n },\n \"phone\": {\n \"number\": \"123-456-7890\",\n \"type\": \"MOBILE\"\n },\n \"userId\": \"62272e917b12209e68751d94\"\n },\n \"discounts\": [\n {\n \"amount\": 2.4,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"promotionCode\": \"HNY2022\",\n \"promotionId\": \"HNY2022\",\n \"promotionName\": \"New Year\",\n \"quantity\": 2,\n \"type\": \"promotion\",\n \"unit\": \"AMOUNT_OFF\",\n \"value\": 2\n }\n ],\n \"employeeId\": \"62272e917b12209e68751d94\",\n \"feeTotal\": 12.34,\n \"feeTotalInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"fees\": [\n {\n \"amount\": 34.56,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"attributes\": {},\n \"currency\": \"USD\",\n \"invoicedAmount\": 34.56,\n \"invoicedAmountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"name\": \"STATE\",\n \"rate\": 10,\n \"rateType\": \"PERCENTAGE\",\n \"taxCode\": \"FR01\"\n }\n ],\n \"notes\": [\n {\n \"createdAt\": \"2022-05-12T09:30:31.198Z\",\n \"notes\": \"Fragile - handle with care\",\n \"user\": \"62272e917b12209e68751d94\"\n }\n ],\n \"orderDiscount\": 1.23,\n \"orderDiscountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"orderExternalId\": \"191763090_O1231\",\n \"orderSubtotal\": 123.45,\n \"orderSubtotalInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"orderTotal\": 146.9,\n \"orderTotalInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"orderedAt\": \"2022-05-12T09:30:31.198Z\",\n \"payments\": [\n {\n \"attributes\": {\n \"captureCurrencyCode\": \"USD\",\n \"payerId\": \"M7AWTK3YK3B46\",\n \"referenceId\": \"4DY41894J2904533S\"\n },\n \"authorizationExpirationDate\": \"2022-01-27T16:15:58-05:00\",\n \"authorizedAmount\": 123.2,\n \"authorizedAmountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"chargedAmount\": 60,\n \"chargedAmountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"currency\": \"USD\",\n \"paidAt\": \"2022-01-27T16:15:58-05:00\",\n \"paymentCounter\": 1,\n \"paymentIdentifier\": {\n \"cardIdentifier\": \"3456\",\n \"expirationMonth\": \"12\",\n \"expirationYear\": \"2029\",\n \"fabricPaymentReference\": \"f886c96c-5f65-11ed-9b6a-0242ac120002\",\n \"paymentId\": \"62272e917b12209e68751d94\"\n },\n \"paymentMethod\": \"CREDIT_CARD\",\n \"paymentProvider\": \"stripe\",\n \"paymentStatus\": \"Paid\",\n \"paymentToken\": {\n \"paymentType\": \"VISA\",\n \"token\": \"pi_34tr6787rt\"\n }\n }\n ],\n \"retail\": {\n \"cashierId\": \"C-123\",\n \"locationNumber\": \"WH334\",\n \"registerId\": \"113\",\n \"transactionId\": \"328942333412\"\n },\n \"shipInfo\": [\n {\n \"shipToId\": \"b03b72dc-78d8-4ea4-90fc-2fe6a1fe6569\",\n \"attributes\": {\n \"giftMessage\": \"[]\"\n },\n \"discounts\": [\n {\n \"amount\": 2.99,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"promotionCode\": \"SHIPFREE\",\n \"promotionId\": \"SHIPFREE\",\n \"promotionName\": \"Free Shipping\",\n \"quantity\": 1,\n \"unit\": \"AMOUNT_OFF\",\n \"value\": 10\n }\n ],\n \"estimatedDeliveryDate\": \"2022-05-12T09:30:31.198Z\",\n \"estimatedShipDate\": \"2022-05-12T09:30:31.198Z\",\n \"isInvoiced\": true,\n \"locationNumber\": \"WH334\",\n \"pickups\": [\n {\n \"email\": \"test@example.com\",\n \"name\": {\n \"firstName\": \"Alex\",\n \"lastName\": \"Doe\",\n \"middleName\": \"E\"\n },\n \"phone\": {\n \"number\": \"123-456-7890\",\n \"type\": \"MOBILE\"\n },\n \"pickupType\": \"PRIMARY\"\n }\n ],\n \"shipMethod\": \"Parcel post delivery\",\n \"shipToDiscount\": 12.6,\n \"shipToDiscountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"shipToPrice\": 20,\n \"shipToPriceInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"shipToTaxTotal\": 12.6,\n \"shipToTaxTotalInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"shipToType\": \"SHIP_TO_ADDRESS\",\n \"shipToUnitPrice\": 20,\n \"shipToUnitPriceInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"shipmentInstructions\": \"Handle with care\",\n \"taxCode\": \"FR01\",\n \"taxDetails\": [\n {\n \"amount\": 34.56,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"attributes\": {},\n \"currency\": \"USD\",\n \"name\": \"STATE\",\n \"rate\": 10,\n \"rateType\": \"PERCENTAGE\",\n \"taxCode\": \"FR01\"\n }\n ]\n }\n ],\n \"statusDescription\": \"Order Created\",\n \"subtype\": \"INTERNATIONAL\",\n \"taxTotal\": 12.34,\n \"taxTotalInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"type\": \"WEB\",\n \"requestContext\": {\n \"id\": \"a05b72dc-78d8-4ea4-90fc-2fe6a1fe1111\",\n \"type\": \"<string>\",\n \"requestTime\": \"2022-04-12T09:30:31.198Z\",\n \"attributes\": {\n \"attribute\": \"N\",\n \"someFlag\": true\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fabric.inc/v3/orders")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-fabric-tenant-id"] = '<x-fabric-tenant-id>'
request["x-fabric-channel-id"] = '<x-fabric-channel-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"items\": [\n {\n \"itemId\": 1234,\n \"lineItemId\": \"b03b72dc-78d8-4ea4-90fc-2fe6a1fe6569\",\n \"lineItemNumber\": 1,\n \"shipToId\": \"b03b72dc-78d8-4ea4-90fc-2fe6a1fe6569\",\n \"sku\": \"P1234\",\n \"adjustments\": [\n {\n \"adjustmentCounter\": 1,\n \"amount\": 2.4,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"attributes\": {\n \"number\": \"XlQZTmFDFtPFGMxJP6oiAqN3vo+qKZ\"\n },\n \"cancelQuantity\": 2,\n \"invoiceQuantity\": 10,\n \"notes\": \"Any additional info\",\n \"quantity\": 2,\n \"reasonCode\": \"RFC\",\n \"returnQuantity\": 1,\n \"subReasonCode\": \"Late shipping\"\n }\n ],\n \"attributes\": {\n \"colorCode\": \"001\",\n \"isDonation\": \"false\",\n \"style\": \"570223020\"\n },\n \"currency\": \"USD\",\n \"discounts\": [\n {\n \"amount\": 2.4,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"promotionCode\": \"HNY2022\",\n \"promotionId\": \"HNY2022\",\n \"promotionName\": \"New Year\",\n \"quantity\": 2,\n \"type\": \"promotion\",\n \"unit\": \"AMOUNT_OFF\",\n \"value\": 2\n }\n ],\n \"employeeId\": \"62272e917b12209e68751d94\",\n \"fees\": [\n {\n \"amount\": 34.56,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"attributes\": {},\n \"currency\": \"USD\",\n \"name\": \"STATE\",\n \"rate\": 10,\n \"rateType\": \"PERCENTAGE\",\n \"taxCode\": \"FR01\"\n }\n ],\n \"fulfillment\": {\n \"isFulfillable\": true,\n \"isInventoryManaged\": true,\n \"locationNumber\": 123,\n \"trackingDetails\": {\n \"trackingNumber\": \"1ZH4E331YW37690225\",\n \"trackingURL\": \"https://www.ups.com/track?tracknum=1ZH4E331YW37690225\"\n },\n \"attributes\": {\n \"attribute1\": \"value\"\n }\n },\n \"isBackorder\": true,\n \"isDonation\": true,\n \"isPreorder\": true,\n \"itemAdjustmentTotalInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"itemDiscountsTotal\": 10,\n \"itemDiscountsTotalInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"itemFeeTotal\": 10,\n \"itemFeeTotalInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"itemName\": \"Item\",\n \"itemSubtotal\": 600,\n \"itemSubtotalInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"itemSubtype\": \"Borderfree\",\n \"itemTaxTotal\": 10,\n \"itemTaxTotalInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"itemTotal\": 10,\n \"itemTotalInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"itemUnitPrice\": 10,\n \"itemUnitPriceInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"notes\": [\n {\n \"createdAt\": \"2022-05-12T09:30:31.198Z\",\n \"notes\": \"Fragile - handle with care\",\n \"user\": \"62272e917b12209e68751d94\"\n }\n ],\n \"orderedQuantity\": 60,\n \"segment\": \"P1234\",\n \"taxCode\": \"FR01\",\n \"taxDetails\": [\n {\n \"amount\": 34.56,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"attributes\": {},\n \"currency\": \"USD\",\n \"name\": \"STATE\",\n \"rate\": 10,\n \"rateType\": \"PERCENTAGE\",\n \"taxCode\": \"FR01\"\n }\n ],\n \"type\": \"WEB_SHIP\",\n \"uom\": \"EA\",\n \"vendorId\": \"P1234\"\n }\n ],\n \"orderNumber\": \"309019176\",\n \"statusCode\": \"ORDER_CREATED\",\n \"adjustmentTotal\": 123.45,\n \"adjustmentTotalInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"adjustments\": [\n {\n \"adjustmentCounter\": 1,\n \"amount\": 2.4,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"attributes\": {\n \"number\": \"XlQZTmFDFtPFGMxJP6oiAqN3vo+qKZ\"\n },\n \"cancelQuantity\": 2,\n \"invoiceQuantity\": 10,\n \"notes\": \"Any additional info\",\n \"quantity\": 2,\n \"reasonCode\": \"RFC\",\n \"returnQuantity\": 1,\n \"subReasonCode\": \"Late shipping\"\n }\n ],\n \"attributes\": {\n \"fraudCheckStatus\": \"UPDATED\",\n \"fraudStatus\": \"FRAUD_PASS\"\n },\n \"cartId\": \"b03b72dc-78d8-4ea4-90fc-2fe6a1fe6569\",\n \"currencies\": {\n \"groups\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"attributes\": {\n \"fxId\": \"ID123\"\n },\n \"conversionRate\": 1\n }\n ],\n \"primaryCurrency\": \"SHOPPER\"\n },\n \"currency\": \"USD\",\n \"customer\": {\n \"accountId\": \"62272e917b12209e68751d94\",\n \"company\": \"Demo Inc\",\n \"email\": \"test@example.com\",\n \"employeeId\": \"62272e917b12209e68751d94\",\n \"name\": {\n \"firstName\": \"Alex\",\n \"lastName\": \"Doe\",\n \"middleName\": \"E\"\n },\n \"phone\": {\n \"number\": \"123-456-7890\",\n \"type\": \"MOBILE\"\n },\n \"userId\": \"62272e917b12209e68751d94\"\n },\n \"discounts\": [\n {\n \"amount\": 2.4,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"promotionCode\": \"HNY2022\",\n \"promotionId\": \"HNY2022\",\n \"promotionName\": \"New Year\",\n \"quantity\": 2,\n \"type\": \"promotion\",\n \"unit\": \"AMOUNT_OFF\",\n \"value\": 2\n }\n ],\n \"employeeId\": \"62272e917b12209e68751d94\",\n \"feeTotal\": 12.34,\n \"feeTotalInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"fees\": [\n {\n \"amount\": 34.56,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"attributes\": {},\n \"currency\": \"USD\",\n \"invoicedAmount\": 34.56,\n \"invoicedAmountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"name\": \"STATE\",\n \"rate\": 10,\n \"rateType\": \"PERCENTAGE\",\n \"taxCode\": \"FR01\"\n }\n ],\n \"notes\": [\n {\n \"createdAt\": \"2022-05-12T09:30:31.198Z\",\n \"notes\": \"Fragile - handle with care\",\n \"user\": \"62272e917b12209e68751d94\"\n }\n ],\n \"orderDiscount\": 1.23,\n \"orderDiscountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"orderExternalId\": \"191763090_O1231\",\n \"orderSubtotal\": 123.45,\n \"orderSubtotalInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"orderTotal\": 146.9,\n \"orderTotalInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"orderedAt\": \"2022-05-12T09:30:31.198Z\",\n \"payments\": [\n {\n \"attributes\": {\n \"captureCurrencyCode\": \"USD\",\n \"payerId\": \"M7AWTK3YK3B46\",\n \"referenceId\": \"4DY41894J2904533S\"\n },\n \"authorizationExpirationDate\": \"2022-01-27T16:15:58-05:00\",\n \"authorizedAmount\": 123.2,\n \"authorizedAmountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"chargedAmount\": 60,\n \"chargedAmountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"currency\": \"USD\",\n \"paidAt\": \"2022-01-27T16:15:58-05:00\",\n \"paymentCounter\": 1,\n \"paymentIdentifier\": {\n \"cardIdentifier\": \"3456\",\n \"expirationMonth\": \"12\",\n \"expirationYear\": \"2029\",\n \"fabricPaymentReference\": \"f886c96c-5f65-11ed-9b6a-0242ac120002\",\n \"paymentId\": \"62272e917b12209e68751d94\"\n },\n \"paymentMethod\": \"CREDIT_CARD\",\n \"paymentProvider\": \"stripe\",\n \"paymentStatus\": \"Paid\",\n \"paymentToken\": {\n \"paymentType\": \"VISA\",\n \"token\": \"pi_34tr6787rt\"\n }\n }\n ],\n \"retail\": {\n \"cashierId\": \"C-123\",\n \"locationNumber\": \"WH334\",\n \"registerId\": \"113\",\n \"transactionId\": \"328942333412\"\n },\n \"shipInfo\": [\n {\n \"shipToId\": \"b03b72dc-78d8-4ea4-90fc-2fe6a1fe6569\",\n \"attributes\": {\n \"giftMessage\": \"[]\"\n },\n \"discounts\": [\n {\n \"amount\": 2.99,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"promotionCode\": \"SHIPFREE\",\n \"promotionId\": \"SHIPFREE\",\n \"promotionName\": \"Free Shipping\",\n \"quantity\": 1,\n \"unit\": \"AMOUNT_OFF\",\n \"value\": 10\n }\n ],\n \"estimatedDeliveryDate\": \"2022-05-12T09:30:31.198Z\",\n \"estimatedShipDate\": \"2022-05-12T09:30:31.198Z\",\n \"isInvoiced\": true,\n \"locationNumber\": \"WH334\",\n \"pickups\": [\n {\n \"email\": \"test@example.com\",\n \"name\": {\n \"firstName\": \"Alex\",\n \"lastName\": \"Doe\",\n \"middleName\": \"E\"\n },\n \"phone\": {\n \"number\": \"123-456-7890\",\n \"type\": \"MOBILE\"\n },\n \"pickupType\": \"PRIMARY\"\n }\n ],\n \"shipMethod\": \"Parcel post delivery\",\n \"shipToDiscount\": 12.6,\n \"shipToDiscountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"shipToPrice\": 20,\n \"shipToPriceInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"shipToTaxTotal\": 12.6,\n \"shipToTaxTotalInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"shipToType\": \"SHIP_TO_ADDRESS\",\n \"shipToUnitPrice\": 20,\n \"shipToUnitPriceInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"shipmentInstructions\": \"Handle with care\",\n \"taxCode\": \"FR01\",\n \"taxDetails\": [\n {\n \"amount\": 34.56,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"attributes\": {},\n \"currency\": \"USD\",\n \"name\": \"STATE\",\n \"rate\": 10,\n \"rateType\": \"PERCENTAGE\",\n \"taxCode\": \"FR01\"\n }\n ]\n }\n ],\n \"statusDescription\": \"Order Created\",\n \"subtype\": \"INTERNATIONAL\",\n \"taxTotal\": 12.34,\n \"taxTotalInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"type\": \"WEB\",\n \"requestContext\": {\n \"id\": \"a05b72dc-78d8-4ea4-90fc-2fe6a1fe1111\",\n \"type\": \"<string>\",\n \"requestTime\": \"2022-04-12T09:30:31.198Z\",\n \"attributes\": {\n \"attribute\": \"N\",\n \"someFlag\": true\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"channelId": "12",
"items": [
{
"itemId": 1234,
"lineItemId": "d538b1f1-0e45-43c6-bfc6-9666fc1188ca",
"lineItemNumber": 1,
"shipToId": "b03b72dc-78d8-4ea4-90fc-2fe6a1fe6569",
"sku": "P1234",
"adjustments": [
{
"adjustmentCounter": 1,
"amount": 2.4,
"amountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"attributes": {
"number": "XlQZTmFDFtPFGMxJP6oiAqN3vo+qKZ"
},
"cancelQuantity": 2,
"invoiceQuantity": 10,
"notes": "Any additional info",
"quantity": 2,
"reasonCode": "RFC",
"returnQuantity": 1,
"subReasonCode": "Late shipping"
}
],
"appeasementTotal": 5.5,
"appeasementTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"appeasements": [
{
"amount": 34.56,
"amountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"appeasementCounter": 1,
"attributes": {
"number": "XlQZTmFDFtPFGMxJP6oiAqN3vo+qKZ"
},
"invoicedAmount": 34.56,
"invoicedAmountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"payments": [
{
"paymentCounter": 1,
"refundAmount": 34.56,
"refundAmountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
]
}
],
"reasonCode": "Incorrect Item",
"refunds": [
{
"amount": "-10.",
"amountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"name": "Name",
"type": "ITEM"
}
],
"source": "CSR",
"subReasonCode": "Late shipping"
}
],
"attributes": {
"colorCode": "001",
"isDonation": "false",
"style": "570223020"
},
"backOrderedQuantity": 10,
"cancellations": [
{
"amount": "-20.",
"amountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"attributes": {},
"cancellationCounter": 1,
"invoicedAmount": "-20.",
"invoicedAmountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"payments": [
{
"paymentCounter": 1,
"amount": 60,
"amountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
]
}
],
"quantity": 10,
"reasonCode": "Order line cancel",
"refunds": [
{
"amount": "-10.",
"amountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"name": "Name",
"type": "ITEM"
}
],
"source": "CSR",
"status": "PROCESSING",
"subReasonCode": "Late shipping"
}
],
"cancelledAmount": 12.4,
"cancelledAmountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"cancelledQuantity": 10,
"channelId": "WHBM",
"currency": "USD",
"deliveredQuantity": 10,
"discounts": [
{
"amount": 2.99,
"amountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"invoiceQuantity": 10,
"promotionCode": "HNY2022",
"promotionId": "HNY2022",
"promotionName": "New Year",
"quantity": 1,
"unit": "AMOUNT_OFF",
"value": 10
}
],
"employeeId": "5345HJH",
"exchangeQuantity": 13,
"fees": [
{
"amount": 34.56,
"amountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"attributes": {},
"currency": "USD",
"invoiceQuantity": 10,
"name": "STATE",
"quantity": 12,
"refundAmount": 21.5,
"refundAmountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"taxCode": "FR01"
}
],
"fulfillment": {
"isFulfillable": true,
"isInventoryManaged": true,
"locationNumber": 123,
"shipFromAddress": {
"addressLine1": "123 Main St.",
"city": "Seattle",
"countryCode": "US",
"latitude": 47.6205,
"longitude": -122.3493,
"postalCode": "98121",
"region": "WA",
"type": "Home",
"addressLine2": "Suite 100",
"addressLine3": "Seventh floor",
"addressLine4": "Attention: Pat E. Kake",
"email": "test@example.com",
"name": {
"firstName": "Alex",
"lastName": "Doe",
"middleName": "E"
},
"phone": {
"number": "123-456-7890",
"type": "MOBILE"
}
},
"trackingDetails": {
"trackingNumber": "1ZH4E331YW37690225",
"trackingURL": "https://www.ups.com/track?tracknum=1ZH4E331YW37690225"
},
"attributes": {
"attribute1": "value"
}
},
"hasInfiniteConsent": true,
"invoiceTotal": 800,
"invoiceTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"invoicedQuantity": 10,
"isBackorder": true,
"isDonation": true,
"isExchangeItem": true,
"isGifting": true,
"isPreorder": true,
"isFulfillable": true,
"isInventoryManaged": true,
"itemAdjustmentTotal": 123.45,
"itemAdjustmentTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"itemDiscountsTotal": 80,
"itemDiscountsTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"itemFeeTotal": 200,
"itemFeeTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"itemName": "Item",
"itemShippingTotal": 10,
"itemShippingTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"itemSubtotal": 600,
"itemSubtotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"itemSubtype": "Borderfree",
"itemTaxTotal": 80,
"itemTaxTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"itemTotal": 800,
"itemTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"itemUnitPrice": 10,
"itemUnitPriceInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"lineOrderStatus": "VALID",
"notes": [
{
"createdAt": "2022-05-12T09:30:31.198Z",
"notes": "Fragile - handle with care",
"user": "62272e917b12209e68751d94"
}
],
"orderedQuantity": 60,
"orderedQuantityToShip": 10,
"originalDiscounts": 50,
"originalDiscountsInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"originalFeeTotal": 300,
"originalFeeTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"originalItemAdjustmentTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"originalItemSubtotal": 800,
"originalItemSubtotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"originalItemTotal": 500,
"originalItemTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"originalOutstandingItemTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"originalShippingTotal": 80,
"originalShippingTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"originalTaxTotal": 90,
"originalTaxTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"outstandingItemTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"parentLineItemNumber": 12,
"pendingExchangeQuantity": 12,
"pendingReturnQuantity": 10,
"pendingShippedBackOrderQuantity": 10,
"processingReturnQuantity": 10,
"quantityInStatus": {
"cancelled": 10,
"created": 10,
"delivered": 10,
"hold": 10,
"pendingShipped": 10,
"returned": 10,
"shipped": 10
},
"refundAmount": 21.5,
"refundAmountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"rejectedReturnQuantity": 10,
"reshippedQuantity": 10,
"returnedQuantity": 10,
"returns": [
{
"attributes": {
"transactionId": "0R12TQ46"
},
"exchangeLineItemId": "62f3dfc438bcab1951be0a19",
"fees": [
{
"amount": 34.56,
"amountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"name": "RETURN_FEE",
"reason": "Return fee",
"type": "FEE"
}
],
"invoicedAmount": 11.29,
"isExchangeItemReturned": true,
"reasonCode": "Incorrect item",
"refundAmount": 11.29,
"refunds": [
{
"amount": 34.56,
"amountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"name": "RETURN_FEE",
"reason": "Return fee",
"type": "FEE"
}
],
"returnRequestCounter": 1,
"returnsReceivedAt": "2022-09-14T14:07:36.861Z",
"shipmentId": "62b37697c67b204dd18a7465",
"shipmentInvoice": {
"invoiceId": "62ff5c0bec0aed3c86202c32",
"invoiceNumber": "23940791",
"invoicedAt": "2022-08-01T20:03:28.483971941Z"
},
"shipmentLineItemId": "234",
"shipmentQuantity": 1,
"source": "CSR"
}
],
"shippedQuantity": 10,
"taxCode": "FR01",
"taxDetails": [
{
"amount": 34.56,
"amountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"attributes": {},
"currency": "USD",
"name": "STATE",
"rate": 10,
"rateType": "PERCENTAGE",
"taxCode": "FR01"
}
],
"type": "WEB_SHIP",
"uom": "EA",
"vendorId": "P1234"
}
],
"orderNumber": "309019176",
"shipInfo": [
{
"shipToId": "b03b72dc-78d8-4ea4-90fc-2fe6a1fe6569",
"attributes": {
"giftMessage": "[]"
},
"discounts": [
{
"amount": 2.99,
"amountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"promotionCode": "SHIPFREE",
"promotionId": "SHIPFREE",
"promotionName": "Free Shipping",
"quantity": 1,
"unit": "AMOUNT_OFF",
"value": 10
}
],
"estimatedDeliveryDate": "2022-05-12T09:30:31.198Z",
"estimatedShipDate": "2022-05-12T09:30:31.198Z",
"isInvoiced": true,
"locationNumber": "WH334",
"pickups": [
{
"email": "test@example.com",
"name": {
"firstName": "Alex",
"lastName": "Doe",
"middleName": "E"
},
"phone": {
"number": "123-456-7890",
"type": "MOBILE"
},
"pickupType": "PRIMARY"
}
],
"shipMethod": "Parcel post delivery",
"shipToAddress": {
"addressLine1": "123 Main St.",
"city": "Seattle",
"countryCode": "US",
"latitude": 47.6205,
"longitude": -122.3493,
"postalCode": "98121",
"region": "WA",
"type": "Home",
"addressLine2": "Suite 100",
"addressLine3": "Seventh floor",
"addressLine4": "Attention: Pat E. Kake",
"email": "test@example.com",
"name": {
"firstName": "Alex",
"lastName": "Doe",
"middleName": "E"
},
"phone": {
"number": "123-456-7890",
"type": "MOBILE"
}
},
"shipToDiscount": 12.6,
"shipToDiscountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"shipToPrice": 20,
"shipToPriceInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"shipToTaxTotal": 12.6,
"shipToTaxTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"shipToType": "SHIP_TO_ADDRESS",
"shipToUnitPrice": 20,
"shipToUnitPriceInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"shipmentInstructions": "Handle with care",
"taxCode": "FR01",
"taxDetails": [
{
"amount": 34.56,
"amountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"attributes": {},
"currency": "USD",
"name": "STATE",
"rate": 10,
"rateType": "PERCENTAGE",
"taxCode": "FR01"
}
]
}
],
"statusCode": "ORDER_CREATED",
"version": 2,
"adjustmentTotal": 123.45,
"adjustmentTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"adjustments": [
{
"adjustmentCounter": 1,
"amount": 2.4,
"amountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"attributes": {
"number": "XlQZTmFDFtPFGMxJP6oiAqN3vo+qKZ"
},
"cancelQuantity": 2,
"invoiceQuantity": 10,
"notes": "Any additional info",
"quantity": 2,
"reasonCode": "RFC",
"returnQuantity": 1,
"subReasonCode": "Late shipping"
}
],
"allocatedAt": "2022-05-12T09:30:31.198Z",
"appeasementTotal": 12.34,
"appeasementTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"appeasements": [
{
"amount": 34.56,
"amountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"appeasementCounter": 1,
"attributes": {
"number": "XlQZTmFDFtPFGMxJP6oiAqN3vo+qKZ"
},
"invoicedAmount": 34.56,
"invoicedAmountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"payments": [
{
"paymentCounter": 1,
"refundAmount": 34.56,
"refundAmountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
]
}
],
"reasonCode": "Incorrect Item",
"refunds": [
{
"amount": "-10.",
"amountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"name": "Name",
"type": "ITEM"
}
],
"source": "CSR",
"subReasonCode": "Late shipping"
}
],
"attributes": {
"fraudCheckStatus": "UPDATED",
"loyaltyStatus": "N"
},
"auditLogs": [
{
"amount": 2.4,
"attributes": {
"key": "value"
},
"auditId": "a05b72dc-78d8-4ea4-90fc-2fe6a1fe1111",
"auditType": "CANCEL",
"auditedAt": "2023-03-12T09:24:54.804Z",
"employeeId": "6227",
"isSuccess": true,
"lineItemId": "b03b72dc-78d8-4ea4-90fc-2fe6a1fe6569",
"lineItemNumber": 1,
"note": "Note",
"paymentToken": {
"paymentType": "VISA",
"token": "pi_34tr6787rt"
},
"policyCode": "POS",
"quantity": 1,
"reasonCode": "Scratched item",
"sku": "SKU0023",
"source": "POS",
"subReasonCode": "Scratched item",
"updatedFields": [
{
"fieldName": "UOM",
"fieldOriginalValue": "PK"
}
]
}
],
"cancelTotal": 12.34,
"cancelTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"cancellations": [
{
"amount": "-20.",
"amountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"attributes": {
"number": "XlQZTmFDFtPFGMxJP6oiAqN3vo+qKZ"
},
"cancellationCounter": 1,
"invoicedAmount": "-20.",
"invoicedAmountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"payments": [
{
"paymentCounter": 1,
"amount": 60,
"amountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
]
}
],
"reasonCode": "Order Line Cancel",
"refunds": [
{
"amount": "-10.",
"amountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"name": "Name",
"type": "ITEM"
}
],
"source": "CSR",
"status": "PROCESSING",
"subReasonCode": "Late shipping"
}
],
"cancelledAt": "2022-05-12T09:30:31.198Z",
"cartId": "b03b72dc-78d8-4ea4-90fc-2fe6a1fe6569",
"createdAt": "2022-05-12T09:30:31.198Z",
"currencies": {
"groups": [
{
"currency": "USD",
"group": "SHOPPER",
"attributes": {
"fxId": "ID123"
},
"conversionRate": 1
}
],
"primaryCurrency": "SHOPPER"
},
"currency": "USD",
"customer": {
"accountId": "62272e917b12209e68751d94",
"company": "Demo Inc",
"email": "test@example.com",
"employeeId": "62272e917b12209e68751d94",
"name": {
"firstName": "Alex",
"lastName": "Doe",
"middleName": "E"
},
"phone": {
"number": "123-456-7890",
"type": "MOBILE"
},
"userId": "62272e917b12209e68751d94"
},
"discounts": [
{
"amount": 2.99,
"amountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"invoiceQuantity": 10,
"promotionCode": "HNY2022",
"promotionId": "HNY2022",
"promotionName": "New Year",
"quantity": 1,
"unit": "AMOUNT_OFF",
"value": 10
}
],
"employeeId": "43278",
"erroredFields": [
{
"amended": false,
"errorMessage": "Invalid email address",
"fieldName": "shipInfo.shipToAddress.email"
}
],
"feeTotal": 12.34,
"feeTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"fees": [
{
"amount": 34.56,
"amountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"attributes": {},
"currency": "USD",
"invoicedAmount": 34.56,
"invoicedAmountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"name": "STATE",
"rate": 10,
"rateType": "PERCENTAGE",
"taxCode": "FR01"
}
],
"invoiceTotal": 12.34,
"invoiceTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"notes": [
{
"createdAt": "2022-05-12T09:30:31.198Z",
"notes": "Fragile - handle with care",
"user": "62272e917b12209e68751d94"
}
],
"orderDiscount": 1.23,
"orderDiscountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"orderId": "5349b4ddd2781d08c09890f4",
"orderExternalId": "191763090_O1231",
"orderReleasedAt": "2022-05-12T09:30:31.198Z",
"orderSubtotal": 123.45,
"orderSubtotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"orderTotal": 146.9,
"orderTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"orderedAt": "2022-05-12T09:30:31.198Z",
"originalAdjustmentTotal": 123.45,
"originalAdjustmentTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"originalDiscount": 1.45,
"originalDiscountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"originalFeeTotal": 12.34,
"originalFeeTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"originalOrderTotal": 146.9,
"originalOrderTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"originalSubtotal": 113.45,
"originalSubtotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"originalTaxTotal": 12.34,
"originalTaxTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"payments": [
{
"attributes": {
"captureCurrencyCode": "USD",
"payerId": "M7AWTK3YK3B46",
"referenceId": "4DY41894J2904533S"
},
"authorizationAttempts": 0,
"authorizedAmount": 123.2,
"authorizedAmountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"billToAddress": {
"addressLine1": "123 Main St.",
"city": "Seattle",
"countryCode": "US",
"latitude": 47.6205,
"longitude": -122.3493,
"postalCode": "98121",
"region": "WA",
"type": "Home",
"addressLine2": "Suite 100",
"addressLine3": "Seventh floor",
"addressLine4": "Attention: Pat E. Kake",
"email": "test@example.com",
"name": {
"firstName": "Alex",
"lastName": "Doe",
"middleName": "E"
},
"phone": {
"number": "123-456-7890",
"type": "MOBILE"
}
},
"chargedAmount": 60,
"chargedAmountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"currency": "USD",
"isFinalCapture": false,
"isPartialCapture": false,
"paidAt": "2022-01-27T16:15:58-05:00",
"paymentCounter": 1,
"paymentIdentifier": {
"cardIdentifier": "3456",
"expirationMonth": "12",
"expirationYear": "2029",
"fabricPaymentReference": "f886c96c-5f65-11ed-9b6a-0242ac120002",
"paymentId": "62272e917b12209e68751d94"
},
"paymentLogs": [
{
"amount": -12.4,
"amountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"attributes": {
"key": "value"
},
"data": {
"body": {
"attributes": {
"key": "value"
},
"errors": [
{
"key": "value"
}
],
"responseCode": "OK",
"status": "Authorized",
"transactionId": "328942333412",
"transactionTimestamp": "2022-04-10T23:00:45:12.111Z"
},
"paymentStatusCode": "200"
},
"id": "328942333412",
"paymentId": "328942333412",
"paymentLogId": "328942333412",
"paymentLogRefId": "328942333412",
"status": "Authorized",
"type": "REFUND"
}
],
"paymentMethod": "CREDIT_CARD",
"paymentProvider": "stripe",
"paymentStatus": "Paid",
"paymentToken": {
"paymentType": "VISA",
"token": "pi_34tr6787rt"
},
"reauthorizationAttempts": 0,
"refundAmount": 21.5,
"refundAmountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
]
}
],
"retail": {
"cashierId": "C-123",
"locationNumber": "WH334",
"registerId": "113",
"transactionId": "328942333412"
},
"returnTotal": 12.34,
"returnTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"returns": [
{
"attributes": {
"transactionId": "0R12TQ46"
},
"fees": [
{
"amount": 34.56,
"amountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"name": "RETURN_FEE",
"reason": "Return fee",
"type": "FEE"
}
],
"invoicedAmount": 11.29,
"invoicedAmountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"paymentCounterRefundDetails": [
{
"amount": 34.56,
"amountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"paymentCounter": 1
}
],
"refunds": [
{
"amount": 34.56,
"amountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"name": "RETURN_FEE",
"reason": "Return fee",
"type": "FEE"
}
],
"returnCounter": 1,
"totalRefundAmount": 11.29,
"totalRefundAmountInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
]
}
],
"statusDescription": "Order Created",
"subtype": "INTERNATIONAL",
"taxTotal": 12.34,
"taxTotalInCurrencies": [
{
"currency": "USD",
"group": "SHOPPER",
"amount": 123.45
}
],
"type": "WEB",
"transactionLogs": [
{
"id": "a05b72dc-78d8-4ea4-90fc-2fe6a1fe1111",
"type": "<string>",
"requestId": "<string>",
"requestTime": "2022-04-12T09:30:31.198Z",
"attributes": {
"attribute": "N",
"someFlag": true
}
}
],
"updatedAt": "2022-05-12T09:30:31.198Z"
}{
"errors": [
{
"message": "Invalid request",
"type": "CLIENT_ERROR"
}
],
"message": "Bad request",
"type": "CLIENT_ERROR"
}{
"message": "Unauthorized request",
"type": "CLIENT_ERROR"
}{
"message": "Internal server error",
"type": "SERVER_ERROR"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
A header used by fabric to identify the tenant making the request. You must include tenant id in the authentication header for an API request to access any of fabric’s endpoints. You can retrieve the tenant id , which is also called account id, from Copilot. This header is required.
x-fabric-channel-id identifies the sales channel where the API request is being made; primarily for multichannel use cases. The channel ids are 12 corresponding to US and 13 corresponding to Canada. The default channel id is 12. This field is required.
Unique request ID
Body
The object containing details related to order creation.
Items
1 - 2147483647 elementsShow child attributes
Show child attributes
Merchant-defined order identifier. If omitted, this is generated by fabric's sequence generator using Configuration service.
"309019176"
Status code. Primarily used for Point-of-Sale (POS) orders.
"ORDER_CREATED"
Total price adjustments for all items of the order.
123.45
Show child attributes
Show child attributes
Price adjustments are made to modify product prices during order creation, aiming to incentivize shoppers by offering discounts and promotions based on specified criteria. Price adjustments are also made to apply coupons that the shopper has used.
Show child attributes
Show child attributes
Merchant-defined custom attributes. This is a placeholder for additional info (in key-value pairs).
{
"fraudCheckStatus": "UPDATED",
"fraudStatus": "FRAUD_PASS"
}
Unique identifier of a cart, either from fabric Cart or an external cart service. It is used for linking an order to a specific cart. If available, it is also used for inventory reservation from cart workflow.
"b03b72dc-78d8-4ea4-90fc-2fe6a1fe6569"
The supported currency groups you defined.
Show child attributes
Show child attributes
Three-letter currency code as defined by ISO-4217
"USD"
Invoice customer
Show child attributes
Show child attributes
Discounts
Show child attributes
Show child attributes
Employee (ID or name) who initiated the order creation request
"62272e917b12209e68751d94"
Total item fee = orderedQuantity * Item Fee Total
12.34
Show child attributes
Show child attributes
Fees
Show child attributes
Show child attributes
Additional info, if any. To be used by customer service representative (CSR) only
Show child attributes
Show child attributes
Order discount = summationOfAll(itemDiscountTotal)
1.23
Show child attributes
Show child attributes
A merchant-defined external order identifier.
This field is optional and can be used to reference the order in external
systems such as an ERP, OMS, or CRM.
"191763090_O1231"
Recalculated order subtotal = summationOfAll(itemSubTotal)
123.45
Show child attributes
Show child attributes
Total amount to be charged for the order = orderSubTotal - orderDiscountTotal + orderFeeTotal + orderTaxTotal.
146.9
Show child attributes
Show child attributes
Merchant-defined order creation time in UTC. It is mandatory in the request body of Create Order endpoint - POST /orders.
"2022-05-12T09:30:31.198Z"
Payments
Show child attributes
Show child attributes
Optionally used as reference, for orders created from Point-of-Sale systems
Show child attributes
Show child attributes
Shipping info
1 - 2147483647 elementsShow child attributes
Show child attributes
Description corresponding to statusCode
"Order Created"
Order subtype, for additional classification
IOS, ANDROID, INTERNATIONAL "INTERNATIONAL"
Total tax on order = summationOfAll(itemTaxTotal)+summationOfAll(tax[].value)
12.34
Show child attributes
Show child attributes
Order type. It is critical for order life cycle as it indicates the workflow that varies with the type. For example, Storefront orders have different workflows than Call Center orders. fabric Orders service offers standard configurations for Storefront, Call Center, Point of Sale, iOS, Android, and International.
WEB, CSC, MOBILE_APP, POS "WEB"
Request reference context information
Show child attributes
Show child attributes
Response
Created
An object containing order details.
Sales channel ID
"12"
Item details
1 - 2147483647 elementsShow child attributes
Show child attributes
Merchant-defined order identifier. If omitted, this is generated by fabric's sequence generator using Configuration service
"309019176"
1 - 2147483647 elementsShow child attributes
Show child attributes
Status code. There are no pre-defined values; possible values are - ORDER_ALLOCATED ("Order Allocated"), ORDER_SHIPPED ("Order Shipped"), ORDER_PARTIALLY_SHIPPED ("Order Partially Shipped"), ORDER_PICKED_UP ("Order Picked Up"), ORDER_PARTIALLY_PICKED_UP ("Order Partially Picked Up"), ORDER_DELIVERED ("Order Delivered"), ORDER_PARTIALLY_DELIVERED ("Order Partially Delivered"), ORDER_RETURNED ("Order Returned"), ORDER_HOLD_EXTERNAL ("Order on Hold") etc.
"ORDER_CREATED"
Current version of order document. Indicates the number of times the order is updated by any operation.
2
The total amount of price adjustments for all items of the order.
123.45
Show child attributes
Show child attributes
Price adjustments refer to changes or modifications made to the listed price of a product. A Customer Sales Representative (CSR) makes the price adjustments to provide discounts, promotional offers, or coupons that the shopper used.
Show child attributes
Show child attributes
System-generated order allocation time (UTC) once the order is allocated using Allocation service
"2022-05-12T09:30:31.198Z"
Final appeasement amount
12.34
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Merchant-defined custom attributes. This is a placeholder for additional info (in key-value pairs).
{
"fraudCheckStatus": "UPDATED",
"loyaltyStatus": "N"
}
Show child attributes
Show child attributes
Amount to be returned after order cancellation, calculated as cancelledQuantity / orderedQuantity * itemTotal
12.34
Show child attributes
Show child attributes
Show child attributes
Show child attributes
System-generated order cancellation time in UTC. This is returned in the response of Cancel order by ID - POST /orders/{orderId}/actions/cancel or Cancel order by order number - POST /orders/order-number/{orderNumber}/actions/cancel once the order is successfully cancelled.
"2022-05-12T09:30:31.198Z"
Unique cart identifier, either from fabric Cart service or an external Cart service. It is used for linking an order to a specific cart. If available, it is also used for inventory reservation from cart workflow.
"b03b72dc-78d8-4ea4-90fc-2fe6a1fe6569"
Order creation time (UTC)
"2022-05-12T09:30:31.198Z"
The supported currency groups you defined.
Show child attributes
Show child attributes
Three-letter currency code as defined by ISO-4217
"USD"
Invoice customer
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Employee (ID or name) who initiated the request
"43278"
Show child attributes
Show child attributes
Recalculated total fee, calculated as orderedQuantity* itemFeeTotal
12.34
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Total payment captured by fabric Invoice service. If merchant is using third-party service, then this amount will be null. For partial payment scenarios, this value will be different from orderTotal.
12.34
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Recalculated order discount
1.23
Show child attributes
Show child attributes
24-character system-generated order ID
"5349b4ddd2781d08c09890f4"
A merchant-defined external order identifier.
This field is optional and can be used to reference the order in external
systems such as an ERP, OMS, or CRM.
"191763090_O1231"
Order released time (UTC). When an order is placed, its status is On Hold by default and the duration of hold may vary from merchant to merchant (~1 min). After the hold period, the order is released from hold.
"2022-05-12T09:30:31.198Z"
Recalculated orderSubtotal - summationOfAll(itemSubTotal)
123.45
Show child attributes
Show child attributes
Total amount to be charged for the order = orderSubTotal - orderDiscountTotal + orderFeeTotal + orderTaxTotal
146.9
Show child attributes
Show child attributes
Merchant-defined order creation time in UTC. It is mandatory in the request body of Create Order endpoint - POST /orders.
"2022-05-12T09:30:31.198Z"
Original adjustment total
123.45
Show child attributes
Show child attributes
System-generated total discount, auto-filled by Orders service when the order is placed. This is saved for reference in case the value changes later.
1.45
Show child attributes
Show child attributes
System-generated total fees, auto-filled by Orders service when the order is placed.
12.34
Show child attributes
Show child attributes
System-generated order total, auto-filled by Orders service when the order is placed. This is saved for reference in case the orderTotal changes later.
146.9
Show child attributes
Show child attributes
System-generated order subtotal, auto-filled by Orders service when the order is placed. This is saved for reference in case the value changes later.
113.45
Show child attributes
Show child attributes
System-generated total tax, auto-filled by Orders service when the order is placed.
12.34
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Optionally used as reference, for orders created from Point-of-Sale systems
Show child attributes
Show child attributes
Return total of order, for return scenarios, calculated as summationOfAll(itemReturnTotal)
12.34
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Human-readable brief description based on statusCode
"Order Created"
Order subtype, for further classification
IOS, ANDROID, INTERNATIONAL "INTERNATIONAL"
Recalculated total tax on order summationOfAll(itemTaxTotal)+summationOf(tax[].value)
12.34
Show child attributes
Show child attributes
Order type is critical for the order life cycle as it indicates the workflow. For example, storefront orders have a different workflow than call center orders. fabric Orders service offers standard configurations for storefront, call center, point of sale, iOS, Android, and international.
WEB, CSC, MOBILE_APP, POS "WEB"
Show child attributes
Show child attributes
Time of last update to order (UTC)
"2022-05-12T09:30:31.198Z"
Was this page helpful?
