Create invoice - Fabric
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Create invoice
cURL
curl --request POST \
--url https://api.fabric.inc/v3/invoices \
--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 '
{
"invoiceNumber": 23940791,
"shipmentId": "62ff5c0bec0aed3c86202c32",
"channelId": 10,
"invoiceTotal": 245.7,
"totalTaxAmount": 245.7,
"currency": "USD",
"requestContext": {
"type": "<string>",
"requestTime": "2022-04-12T09:30:31.198Z",
"attributes": {
"attribute": "N",
"someFlag": true
}
},
"invoiceExternalId": 191763090,
"invoiceStatus": "CAPTURED",
"invoiceType": "SHIPPING",
"invoicedAt": "2022-08-01T20:03:28.483Z",
"shipmentNumber": 217088603,
"shippedAt": "2022-08-01T20:03:28.483Z",
"orders": [\
{\
"invoiceOrderTotal": 245.7,\
"orderId": "62ff5c0bec0aed3c86202c32",\
"adjustments": [\
{\
"adjustmentCounter": 1,\
"amount": 34.56,\
"amountInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
],\
"attributes": {},\
"notes": "Any additional info",\
"quantity": 1,\
"reasonCode": "Incorrect Item",\
"subReasonCode": "Late shipping",\
"value": 34.56\
}\
],\
"appeasements": [\
{\
"amount": 34.56,\
"amountInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
],\
"appeasementCounter": 1,\
"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",\
"subReasonCode": "Late shipping"\
}\
],\
"discounts": [\
{\
"promotionId": "HNY2022",\
"amount": 2,\
"amountInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
],\
"promotionCode": "HNY2022",\
"promotionName": "Happy New Year",\
"quantity": 2,\
"type": "promotion"\
}\
],\
"fees": [\
{\
"amount": 34.56,\
"amountInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
],\
"quantity": 1,\
"refundAmount": 345.56,\
"refundAmountInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
],\
"type": "tax"\
}\
],\
"items": [\
{\
"invoiceLineNumber": 3,\
"adjustmentTotal": 123.45,\
"adjustmentTotalInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
],\
"adjustments": [\
{\
"adjustmentCounter": 1,\
"amount": 34.56,\
"amountInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
],\
"attributes": {},\
"notes": "Any additional info",\
"quantity": 1,\
"reasonCode": "Incorrect Item",\
"subReasonCode": "Late shipping",\
"value": 34.56\
}\
],\
"appeasements": [\
{\
"amount": 34.56,\
"amountInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
],\
"appeasementCounter": 1,\
"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",\
"subReasonCode": "Late shipping"\
}\
],\
"attributes": {\
"key": "value"\
},\
"cancellations": [\
{\
"cancellationCounter": 1,\
"source": "CSR",\
"reasonCode": "Order Line Cancel",\
"subReasonCode": "Late shipping",\
"status": "PROCESSING",\
"amount": "-20.",\
"amountInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
],\
"invoicedAmount": "-20.",\
"invoicedAmountInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
],\
"payments": [\
{\
"paymentCounter": 1,\
"amount": "-20.",\
"amountInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
]\
}\
],\
"refunds": [\
{\
"type": "ITEM",\
"name": "Name",\
"amount": "-10.",\
"amountInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
]\
}\
],\
"attributes": {\
"number": "XlQZTmFDFtPFGMxJP6oiAqN3vo+qKZ"\
},\
"quantity": 10\
}\
],\
"currency": "USD",\
"discounts": [\
{\
"promotionId": "HNY2022",\
"amount": 2,\
"amountInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
],\
"promotionCode": "HNY2022",\
"promotionName": "Happy New Year",\
"quantity": 2,\
"type": "promotion"\
}\
],\
"fees": [\
{\
"amount": 34.56,\
"amountInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
],\
"quantity": 1,\
"refundAmount": 345.56,\
"refundAmountInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
],\
"type": "tax"\
}\
],\
"invoiceLineTotal": 600,\
"invoiceLineTotalInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
],\
"invoiceQuantity": 10,\
"itemAppeasementTotal": 344.455,\
"itemAppeasementTotalInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
],\
"itemCancelTotal": 344.455,\
"itemCancelTotalInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
],\
"itemDiscountsTotal": 3.45,\
"itemDiscountsTotalInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
],\
"itemFeeTotal": 33.4,\
"itemFeeTotalInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
],\
"itemId": 1234455322,\
"itemTaxTotal": 2.4,\
"itemTaxTotalInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
],\
"itemUnitPrice": 33.4,\
"itemUnitPriceInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
],\
"lineItemCreatedAt": "2022-11-22T10:26:38.000+00:00",\
"lineItemId": "1adfrghhh2346aaaf",\
"lineItemNumber": 1,\
"locationStoreId": 4512345,\
"orderId": "33adfrghhh2346aaaffff",\
"returnExpirationDays": 21,\
"returns": [\
{\
"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,\
"invoicedAmountInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
],\
"isExchangeItemReturned": true,\
"reasonCode": "Incorrect item",\
"refundAmount": 11.29,\
"refundAmountInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
],\
"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",\
"shipmentLineItemId": "234",\
"shipmentQuantity": 1\
}\
],\
"shipToId": "5349b4ddd2781d08c09890f4",\
"shipmentLineItemId": "2adfrghhh2346aaaffff",\
"sku": "P1234",\
"taxDetails": [\
{\
"amount": 34.56,\
"amountInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
],\
"type": "tax"\
}\
],\
"type": "WEB_PICKUP",\
"uom": "EA"\
}\
],\
"orderNumber": "217088603",\
"orderExternalId": 217088603,\
"orderSubtype": "INTERNATIONAL",\
"orderType": "WEB",\
"orderedAt": "2022-05-12T09:30:31.198Z",\
"payments": [\
{\
"attributes": {},\
"authorizedAmount": 256.1,\
"authorizedAmountInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
],\
"conversion": 1,\
"currency": "USD",\
"paidAt": "2022-01-27T16:15:58.000-05:00",\
"paymentCounter": 1,\
"paymentIdentifier": {\
"cardIdentifier": "***********3456"\
},\
"paymentMethod": "CREDIT_CARD",\
"paymentProvider": "stripe",\
"paymentStatus": "PAID",\
"paymentToken": {\
"token": "pi_34tr6787rt"\
},\
"paymentType": "VISA",\
"settlement": {\
"settledAt": "2022-01-27T21:15:58Z",\
"settlementAmount": 10.3,\
"settlementAmountInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
],\
"settlementStatusCode": "SETTLED"\
}\
}\
],\
"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\
}\
]\
}\
],\
"taxDetails": [\
{\
"amount": 34.56,\
"amountInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
],\
"type": "tax"\
}\
]\
}\
],
"locationNumber": 3235,
"location": {
"locationNumber": "WH334"
},
"retail": {
"cashierId": "CE-321",
"locationNumber": "WH334"
},
"invoiceTotalInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
],
"totalTaxAmountInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
],
"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"
},
"attributes": {
"attribute1": "value"
}
}
'
import requests
url = "https://api.fabric.inc/v3/invoices"
payload = {
"invoiceNumber": 23940791,
"shipmentId": "62ff5c0bec0aed3c86202c32",
"channelId": 10,
"invoiceTotal": 245.7,
"totalTaxAmount": 245.7,
"currency": "USD",
"requestContext": {
"type": "<string>",
"requestTime": "2022-04-12T09:30:31.198Z",
"attributes": {
"attribute": "N",
"someFlag": True
}
},
"invoiceExternalId": 191763090,
"invoiceStatus": "CAPTURED",
"invoiceType": "SHIPPING",
"invoicedAt": "2022-08-01T20:03:28.483Z",
"shipmentNumber": 217088603,
"shippedAt": "2022-08-01T20:03:28.483Z",
"orders": [\
{\
"invoiceOrderTotal": 245.7,\
"orderId": "62ff5c0bec0aed3c86202c32",\
"adjustments": [\
{\
"adjustmentCounter": 1,\
"amount": 34.56,\
"amountInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
],\
"attributes": {},\
"notes": "Any additional info",\
"quantity": 1,\
"reasonCode": "Incorrect Item",\
"subReasonCode": "Late shipping",\
"value": 34.56\
}\
],\
"appeasements": [\
{\
"amount": 34.56,\
"amountInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
],\
"appeasementCounter": 1,\
"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",\
"subReasonCode": "Late shipping"\
}\
],\
"discounts": [\
{\
"promotionId": "HNY2022",\
"amount": 2,\
"amountInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
],\
"promotionCode": "HNY2022",\
"promotionName": "Happy New Year",\
"quantity": 2,\
"type": "promotion"\
}\
],\
"fees": [\
{\
"amount": 34.56,\
"amountInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
],\
"quantity": 1,\
"refundAmount": 345.56,\
"refundAmountInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
],\
"type": "tax"\
}\
],\
"items": [\
{\
"invoiceLineNumber": 3,\
"adjustmentTotal": 123.45,\
"adjustmentTotalInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
],\
"adjustments": [\
{\
"adjustmentCounter": 1,\
"amount": 34.56,\
"amountInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
],\
"attributes": {},\
"notes": "Any additional info",\
"quantity": 1,\
"reasonCode": "Incorrect Item",\
"subReasonCode": "Late shipping",\
"value": 34.56\
}\
],\
"appeasements": [\
{\
"amount": 34.56,\
"amountInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
],\
"appeasementCounter": 1,\
"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",\
"subReasonCode": "Late shipping"\
}\
],\
"attributes": { "key": "value" },\
"cancellations": [\
{\
"cancellationCounter": 1,\
"source": "CSR",\
"reasonCode": "Order Line Cancel",\
"subReasonCode": "Late shipping",\
"status": "PROCESSING",\
"amount": "-20.",\
"amountInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
],\
"invoicedAmount": "-20.",\
"invoicedAmountInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
],\
"payments": [\
{\
"paymentCounter": 1,\
"amount": "-20.",\
"amountInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
]\
}\
],\
"refunds": [\
{\
"type": "ITEM",\
"name": "Name",\
"amount": "-10.",\
"amountInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
]\
}\
],\
"attributes": { "number": "XlQZTmFDFtPFGMxJP6oiAqN3vo+qKZ" },\
"quantity": 10\
}\
],\
"currency": "USD",\
"discounts": [\
{\
"promotionId": "HNY2022",\
"amount": 2,\
"amountInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
],\
"promotionCode": "HNY2022",\
"promotionName": "Happy New Year",\
"quantity": 2,\
"type": "promotion"\
}\
],\
"fees": [\
{\
"amount": 34.56,\
"amountInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
],\
"quantity": 1,\
"refundAmount": 345.56,\
"refundAmountInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
],\
"type": "tax"\
}\
],\
"invoiceLineTotal": 600,\
"invoiceLineTotalInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
],\
"invoiceQuantity": 10,\
"itemAppeasementTotal": 344.455,\
"itemAppeasementTotalInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
],\
"itemCancelTotal": 344.455,\
"itemCancelTotalInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
],\
"itemDiscountsTotal": 3.45,\
"itemDiscountsTotalInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
],\
"itemFeeTotal": 33.4,\
"itemFeeTotalInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
],\
"itemId": 1234455322,\
"itemTaxTotal": 2.4,\
"itemTaxTotalInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
],\
"itemUnitPrice": 33.4,\
"itemUnitPriceInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
],\
"lineItemCreatedAt": "2022-11-22T10:26:38.000+00:00",\
"lineItemId": "1adfrghhh2346aaaf",\
"lineItemNumber": 1,\
"locationStoreId": 4512345,\
"orderId": "33adfrghhh2346aaaffff",\
"returnExpirationDays": 21,\
"returns": [\
{\
"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,\
"invoicedAmountInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
],\
"isExchangeItemReturned": True,\
"reasonCode": "Incorrect item",\
"refundAmount": 11.29,\
"refundAmountInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
],\
"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",\
"shipmentLineItemId": "234",\
"shipmentQuantity": 1\
}\
],\
"shipToId": "5349b4ddd2781d08c09890f4",\
"shipmentLineItemId": "2adfrghhh2346aaaffff",\
"sku": "P1234",\
"taxDetails": [\
{\
"amount": 34.56,\
"amountInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
],\
"type": "tax"\
}\
],\
"type": "WEB_PICKUP",\
"uom": "EA"\
}\
],\
"orderNumber": "217088603",\
"orderExternalId": 217088603,\
"orderSubtype": "INTERNATIONAL",\
"orderType": "WEB",\
"orderedAt": "2022-05-12T09:30:31.198Z",\
"payments": [\
{\
"attributes": {},\
"authorizedAmount": 256.1,\
"authorizedAmountInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
],\
"conversion": 1,\
"currency": "USD",\
"paidAt": "2022-01-27T16:15:58.000-05:00",\
"paymentCounter": 1,\
"paymentIdentifier": { "cardIdentifier": "***********3456" },\
"paymentMethod": "CREDIT_CARD",\
"paymentProvider": "stripe",\
"paymentStatus": "PAID",\
"paymentToken": { "token": "pi_34tr6787rt" },\
"paymentType": "VISA",\
"settlement": {\
"settledAt": "2022-01-27T21:15:58Z",\
"settlementAmount": 10.3,\
"settlementAmountInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
],\
"settlementStatusCode": "SETTLED"\
}\
}\
],\
"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\
}\
]\
}\
],\
"taxDetails": [\
{\
"amount": 34.56,\
"amountInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
],\
"type": "tax"\
}\
]\
}\
],
"locationNumber": 3235,
"location": { "locationNumber": "WH334" },
"retail": {
"cashierId": "CE-321",
"locationNumber": "WH334"
},
"invoiceTotalInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
],
"totalTaxAmountInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
],
"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"
},
"attributes": { "attribute1": "value" }
}
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({
invoiceNumber: 23940791,
shipmentId: '62ff5c0bec0aed3c86202c32',
channelId: 10,
invoiceTotal: 245.7,
totalTaxAmount: 245.7,
currency: 'USD',
requestContext: {
type: '<string>',
requestTime: '2022-04-12T09:30:31.198Z',
attributes: {attribute: 'N', someFlag: true}
},
invoiceExternalId: 191763090,
invoiceStatus: 'CAPTURED',
invoiceType: 'SHIPPING',
invoicedAt: '2022-08-01T20:03:28.483Z',
shipmentNumber: 217088603,
shippedAt: '2022-08-01T20:03:28.483Z',
orders: [\
{\
invoiceOrderTotal: 245.7,\
orderId: '62ff5c0bec0aed3c86202c32',\
adjustments: [\
{\
adjustmentCounter: 1,\
amount: 34.56,\
amountInCurrencies: [{currency: 'USD', group: 'SHOPPER', amount: 123.45}],\
attributes: {},\
notes: 'Any additional info',\
quantity: 1,\
reasonCode: 'Incorrect Item',\
subReasonCode: 'Late shipping',\
value: 34.56\
}\
],\
appeasements: [\
{\
amount: 34.56,\
amountInCurrencies: [{currency: 'USD', group: 'SHOPPER', amount: 123.45}],\
appeasementCounter: 1,\
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',\
subReasonCode: 'Late shipping'\
}\
],\
discounts: [\
{\
promotionId: 'HNY2022',\
amount: 2,\
amountInCurrencies: [{currency: 'USD', group: 'SHOPPER', amount: 123.45}],\
promotionCode: 'HNY2022',\
promotionName: 'Happy New Year',\
quantity: 2,\
type: 'promotion'\
}\
],\
fees: [\
{\
amount: 34.56,\
amountInCurrencies: [{currency: 'USD', group: 'SHOPPER', amount: 123.45}],\
quantity: 1,\
refundAmount: 345.56,\
refundAmountInCurrencies: [{currency: 'USD', group: 'SHOPPER', amount: 123.45}],\
type: 'tax'\
}\
],\
items: [\
{\
invoiceLineNumber: 3,\
adjustmentTotal: 123.45,\
adjustmentTotalInCurrencies: [{currency: 'USD', group: 'SHOPPER', amount: 123.45}],\
adjustments: [\
{\
adjustmentCounter: 1,\
amount: 34.56,\
amountInCurrencies: [{currency: 'USD', group: 'SHOPPER', amount: 123.45}],\
attributes: {},\
notes: 'Any additional info',\
quantity: 1,\
reasonCode: 'Incorrect Item',\
subReasonCode: 'Late shipping',\
value: 34.56\
}\
],\
appeasements: [\
{\
amount: 34.56,\
amountInCurrencies: [{currency: 'USD', group: 'SHOPPER', amount: 123.45}],\
appeasementCounter: 1,\
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',\
subReasonCode: 'Late shipping'\
}\
],\
attributes: {key: 'value'},\
cancellations: [\
{\
cancellationCounter: 1,\
source: 'CSR',\
reasonCode: 'Order Line Cancel',\
subReasonCode: 'Late shipping',\
status: 'PROCESSING',\
amount: '-20.',\
amountInCurrencies: [{currency: 'USD', group: 'SHOPPER', amount: 123.45}],\
invoicedAmount: '-20.',\
invoicedAmountInCurrencies: [{currency: 'USD', group: 'SHOPPER', amount: 123.45}],\
payments: [\
{\
paymentCounter: 1,\
amount: '-20.',\
amountInCurrencies: [{currency: 'USD', group: 'SHOPPER', amount: 123.45}]\
}\
],\
refunds: [\
{\
type: 'ITEM',\
name: 'Name',\
amount: '-10.',\
amountInCurrencies: [{currency: 'USD', group: 'SHOPPER', amount: 123.45}]\
}\
],\
attributes: {number: 'XlQZTmFDFtPFGMxJP6oiAqN3vo+qKZ'},\
quantity: 10\
}\
],\
currency: 'USD',\
discounts: [\
{\
promotionId: 'HNY2022',\
amount: 2,\
amountInCurrencies: [{currency: 'USD', group: 'SHOPPER', amount: 123.45}],\
promotionCode: 'HNY2022',\
promotionName: 'Happy New Year',\
quantity: 2,\
type: 'promotion'\
}\
],\
fees: [\
{\
amount: 34.56,\
amountInCurrencies: [{currency: 'USD', group: 'SHOPPER', amount: 123.45}],\
quantity: 1,\
refundAmount: 345.56,\
refundAmountInCurrencies: [{currency: 'USD', group: 'SHOPPER', amount: 123.45}],\
type: 'tax'\
}\
],\
invoiceLineTotal: 600,\
invoiceLineTotalInCurrencies: [{currency: 'USD', group: 'SHOPPER', amount: 123.45}],\
invoiceQuantity: 10,\
itemAppeasementTotal: 344.455,\
itemAppeasementTotalInCurrencies: [{currency: 'USD', group: 'SHOPPER', amount: 123.45}],\
itemCancelTotal: 344.455,\
itemCancelTotalInCurrencies: [{currency: 'USD', group: 'SHOPPER', amount: 123.45}],\
itemDiscountsTotal: 3.45,\
itemDiscountsTotalInCurrencies: [{currency: 'USD', group: 'SHOPPER', amount: 123.45}],\
itemFeeTotal: 33.4,\
itemFeeTotalInCurrencies: [{currency: 'USD', group: 'SHOPPER', amount: 123.45}],\
itemId: 1234455322,\
itemTaxTotal: 2.4,\
itemTaxTotalInCurrencies: [{currency: 'USD', group: 'SHOPPER', amount: 123.45}],\
itemUnitPrice: 33.4,\
itemUnitPriceInCurrencies: [{currency: 'USD', group: 'SHOPPER', amount: 123.45}],\
lineItemCreatedAt: '2022-11-22T10:26:38.000+00:00',\
lineItemId: '1adfrghhh2346aaaf',\
lineItemNumber: 1,\
locationStoreId: 4512345,\
orderId: '33adfrghhh2346aaaffff',\
returnExpirationDays: 21,\
returns: [\
{\
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,\
invoicedAmountInCurrencies: [{currency: 'USD', group: 'SHOPPER', amount: 123.45}],\
isExchangeItemReturned: true,\
reasonCode: 'Incorrect item',\
refundAmount: 11.29,\
refundAmountInCurrencies: [{currency: 'USD', group: 'SHOPPER', amount: 123.45}],\
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',\
shipmentLineItemId: '234',\
shipmentQuantity: 1\
}\
],\
shipToId: '5349b4ddd2781d08c09890f4',\
shipmentLineItemId: '2adfrghhh2346aaaffff',\
sku: 'P1234',\
taxDetails: [\
{\
amount: 34.56,\
amountInCurrencies: [{currency: 'USD', group: 'SHOPPER', amount: 123.45}],\
type: 'tax'\
}\
],\
type: 'WEB_PICKUP',\
uom: 'EA'\
}\
],\
orderNumber: '217088603',\
orderExternalId: 217088603,\
orderSubtype: 'INTERNATIONAL',\
orderType: 'WEB',\
orderedAt: '2022-05-12T09:30:31.198Z',\
payments: [\
{\
attributes: {},\
authorizedAmount: 256.1,\
authorizedAmountInCurrencies: [{currency: 'USD', group: 'SHOPPER', amount: 123.45}],\
conversion: 1,\
currency: 'USD',\
paidAt: '2022-01-27T16:15:58.000-05:00',\
paymentCounter: 1,\
paymentIdentifier: {cardIdentifier: '***********3456'},\
paymentMethod: 'CREDIT_CARD',\
paymentProvider: 'stripe',\
paymentStatus: 'PAID',\
paymentToken: {token: 'pi_34tr6787rt'},\
paymentType: 'VISA',\
settlement: {\
settledAt: '2022-01-27T21:15:58Z',\
settlementAmount: 10.3,\
settlementAmountInCurrencies: [{currency: 'USD', group: 'SHOPPER', amount: 123.45}],\
settlementStatusCode: 'SETTLED'\
}\
}\
],\
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}]\
}\
],\
taxDetails: [\
{\
amount: 34.56,\
amountInCurrencies: [{currency: 'USD', group: 'SHOPPER', amount: 123.45}],\
type: 'tax'\
}\
]\
}\
],
locationNumber: 3235,
location: {locationNumber: 'WH334'},
retail: {cashierId: 'CE-321', locationNumber: 'WH334'},
invoiceTotalInCurrencies: [{currency: 'USD', group: 'SHOPPER', amount: 123.45}],
totalTaxAmountInCurrencies: [{currency: 'USD', group: 'SHOPPER', amount: 123.45}],
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'
},
attributes: {attribute1: 'value'}
})
};
fetch('https://api.fabric.inc/v3/invoices', 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/invoices",\
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([\
'invoiceNumber' => 23940791,\
'shipmentId' => '62ff5c0bec0aed3c86202c32',\
'channelId' => 10,\
'invoiceTotal' => 245.7,\
'totalTaxAmount' => 245.7,\
'currency' => 'USD',\
'requestContext' => [\
'type' => '<string>',\
'requestTime' => '2022-04-12T09:30:31.198Z',\
'attributes' => [\
'attribute' => 'N',\
'someFlag' => true\
]\
],\
'invoiceExternalId' => 191763090,\
'invoiceStatus' => 'CAPTURED',\
'invoiceType' => 'SHIPPING',\
'invoicedAt' => '2022-08-01T20:03:28.483Z',\
'shipmentNumber' => 217088603,\
'shippedAt' => '2022-08-01T20:03:28.483Z',\
'orders' => [\
[\
'invoiceOrderTotal' => 245.7,\
'orderId' => '62ff5c0bec0aed3c86202c32',\
'adjustments' => [\
[\
'adjustmentCounter' => 1,\
'amount' => 34.56,\
'amountInCurrencies' => [\
[\
'currency' => 'USD',\
'group' => 'SHOPPER',\
'amount' => 123.45\
]\
],\
'attributes' => [\
\
],\
'notes' => 'Any additional info',\
'quantity' => 1,\
'reasonCode' => 'Incorrect Item',\
'subReasonCode' => 'Late shipping',\
'value' => 34.56\
]\
],\
'appeasements' => [\
[\
'amount' => 34.56,\
'amountInCurrencies' => [\
[\
'currency' => 'USD',\
'group' => 'SHOPPER',\
'amount' => 123.45\
]\
],\
'appeasementCounter' => 1,\
'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',\
'subReasonCode' => 'Late shipping'\
]\
],\
'discounts' => [\
[\
'promotionId' => 'HNY2022',\
'amount' => 2,\
'amountInCurrencies' => [\
[\
'currency' => 'USD',\
'group' => 'SHOPPER',\
'amount' => 123.45\
]\
],\
'promotionCode' => 'HNY2022',\
'promotionName' => 'Happy New Year',\
'quantity' => 2,\
'type' => 'promotion'\
]\
],\
'fees' => [\
[\
'amount' => 34.56,\
'amountInCurrencies' => [\
[\
'currency' => 'USD',\
'group' => 'SHOPPER',\
'amount' => 123.45\
]\
],\
'quantity' => 1,\
'refundAmount' => 345.56,\
'refundAmountInCurrencies' => [\
[\
'currency' => 'USD',\
'group' => 'SHOPPER',\
'amount' => 123.45\
]\
],\
'type' => 'tax'\
]\
],\
'items' => [\
[\
'invoiceLineNumber' => 3,\
'adjustmentTotal' => 123.45,\
'adjustmentTotalInCurrencies' => [\
[\
'currency' => 'USD',\
'group' => 'SHOPPER',\
'amount' => 123.45\
]\
],\
'adjustments' => [\
[\
'adjustmentCounter' => 1,\
'amount' => 34.56,\
'amountInCurrencies' => [\
[\
'currency' => 'USD',\
'group' => 'SHOPPER',\
'amount' => 123.45\
]\
],\
'attributes' => [\
\
],\
'notes' => 'Any additional info',\
'quantity' => 1,\
'reasonCode' => 'Incorrect Item',\
'subReasonCode' => 'Late shipping',\
'value' => 34.56\
]\
],\
'appeasements' => [\
[\
'amount' => 34.56,\
'amountInCurrencies' => [\
[\
'currency' => 'USD',\
'group' => 'SHOPPER',\
'amount' => 123.45\
]\
],\
'appeasementCounter' => 1,\
'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',\
'subReasonCode' => 'Late shipping'\
]\
],\
'attributes' => [\
'key' => 'value'\
],\
'cancellations' => [\
[\
'cancellationCounter' => 1,\
'source' => 'CSR',\
'reasonCode' => 'Order Line Cancel',\
'subReasonCode' => 'Late shipping',\
'status' => 'PROCESSING',\
'amount' => '-20.',\
'amountInCurrencies' => [\
[\
'currency' => 'USD',\
'group' => 'SHOPPER',\
'amount' => 123.45\
]\
],\
'invoicedAmount' => '-20.',\
'invoicedAmountInCurrencies' => [\
[\
'currency' => 'USD',\
'group' => 'SHOPPER',\
'amount' => 123.45\
]\
],\
'payments' => [\
[\
'paymentCounter' => 1,\
'amount' => '-20.',\
'amountInCurrencies' => [\
[\
'currency' => 'USD',\
'group' => 'SHOPPER',\
'amount' => 123.45\
]\
]\
]\
],\
'refunds' => [\
[\
'type' => 'ITEM',\
'name' => 'Name',\
'amount' => '-10.',\
'amountInCurrencies' => [\
[\
'currency' => 'USD',\
'group' => 'SHOPPER',\
'amount' => 123.45\
]\
]\
]\
],\
'attributes' => [\
'number' => 'XlQZTmFDFtPFGMxJP6oiAqN3vo+qKZ'\
],\
'quantity' => 10\
]\
],\
'currency' => 'USD',\
'discounts' => [\
[\
'promotionId' => 'HNY2022',\
'amount' => 2,\
'amountInCurrencies' => [\
[\
'currency' => 'USD',\
'group' => 'SHOPPER',\
'amount' => 123.45\
]\
],\
'promotionCode' => 'HNY2022',\
'promotionName' => 'Happy New Year',\
'quantity' => 2,\
'type' => 'promotion'\
]\
],\
'fees' => [\
[\
'amount' => 34.56,\
'amountInCurrencies' => [\
[\
'currency' => 'USD',\
'group' => 'SHOPPER',\
'amount' => 123.45\
]\
],\
'quantity' => 1,\
'refundAmount' => 345.56,\
'refundAmountInCurrencies' => [\
[\
'currency' => 'USD',\
'group' => 'SHOPPER',\
'amount' => 123.45\
]\
],\
'type' => 'tax'\
]\
],\
'invoiceLineTotal' => 600,\
'invoiceLineTotalInCurrencies' => [\
[\
'currency' => 'USD',\
'group' => 'SHOPPER',\
'amount' => 123.45\
]\
],\
'invoiceQuantity' => 10,\
'itemAppeasementTotal' => 344.455,\
'itemAppeasementTotalInCurrencies' => [\
[\
'currency' => 'USD',\
'group' => 'SHOPPER',\
'amount' => 123.45\
]\
],\
'itemCancelTotal' => 344.455,\
'itemCancelTotalInCurrencies' => [\
[\
'currency' => 'USD',\
'group' => 'SHOPPER',\
'amount' => 123.45\
]\
],\
'itemDiscountsTotal' => 3.45,\
'itemDiscountsTotalInCurrencies' => [\
[\
'currency' => 'USD',\
'group' => 'SHOPPER',\
'amount' => 123.45\
]\
],\
'itemFeeTotal' => 33.4,\
'itemFeeTotalInCurrencies' => [\
[\
'currency' => 'USD',\
'group' => 'SHOPPER',\
'amount' => 123.45\
]\
],\
'itemId' => 1234455322,\
'itemTaxTotal' => 2.4,\
'itemTaxTotalInCurrencies' => [\
[\
'currency' => 'USD',\
'group' => 'SHOPPER',\
'amount' => 123.45\
]\
],\
'itemUnitPrice' => 33.4,\
'itemUnitPriceInCurrencies' => [\
[\
'currency' => 'USD',\
'group' => 'SHOPPER',\
'amount' => 123.45\
]\
],\
'lineItemCreatedAt' => '2022-11-22T10:26:38.000+00:00',\
'lineItemId' => '1adfrghhh2346aaaf',\
'lineItemNumber' => 1,\
'locationStoreId' => 4512345,\
'orderId' => '33adfrghhh2346aaaffff',\
'returnExpirationDays' => 21,\
'returns' => [\
[\
'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,\
'invoicedAmountInCurrencies' => [\
[\
'currency' => 'USD',\
'group' => 'SHOPPER',\
'amount' => 123.45\
]\
],\
'isExchangeItemReturned' => true,\
'reasonCode' => 'Incorrect item',\
'refundAmount' => 11.29,\
'refundAmountInCurrencies' => [\
[\
'currency' => 'USD',\
'group' => 'SHOPPER',\
'amount' => 123.45\
]\
],\
'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',\
'shipmentLineItemId' => '234',\
'shipmentQuantity' => 1\
]\
],\
'shipToId' => '5349b4ddd2781d08c09890f4',\
'shipmentLineItemId' => '2adfrghhh2346aaaffff',\
'sku' => 'P1234',\
'taxDetails' => [\
[\
'amount' => 34.56,\
'amountInCurrencies' => [\
[\
'currency' => 'USD',\
'group' => 'SHOPPER',\
'amount' => 123.45\
]\
],\
'type' => 'tax'\
]\
],\
'type' => 'WEB_PICKUP',\
'uom' => 'EA'\
]\
],\
'orderNumber' => '217088603',\
'orderExternalId' => 217088603,\
'orderSubtype' => 'INTERNATIONAL',\
'orderType' => 'WEB',\
'orderedAt' => '2022-05-12T09:30:31.198Z',\
'payments' => [\
[\
'attributes' => [\
\
],\
'authorizedAmount' => 256.1,\
'authorizedAmountInCurrencies' => [\
[\
'currency' => 'USD',\
'group' => 'SHOPPER',\
'amount' => 123.45\
]\
],\
'conversion' => 1,\
'currency' => 'USD',\
'paidAt' => '2022-01-27T16:15:58.000-05:00',\
'paymentCounter' => 1,\
'paymentIdentifier' => [\
'cardIdentifier' => '***********3456'\
],\
'paymentMethod' => 'CREDIT_CARD',\
'paymentProvider' => 'stripe',\
'paymentStatus' => 'PAID',\
'paymentToken' => [\
'token' => 'pi_34tr6787rt'\
],\
'paymentType' => 'VISA',\
'settlement' => [\
'settledAt' => '2022-01-27T21:15:58Z',\
'settlementAmount' => 10.3,\
'settlementAmountInCurrencies' => [\
[\
'currency' => 'USD',\
'group' => 'SHOPPER',\
'amount' => 123.45\
]\
],\
'settlementStatusCode' => 'SETTLED'\
]\
]\
],\
'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\
]\
]\
]\
],\
'taxDetails' => [\
[\
'amount' => 34.56,\
'amountInCurrencies' => [\
[\
'currency' => 'USD',\
'group' => 'SHOPPER',\
'amount' => 123.45\
]\
],\
'type' => 'tax'\
]\
]\
]\
],\
'locationNumber' => 3235,\
'location' => [\
'locationNumber' => 'WH334'\
],\
'retail' => [\
'cashierId' => 'CE-321',\
'locationNumber' => 'WH334'\
],\
'invoiceTotalInCurrencies' => [\
[\
'currency' => 'USD',\
'group' => 'SHOPPER',\
'amount' => 123.45\
]\
],\
'totalTaxAmountInCurrencies' => [\
[\
'currency' => 'USD',\
'group' => 'SHOPPER',\
'amount' => 123.45\
]\
],\
'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'\
],\
'attributes' => [\
'attribute1' => 'value'\
]\
]),\
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/invoices"
payload := strings.NewReader("{\n \"invoiceNumber\": 23940791,\n \"shipmentId\": \"62ff5c0bec0aed3c86202c32\",\n \"channelId\": 10,\n \"invoiceTotal\": 245.7,\n \"totalTaxAmount\": 245.7,\n \"currency\": \"USD\",\n \"requestContext\": {\n \"type\": \"<string>\",\n \"requestTime\": \"2022-04-12T09:30:31.198Z\",\n \"attributes\": {\n \"attribute\": \"N\",\n \"someFlag\": true\n }\n },\n \"invoiceExternalId\": 191763090,\n \"invoiceStatus\": \"CAPTURED\",\n \"invoiceType\": \"SHIPPING\",\n \"invoicedAt\": \"2022-08-01T20:03:28.483Z\",\n \"shipmentNumber\": 217088603,\n \"shippedAt\": \"2022-08-01T20:03:28.483Z\",\n \"orders\": [\n {\n \"invoiceOrderTotal\": 245.7,\n \"orderId\": \"62ff5c0bec0aed3c86202c32\",\n \"adjustments\": [\n {\n \"adjustmentCounter\": 1,\n \"amount\": 34.56,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"attributes\": {},\n \"notes\": \"Any additional info\",\n \"quantity\": 1,\n \"reasonCode\": \"Incorrect Item\",\n \"subReasonCode\": \"Late shipping\",\n \"value\": 34.56\n }\n ],\n \"appeasements\": [\n {\n \"amount\": 34.56,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"appeasementCounter\": 1,\n \"invoicedAmount\": 34.56,\n \"invoicedAmountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"payments\": [\n {\n \"paymentCounter\": 1,\n \"refundAmount\": 34.56,\n \"refundAmountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ]\n }\n ],\n \"reasonCode\": \"Incorrect Item\",\n \"subReasonCode\": \"Late shipping\"\n }\n ],\n \"discounts\": [\n {\n \"promotionId\": \"HNY2022\",\n \"amount\": 2,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"promotionCode\": \"HNY2022\",\n \"promotionName\": \"Happy New Year\",\n \"quantity\": 2,\n \"type\": \"promotion\"\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 \"quantity\": 1,\n \"refundAmount\": 345.56,\n \"refundAmountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"type\": \"tax\"\n }\n ],\n \"items\": [\n {\n \"invoiceLineNumber\": 3,\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\": 34.56,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"attributes\": {},\n \"notes\": \"Any additional info\",\n \"quantity\": 1,\n \"reasonCode\": \"Incorrect Item\",\n \"subReasonCode\": \"Late shipping\",\n \"value\": 34.56\n }\n ],\n \"appeasements\": [\n {\n \"amount\": 34.56,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"appeasementCounter\": 1,\n \"invoicedAmount\": 34.56,\n \"invoicedAmountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"payments\": [\n {\n \"paymentCounter\": 1,\n \"refundAmount\": 34.56,\n \"refundAmountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ]\n }\n ],\n \"reasonCode\": \"Incorrect Item\",\n \"subReasonCode\": \"Late shipping\"\n }\n ],\n \"attributes\": {\n \"key\": \"value\"\n },\n \"cancellations\": [\n {\n \"cancellationCounter\": 1,\n \"source\": \"CSR\",\n \"reasonCode\": \"Order Line Cancel\",\n \"subReasonCode\": \"Late shipping\",\n \"status\": \"PROCESSING\",\n \"amount\": \"-20.\",\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"invoicedAmount\": \"-20.\",\n \"invoicedAmountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"payments\": [\n {\n \"paymentCounter\": 1,\n \"amount\": \"-20.\",\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ]\n }\n ],\n \"refunds\": [\n {\n \"type\": \"ITEM\",\n \"name\": \"Name\",\n \"amount\": \"-10.\",\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ]\n }\n ],\n \"attributes\": {\n \"number\": \"XlQZTmFDFtPFGMxJP6oiAqN3vo+qKZ\"\n },\n \"quantity\": 10\n }\n ],\n \"currency\": \"USD\",\n \"discounts\": [\n {\n \"promotionId\": \"HNY2022\",\n \"amount\": 2,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"promotionCode\": \"HNY2022\",\n \"promotionName\": \"Happy New Year\",\n \"quantity\": 2,\n \"type\": \"promotion\"\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 \"quantity\": 1,\n \"refundAmount\": 345.56,\n \"refundAmountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"type\": \"tax\"\n }\n ],\n \"invoiceLineTotal\": 600,\n \"invoiceLineTotalInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"invoiceQuantity\": 10,\n \"itemAppeasementTotal\": 344.455,\n \"itemAppeasementTotalInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"itemCancelTotal\": 344.455,\n \"itemCancelTotalInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"itemDiscountsTotal\": 3.45,\n \"itemDiscountsTotalInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"itemFeeTotal\": 33.4,\n \"itemFeeTotalInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"itemId\": 1234455322,\n \"itemTaxTotal\": 2.4,\n \"itemTaxTotalInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"itemUnitPrice\": 33.4,\n \"itemUnitPriceInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"lineItemCreatedAt\": \"2022-11-22T10:26:38.000+00:00\",\n \"lineItemId\": \"1adfrghhh2346aaaf\",\n \"lineItemNumber\": 1,\n \"locationStoreId\": 4512345,\n \"orderId\": \"33adfrghhh2346aaaffff\",\n \"returnExpirationDays\": 21,\n \"returns\": [\n {\n \"exchangeLineItemId\": \"62f3dfc438bcab1951be0a19\",\n \"fees\": [\n {\n \"amount\": 34.56,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"name\": \"RETURN_FEE\",\n \"reason\": \"Return fee\",\n \"type\": \"FEE\"\n }\n ],\n \"invoicedAmount\": 11.29,\n \"invoicedAmountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"isExchangeItemReturned\": true,\n \"reasonCode\": \"Incorrect item\",\n \"refundAmount\": 11.29,\n \"refundAmountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"refunds\": [\n {\n \"amount\": 34.56,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"name\": \"RETURN_FEE\",\n \"reason\": \"Return fee\",\n \"type\": \"FEE\"\n }\n ],\n \"returnRequestCounter\": 1,\n \"returnsReceivedAt\": \"2022-09-14T14:07:36.861Z\",\n \"shipmentId\": \"62b37697c67b204dd18a7465\",\n \"shipmentLineItemId\": \"234\",\n \"shipmentQuantity\": 1\n }\n ],\n \"shipToId\": \"5349b4ddd2781d08c09890f4\",\n \"shipmentLineItemId\": \"2adfrghhh2346aaaffff\",\n \"sku\": \"P1234\",\n \"taxDetails\": [\n {\n \"amount\": 34.56,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"type\": \"tax\"\n }\n ],\n \"type\": \"WEB_PICKUP\",\n \"uom\": \"EA\"\n }\n ],\n \"orderNumber\": \"217088603\",\n \"orderExternalId\": 217088603,\n \"orderSubtype\": \"INTERNATIONAL\",\n \"orderType\": \"WEB\",\n \"orderedAt\": \"2022-05-12T09:30:31.198Z\",\n \"payments\": [\n {\n \"attributes\": {},\n \"authorizedAmount\": 256.1,\n \"authorizedAmountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"conversion\": 1,\n \"currency\": \"USD\",\n \"paidAt\": \"2022-01-27T16:15:58.000-05:00\",\n \"paymentCounter\": 1,\n \"paymentIdentifier\": {\n \"cardIdentifier\": \"***********3456\"\n },\n \"paymentMethod\": \"CREDIT_CARD\",\n \"paymentProvider\": \"stripe\",\n \"paymentStatus\": \"PAID\",\n \"paymentToken\": {\n \"token\": \"pi_34tr6787rt\"\n },\n \"paymentType\": \"VISA\",\n \"settlement\": {\n \"settledAt\": \"2022-01-27T21:15:58Z\",\n \"settlementAmount\": 10.3,\n \"settlementAmountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"settlementStatusCode\": \"SETTLED\"\n }\n }\n ],\n \"returns\": [\n {\n \"attributes\": {\n \"transactionId\": \"0R12TQ46\"\n },\n \"fees\": [\n {\n \"amount\": 34.56,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"name\": \"RETURN_FEE\",\n \"reason\": \"Return fee\",\n \"type\": \"FEE\"\n }\n ],\n \"invoicedAmount\": 11.29,\n \"invoicedAmountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"paymentCounterRefundDetails\": [\n {\n \"amount\": 34.56,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"paymentCounter\": 1\n }\n ],\n \"refunds\": [\n {\n \"amount\": 34.56,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"name\": \"RETURN_FEE\",\n \"reason\": \"Return fee\",\n \"type\": \"FEE\"\n }\n ],\n \"returnCounter\": 1,\n \"totalRefundAmount\": 11.29,\n \"totalRefundAmountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ]\n }\n ],\n \"taxDetails\": [\n {\n \"amount\": 34.56,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"type\": \"tax\"\n }\n ]\n }\n ],\n \"locationNumber\": 3235,\n \"location\": {\n \"locationNumber\": \"WH334\"\n },\n \"retail\": {\n \"cashierId\": \"CE-321\",\n \"locationNumber\": \"WH334\"\n },\n \"invoiceTotalInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"totalTaxAmountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\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 \"attributes\": {\n \"attribute1\": \"value\"\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/invoices")
.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 \"invoiceNumber\": 23940791,\n \"shipmentId\": \"62ff5c0bec0aed3c86202c32\",\n \"channelId\": 10,\n \"invoiceTotal\": 245.7,\n \"totalTaxAmount\": 245.7,\n \"currency\": \"USD\",\n \"requestContext\": {\n \"type\": \"<string>\",\n \"requestTime\": \"2022-04-12T09:30:31.198Z\",\n \"attributes\": {\n \"attribute\": \"N\",\n \"someFlag\": true\n }\n },\n \"invoiceExternalId\": 191763090,\n \"invoiceStatus\": \"CAPTURED\",\n \"invoiceType\": \"SHIPPING\",\n \"invoicedAt\": \"2022-08-01T20:03:28.483Z\",\n \"shipmentNumber\": 217088603,\n \"shippedAt\": \"2022-08-01T20:03:28.483Z\",\n \"orders\": [\n {\n \"invoiceOrderTotal\": 245.7,\n \"orderId\": \"62ff5c0bec0aed3c86202c32\",\n \"adjustments\": [\n {\n \"adjustmentCounter\": 1,\n \"amount\": 34.56,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"attributes\": {},\n \"notes\": \"Any additional info\",\n \"quantity\": 1,\n \"reasonCode\": \"Incorrect Item\",\n \"subReasonCode\": \"Late shipping\",\n \"value\": 34.56\n }\n ],\n \"appeasements\": [\n {\n \"amount\": 34.56,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"appeasementCounter\": 1,\n \"invoicedAmount\": 34.56,\n \"invoicedAmountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"payments\": [\n {\n \"paymentCounter\": 1,\n \"refundAmount\": 34.56,\n \"refundAmountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ]\n }\n ],\n \"reasonCode\": \"Incorrect Item\",\n \"subReasonCode\": \"Late shipping\"\n }\n ],\n \"discounts\": [\n {\n \"promotionId\": \"HNY2022\",\n \"amount\": 2,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"promotionCode\": \"HNY2022\",\n \"promotionName\": \"Happy New Year\",\n \"quantity\": 2,\n \"type\": \"promotion\"\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 \"quantity\": 1,\n \"refundAmount\": 345.56,\n \"refundAmountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"type\": \"tax\"\n }\n ],\n \"items\": [\n {\n \"invoiceLineNumber\": 3,\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\": 34.56,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"attributes\": {},\n \"notes\": \"Any additional info\",\n \"quantity\": 1,\n \"reasonCode\": \"Incorrect Item\",\n \"subReasonCode\": \"Late shipping\",\n \"value\": 34.56\n }\n ],\n \"appeasements\": [\n {\n \"amount\": 34.56,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"appeasementCounter\": 1,\n \"invoicedAmount\": 34.56,\n \"invoicedAmountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"payments\": [\n {\n \"paymentCounter\": 1,\n \"refundAmount\": 34.56,\n \"refundAmountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ]\n }\n ],\n \"reasonCode\": \"Incorrect Item\",\n \"subReasonCode\": \"Late shipping\"\n }\n ],\n \"attributes\": {\n \"key\": \"value\"\n },\n \"cancellations\": [\n {\n \"cancellationCounter\": 1,\n \"source\": \"CSR\",\n \"reasonCode\": \"Order Line Cancel\",\n \"subReasonCode\": \"Late shipping\",\n \"status\": \"PROCESSING\",\n \"amount\": \"-20.\",\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"invoicedAmount\": \"-20.\",\n \"invoicedAmountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"payments\": [\n {\n \"paymentCounter\": 1,\n \"amount\": \"-20.\",\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ]\n }\n ],\n \"refunds\": [\n {\n \"type\": \"ITEM\",\n \"name\": \"Name\",\n \"amount\": \"-10.\",\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ]\n }\n ],\n \"attributes\": {\n \"number\": \"XlQZTmFDFtPFGMxJP6oiAqN3vo+qKZ\"\n },\n \"quantity\": 10\n }\n ],\n \"currency\": \"USD\",\n \"discounts\": [\n {\n \"promotionId\": \"HNY2022\",\n \"amount\": 2,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"promotionCode\": \"HNY2022\",\n \"promotionName\": \"Happy New Year\",\n \"quantity\": 2,\n \"type\": \"promotion\"\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 \"quantity\": 1,\n \"refundAmount\": 345.56,\n \"refundAmountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"type\": \"tax\"\n }\n ],\n \"invoiceLineTotal\": 600,\n \"invoiceLineTotalInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"invoiceQuantity\": 10,\n \"itemAppeasementTotal\": 344.455,\n \"itemAppeasementTotalInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"itemCancelTotal\": 344.455,\n \"itemCancelTotalInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"itemDiscountsTotal\": 3.45,\n \"itemDiscountsTotalInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"itemFeeTotal\": 33.4,\n \"itemFeeTotalInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"itemId\": 1234455322,\n \"itemTaxTotal\": 2.4,\n \"itemTaxTotalInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"itemUnitPrice\": 33.4,\n \"itemUnitPriceInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"lineItemCreatedAt\": \"2022-11-22T10:26:38.000+00:00\",\n \"lineItemId\": \"1adfrghhh2346aaaf\",\n \"lineItemNumber\": 1,\n \"locationStoreId\": 4512345,\n \"orderId\": \"33adfrghhh2346aaaffff\",\n \"returnExpirationDays\": 21,\n \"returns\": [\n {\n \"exchangeLineItemId\": \"62f3dfc438bcab1951be0a19\",\n \"fees\": [\n {\n \"amount\": 34.56,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"name\": \"RETURN_FEE\",\n \"reason\": \"Return fee\",\n \"type\": \"FEE\"\n }\n ],\n \"invoicedAmount\": 11.29,\n \"invoicedAmountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"isExchangeItemReturned\": true,\n \"reasonCode\": \"Incorrect item\",\n \"refundAmount\": 11.29,\n \"refundAmountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"refunds\": [\n {\n \"amount\": 34.56,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"name\": \"RETURN_FEE\",\n \"reason\": \"Return fee\",\n \"type\": \"FEE\"\n }\n ],\n \"returnRequestCounter\": 1,\n \"returnsReceivedAt\": \"2022-09-14T14:07:36.861Z\",\n \"shipmentId\": \"62b37697c67b204dd18a7465\",\n \"shipmentLineItemId\": \"234\",\n \"shipmentQuantity\": 1\n }\n ],\n \"shipToId\": \"5349b4ddd2781d08c09890f4\",\n \"shipmentLineItemId\": \"2adfrghhh2346aaaffff\",\n \"sku\": \"P1234\",\n \"taxDetails\": [\n {\n \"amount\": 34.56,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"type\": \"tax\"\n }\n ],\n \"type\": \"WEB_PICKUP\",\n \"uom\": \"EA\"\n }\n ],\n \"orderNumber\": \"217088603\",\n \"orderExternalId\": 217088603,\n \"orderSubtype\": \"INTERNATIONAL\",\n \"orderType\": \"WEB\",\n \"orderedAt\": \"2022-05-12T09:30:31.198Z\",\n \"payments\": [\n {\n \"attributes\": {},\n \"authorizedAmount\": 256.1,\n \"authorizedAmountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"conversion\": 1,\n \"currency\": \"USD\",\n \"paidAt\": \"2022-01-27T16:15:58.000-05:00\",\n \"paymentCounter\": 1,\n \"paymentIdentifier\": {\n \"cardIdentifier\": \"***********3456\"\n },\n \"paymentMethod\": \"CREDIT_CARD\",\n \"paymentProvider\": \"stripe\",\n \"paymentStatus\": \"PAID\",\n \"paymentToken\": {\n \"token\": \"pi_34tr6787rt\"\n },\n \"paymentType\": \"VISA\",\n \"settlement\": {\n \"settledAt\": \"2022-01-27T21:15:58Z\",\n \"settlementAmount\": 10.3,\n \"settlementAmountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"settlementStatusCode\": \"SETTLED\"\n }\n }\n ],\n \"returns\": [\n {\n \"attributes\": {\n \"transactionId\": \"0R12TQ46\"\n },\n \"fees\": [\n {\n \"amount\": 34.56,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"name\": \"RETURN_FEE\",\n \"reason\": \"Return fee\",\n \"type\": \"FEE\"\n }\n ],\n \"invoicedAmount\": 11.29,\n \"invoicedAmountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"paymentCounterRefundDetails\": [\n {\n \"amount\": 34.56,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"paymentCounter\": 1\n }\n ],\n \"refunds\": [\n {\n \"amount\": 34.56,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"name\": \"RETURN_FEE\",\n \"reason\": \"Return fee\",\n \"type\": \"FEE\"\n }\n ],\n \"returnCounter\": 1,\n \"totalRefundAmount\": 11.29,\n \"totalRefundAmountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ]\n }\n ],\n \"taxDetails\": [\n {\n \"amount\": 34.56,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"type\": \"tax\"\n }\n ]\n }\n ],\n \"locationNumber\": 3235,\n \"location\": {\n \"locationNumber\": \"WH334\"\n },\n \"retail\": {\n \"cashierId\": \"CE-321\",\n \"locationNumber\": \"WH334\"\n },\n \"invoiceTotalInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"totalTaxAmountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\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 \"attributes\": {\n \"attribute1\": \"value\"\n }\n}")
.asString();
require 'uri'
require 'net/http'
url = URI("https://api.fabric.inc/v3/invoices")
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 \"invoiceNumber\": 23940791,\n \"shipmentId\": \"62ff5c0bec0aed3c86202c32\",\n \"channelId\": 10,\n \"invoiceTotal\": 245.7,\n \"totalTaxAmount\": 245.7,\n \"currency\": \"USD\",\n \"requestContext\": {\n \"type\": \"<string>\",\n \"requestTime\": \"2022-04-12T09:30:31.198Z\",\n \"attributes\": {\n \"attribute\": \"N\",\n \"someFlag\": true\n }\n },\n \"invoiceExternalId\": 191763090,\n \"invoiceStatus\": \"CAPTURED\",\n \"invoiceType\": \"SHIPPING\",\n \"invoicedAt\": \"2022-08-01T20:03:28.483Z\",\n \"shipmentNumber\": 217088603,\n \"shippedAt\": \"2022-08-01T20:03:28.483Z\",\n \"orders\": [\n {\n \"invoiceOrderTotal\": 245.7,\n \"orderId\": \"62ff5c0bec0aed3c86202c32\",\n \"adjustments\": [\n {\n \"adjustmentCounter\": 1,\n \"amount\": 34.56,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"attributes\": {},\n \"notes\": \"Any additional info\",\n \"quantity\": 1,\n \"reasonCode\": \"Incorrect Item\",\n \"subReasonCode\": \"Late shipping\",\n \"value\": 34.56\n }\n ],\n \"appeasements\": [\n {\n \"amount\": 34.56,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"appeasementCounter\": 1,\n \"invoicedAmount\": 34.56,\n \"invoicedAmountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"payments\": [\n {\n \"paymentCounter\": 1,\n \"refundAmount\": 34.56,\n \"refundAmountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ]\n }\n ],\n \"reasonCode\": \"Incorrect Item\",\n \"subReasonCode\": \"Late shipping\"\n }\n ],\n \"discounts\": [\n {\n \"promotionId\": \"HNY2022\",\n \"amount\": 2,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"promotionCode\": \"HNY2022\",\n \"promotionName\": \"Happy New Year\",\n \"quantity\": 2,\n \"type\": \"promotion\"\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 \"quantity\": 1,\n \"refundAmount\": 345.56,\n \"refundAmountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"type\": \"tax\"\n }\n ],\n \"items\": [\n {\n \"invoiceLineNumber\": 3,\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\": 34.56,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"attributes\": {},\n \"notes\": \"Any additional info\",\n \"quantity\": 1,\n \"reasonCode\": \"Incorrect Item\",\n \"subReasonCode\": \"Late shipping\",\n \"value\": 34.56\n }\n ],\n \"appeasements\": [\n {\n \"amount\": 34.56,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"appeasementCounter\": 1,\n \"invoicedAmount\": 34.56,\n \"invoicedAmountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"payments\": [\n {\n \"paymentCounter\": 1,\n \"refundAmount\": 34.56,\n \"refundAmountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ]\n }\n ],\n \"reasonCode\": \"Incorrect Item\",\n \"subReasonCode\": \"Late shipping\"\n }\n ],\n \"attributes\": {\n \"key\": \"value\"\n },\n \"cancellations\": [\n {\n \"cancellationCounter\": 1,\n \"source\": \"CSR\",\n \"reasonCode\": \"Order Line Cancel\",\n \"subReasonCode\": \"Late shipping\",\n \"status\": \"PROCESSING\",\n \"amount\": \"-20.\",\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"invoicedAmount\": \"-20.\",\n \"invoicedAmountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"payments\": [\n {\n \"paymentCounter\": 1,\n \"amount\": \"-20.\",\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ]\n }\n ],\n \"refunds\": [\n {\n \"type\": \"ITEM\",\n \"name\": \"Name\",\n \"amount\": \"-10.\",\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ]\n }\n ],\n \"attributes\": {\n \"number\": \"XlQZTmFDFtPFGMxJP6oiAqN3vo+qKZ\"\n },\n \"quantity\": 10\n }\n ],\n \"currency\": \"USD\",\n \"discounts\": [\n {\n \"promotionId\": \"HNY2022\",\n \"amount\": 2,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"promotionCode\": \"HNY2022\",\n \"promotionName\": \"Happy New Year\",\n \"quantity\": 2,\n \"type\": \"promotion\"\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 \"quantity\": 1,\n \"refundAmount\": 345.56,\n \"refundAmountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"type\": \"tax\"\n }\n ],\n \"invoiceLineTotal\": 600,\n \"invoiceLineTotalInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"invoiceQuantity\": 10,\n \"itemAppeasementTotal\": 344.455,\n \"itemAppeasementTotalInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"itemCancelTotal\": 344.455,\n \"itemCancelTotalInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"itemDiscountsTotal\": 3.45,\n \"itemDiscountsTotalInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"itemFeeTotal\": 33.4,\n \"itemFeeTotalInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"itemId\": 1234455322,\n \"itemTaxTotal\": 2.4,\n \"itemTaxTotalInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"itemUnitPrice\": 33.4,\n \"itemUnitPriceInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"lineItemCreatedAt\": \"2022-11-22T10:26:38.000+00:00\",\n \"lineItemId\": \"1adfrghhh2346aaaf\",\n \"lineItemNumber\": 1,\n \"locationStoreId\": 4512345,\n \"orderId\": \"33adfrghhh2346aaaffff\",\n \"returnExpirationDays\": 21,\n \"returns\": [\n {\n \"exchangeLineItemId\": \"62f3dfc438bcab1951be0a19\",\n \"fees\": [\n {\n \"amount\": 34.56,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"name\": \"RETURN_FEE\",\n \"reason\": \"Return fee\",\n \"type\": \"FEE\"\n }\n ],\n \"invoicedAmount\": 11.29,\n \"invoicedAmountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"isExchangeItemReturned\": true,\n \"reasonCode\": \"Incorrect item\",\n \"refundAmount\": 11.29,\n \"refundAmountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"refunds\": [\n {\n \"amount\": 34.56,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"name\": \"RETURN_FEE\",\n \"reason\": \"Return fee\",\n \"type\": \"FEE\"\n }\n ],\n \"returnRequestCounter\": 1,\n \"returnsReceivedAt\": \"2022-09-14T14:07:36.861Z\",\n \"shipmentId\": \"62b37697c67b204dd18a7465\",\n \"shipmentLineItemId\": \"234\",\n \"shipmentQuantity\": 1\n }\n ],\n \"shipToId\": \"5349b4ddd2781d08c09890f4\",\n \"shipmentLineItemId\": \"2adfrghhh2346aaaffff\",\n \"sku\": \"P1234\",\n \"taxDetails\": [\n {\n \"amount\": 34.56,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"type\": \"tax\"\n }\n ],\n \"type\": \"WEB_PICKUP\",\n \"uom\": \"EA\"\n }\n ],\n \"orderNumber\": \"217088603\",\n \"orderExternalId\": 217088603,\n \"orderSubtype\": \"INTERNATIONAL\",\n \"orderType\": \"WEB\",\n \"orderedAt\": \"2022-05-12T09:30:31.198Z\",\n \"payments\": [\n {\n \"attributes\": {},\n \"authorizedAmount\": 256.1,\n \"authorizedAmountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"conversion\": 1,\n \"currency\": \"USD\",\n \"paidAt\": \"2022-01-27T16:15:58.000-05:00\",\n \"paymentCounter\": 1,\n \"paymentIdentifier\": {\n \"cardIdentifier\": \"***********3456\"\n },\n \"paymentMethod\": \"CREDIT_CARD\",\n \"paymentProvider\": \"stripe\",\n \"paymentStatus\": \"PAID\",\n \"paymentToken\": {\n \"token\": \"pi_34tr6787rt\"\n },\n \"paymentType\": \"VISA\",\n \"settlement\": {\n \"settledAt\": \"2022-01-27T21:15:58Z\",\n \"settlementAmount\": 10.3,\n \"settlementAmountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"settlementStatusCode\": \"SETTLED\"\n }\n }\n ],\n \"returns\": [\n {\n \"attributes\": {\n \"transactionId\": \"0R12TQ46\"\n },\n \"fees\": [\n {\n \"amount\": 34.56,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"name\": \"RETURN_FEE\",\n \"reason\": \"Return fee\",\n \"type\": \"FEE\"\n }\n ],\n \"invoicedAmount\": 11.29,\n \"invoicedAmountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"paymentCounterRefundDetails\": [\n {\n \"amount\": 34.56,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"paymentCounter\": 1\n }\n ],\n \"refunds\": [\n {\n \"amount\": 34.56,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"name\": \"RETURN_FEE\",\n \"reason\": \"Return fee\",\n \"type\": \"FEE\"\n }\n ],\n \"returnCounter\": 1,\n \"totalRefundAmount\": 11.29,\n \"totalRefundAmountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ]\n }\n ],\n \"taxDetails\": [\n {\n \"amount\": 34.56,\n \"amountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"type\": \"tax\"\n }\n ]\n }\n ],\n \"locationNumber\": 3235,\n \"location\": {\n \"locationNumber\": \"WH334\"\n },\n \"retail\": {\n \"cashierId\": \"CE-321\",\n \"locationNumber\": \"WH334\"\n },\n \"invoiceTotalInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\n \"totalTaxAmountInCurrencies\": [\n {\n \"currency\": \"USD\",\n \"group\": \"SHOPPER\",\n \"amount\": 123.45\n }\n ],\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 \"attributes\": {\n \"attribute1\": \"value\"\n }\n}"
response = http.request(request)
puts response.read_body
201
400
401
500
{
"channelId": "10",
"currency": "USD",
"invoiceId": "62ff5c0bec0aed3c86202c32",
"invoiceTotal": 245.7,
"shipmentId": "62ff5c0bec0aed3c86202c32",
"statusCode": "CREATED",
"totalTaxAmount": 19.57,
"version": 2,
"acknowledgedAt": "2022-08-01T20:03:28.483Z",
"auditLogs": [\
{\
"amount": 2.4,\
"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"\
}\
]\
}\
],
"createdAt": "2022-08-01T20:03:28.483Z",
"customer": {
"accountId": "62272e917b12209e68751d94",
"address": {
"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"
}
},
"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"
},
"invoiceExternalId": "191763090",
"invoiceNumber": "23940791",
"invoiceStatus": "CAPTURED",
"invoiceTotalInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
],
"invoiceType": "SHIPPING",
"invoicedAt": "2022-08-01T20:03:28.483Z",
"location": {
"address": {
"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",
"contacts": [\
{\
"email": "test@example.com",\
"name": {\
"firstName": "Alex",\
"lastName": "Doe",\
"middleName": "E"\
},\
"phone": {\
"number": "123-456-7890",\
"type": "MOBILE"\
}\
}\
],
"email": "test@example.com",
"name": {
"firstName": "Alex",
"lastName": "Doe",
"middleName": "E"
},
"phone": {
"number": "123-456-7890",
"type": "MOBILE"
}
},
"locationNumber": "WH334"
},
"locationNumber": "WH334",
"orders": [\
{\
"invoiceOrderTotal": 245.7,\
"orderId": "62ff5c0bec0aed3c86202c32",\
"adjustments": [\
{\
"adjustmentCounter": 1,\
"amount": 34.56,\
"amountInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
],\
"attributes": {},\
"notes": "Any additional info",\
"quantity": 1,\
"reasonCode": "Incorrect Item",\
"subReasonCode": "Late shipping",\
"value": 34.56\
}\
],\
"appeasements": [\
{\
"amount": 34.56,\
"amountInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
],\
"appeasementCounter": 1,\
"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",\
"subReasonCode": "Late shipping"\
}\
],\
"discounts": [\
{\
"promotionId": "HNY2022",\
"amount": 2,\
"amountInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
],\
"promotionCode": "HNY2022",\
"promotionName": "Happy New Year",\
"quantity": 2,\
"type": "promotion"\
}\
],\
"fees": [\
{\
"amount": 34.56,\
"amountInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
],\
"quantity": 1,\
"refundAmount": 345.56,\
"refundAmountInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
],\
"type": "tax"\
}\
],\
"items": [\
{\
"invoiceLineNumber": 3,\
"adjustmentTotal": 123.45,\
"adjustmentTotalInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
],\
"adjustments": [\
{\
"adjustmentCounter": 1,\
"amount": 34.56,\
"amountInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
],\
"attributes": {},\
"notes": "Any additional info",\
"quantity": 1,\
"reasonCode": "Incorrect Item",\
"subReasonCode": "Late shipping",\
"value": 34.56\
}\
],\
"appeasements": [\
{\
"amount": 34.56,\
"amountInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
],\
"appeasementCounter": 1,\
"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",\
"subReasonCode": "Late shipping"\
}\
],\
"attributes": {\
"key": "value"\
},\
"cancellations": [\
{\
"cancellationCounter": 1,\
"source": "CSR",\
"reasonCode": "Order Line Cancel",\
"subReasonCode": "Late shipping",\
"status": "PROCESSING",\
"amount": "-20.",\
"amountInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
],\
"invoicedAmount": "-20.",\
"invoicedAmountInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
],\
"payments": [\
{\
"paymentCounter": 1,\
"amount": "-20.",\
"amountInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
]\
}\
],\
"refunds": [\
{\
"type": "ITEM",\
"name": "Name",\
"amount": "-10.",\
"amountInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
]\
}\
],\
"attributes": {\
"number": "XlQZTmFDFtPFGMxJP6oiAqN3vo+qKZ"\
},\
"quantity": 10\
}\
],\
"currency": "USD",\
"discounts": [\
{\
"promotionId": "HNY2022",\
"amount": 2,\
"amountInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
],\
"promotionCode": "HNY2022",\
"promotionName": "Happy New Year",\
"quantity": 2,\
"type": "promotion"\
}\
],\
"fees": [\
{\
"amount": 34.56,\
"amountInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
],\
"quantity": 1,\
"refundAmount": 345.56,\
"refundAmountInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
],\
"type": "tax"\
}\
],\
"invoiceLineTotal": 600,\
"invoiceLineTotalInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
],\
"invoiceQuantity": 10,\
"itemAppeasementTotal": 344.455,\
"itemAppeasementTotalInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
],\
"itemCancelTotal": 344.455,\
"itemCancelTotalInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
],\
"itemDiscountsTotal": 3.45,\
"itemDiscountsTotalInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
],\
"itemFeeTotal": 33.4,\
"itemFeeTotalInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
],\
"itemId": 1234455322,\
"itemTaxTotal": 2.4,\
"itemTaxTotalInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
],\
"itemUnitPrice": 33.4,\
"itemUnitPriceInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
],\
"lineItemCreatedAt": "2022-11-22T10:26:38.000+00:00",\
"lineItemId": "1adfrghhh2346aaaf",\
"lineItemNumber": 1,\
"locationStoreId": 4512345,\
"orderId": "33adfrghhh2346aaaffff",\
"returnExpirationDays": 21,\
"returns": [\
{\
"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,\
"invoicedAmountInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
],\
"isExchangeItemReturned": true,\
"reasonCode": "Incorrect item",\
"refundAmount": 11.29,\
"refundAmountInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
],\
"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\
}\
],\
"shipToId": "5349b4ddd2781d08c09890f4",\
"shipmentLineItemId": "2adfrghhh2346aaaffff",\
"sku": "P1234",\
"taxDetails": [\
{\
"amount": 34.56,\
"amountInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
],\
"type": "tax"\
}\
],\
"type": "WEB_PICKUP",\
"uom": "EA"\
}\
],\
"orderNumber": "217088603",\
"orderExternalId": 217088603,\
"orderSubtype": "INTERNATIONAL",\
"orderType": "WEB",\
"orderedAt": "2022-05-12T09:30:31.198Z",\
"payments": [\
{\
"attributes": {},\
"authorizedAmount": 256.1,\
"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"\
}\
},\
"conversion": 1,\
"currency": "USD",\
"paidAt": "2022-01-27T16:15:58.000-05:00",\
"paymentCounter": 1,\
"paymentIdentifier": {\
"cardIdentifier": "***********3456"\
},\
"paymentMethod": "CREDIT_CARD",\
"paymentProvider": "stripe",\
"paymentStatus": "PAID",\
"paymentToken": {\
"token": "pi_34tr6787rt"\
},\
"paymentType": "VISA",\
"settlement": {\
"settledAt": "2022-01-27T21:15:58Z",\
"settlementAmount": 10.3,\
"settlementAmountInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
],\
"settlementStatusCode": "SETTLED"\
}\
}\
],\
"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\
}\
]\
}\
],\
"taxDetails": [\
{\
"amount": 34.56,\
"amountInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
],\
"type": "tax"\
}\
]\
}\
],
"postedAt": "2022-08-01T20:03:28.483971941Z",
"retail": {
"cashierId": "CE-321",
"locationNumber": "WH334"
},
"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",
"fulfillmentZoneName": "US_LOCATIONS",
"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"\
}\
]
},
"shipmentNumber": "217088603",
"shippedAt": "2022-08-01T20:03:28.483Z",
"totalTaxAmountInCurrencies": [\
{\
"currency": "USD",\
"group": "SHOPPER",\
"amount": 123.45\
}\
],
"updatedAt": "2022-08-01T20:03:28.483971941Z"
}
{
"type": "CLIENT_ERROR",
"errorCode": "SERVICE-4003",
"message": "Mandatory param(s): `requiredField1` is/are missing",
"errors": [\
{\
"type": "CLIENT_ERROR",\
"errorCode": "SERVICE-4002",\
"message": "Invalid value(s) specified for 'requiredField.field3'",\
"errors": []\
}\
],
"context": {
"service": "orders",
"endpoint": "POST /v3/orders"
}
}
{
"type": "CLIENT_ERROR",
"errorCode": "SERVICE-4001",
"message": "Unauthorized request",
"errors": [],
"context": {
"service": "orders",
"endpoint": "POST /v3/orders/OrderId_12345"
}
}
{
"type": "SERVER_ERROR",
"errorCode": "SERVICE-5000",
"message": "Internal server error",
"errors": [],
"context": {
"service": "inventories",
"endpoint": "POST /v3/inventories/actions/find-by-geography"
}
}
POST
/
invoices
Try it
Create invoice
cURL
import requests
url = "https://api.fabric.inc/v3/invoices"
response = requests.post(url, json=payload, headers=headers)
print(response.text)
fetch('https://api.fabric.inc/v3/invoices', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err));
`, where `