Skip to main content
POST
/
invoices
Create invoice
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",
              "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": "[email protected]",
            "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"
        }
      ]
    }
  ],
  "locationNumber": 3235,
  "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": "[email protected]",
          "name": {
            "firstName": "Alex",
            "lastName": "Doe",
            "middleName": "E"
          },
          "phone": {
            "number": "123-456-7890",
            "type": "MOBILE"
          }
        }
      ],
      "email": "[email protected]",
      "name": {
        "firstName": "Alex",
        "lastName": "Doe",
        "middleName": "E"
      },
      "phone": {
        "number": "123-456-7890",
        "type": "MOBILE"
      }
    },
    "locationNumber": "WH334"
  },
  "retail": {
    "cashierId": "CE-321",
    "locationNumber": "WH334"
  },
  "invoiceTotalInCurrencies": [
    {
      "currency": "USD",
      "group": "SHOPPER",
      "amount": 123.45
    }
  ],
  "totalTaxAmountInCurrencies": [
    {
      "currency": "USD",
      "group": "SHOPPER",
      "amount": 123.45
    }
  ],
  "currencies": {
    "primaryGroup": "SHOPPER",
    "groups": [
      {
        "currency": "USD",
        "group": "SHOPPER",
        "conversionRate": 1,
        "attributes": {
          "fxId": "ID123"
        }
      }
    ]
  },
  "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": "[email protected]",
      "name": {
        "firstName": "Alex",
        "lastName": "Doe",
        "middleName": "E"
      },
      "phone": {
        "number": "123-456-7890",
        "type": "MOBILE"
      }
    },
    "company": "Demo Inc",
    "email": "[email protected]",
    "employeeId": "62272e917b12209e68751d94",
    "name": {
      "firstName": "Alex",
      "lastName": "Doe",
      "middleName": "E"
    },
    "phone": {
      "number": "123-456-7890",
      "type": "MOBILE"
    },
    "userId": "62272e917b12209e68751d94"
  },
  "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": "[email protected]",
        "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": "[email protected]",
      "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"
      }
    ]
  },
  "attributes": {
    "attribute1": "value"
  }
}
'
{
  "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": "[email protected]",
      "name": {
        "firstName": "Alex",
        "lastName": "Doe",
        "middleName": "E"
      },
      "phone": {
        "number": "123-456-7890",
        "type": "MOBILE"
      }
    },
    "company": "Demo Inc",
    "email": "[email protected]",
    "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": "[email protected]",
          "name": {
            "firstName": "Alex",
            "lastName": "Doe",
            "middleName": "E"
          },
          "phone": {
            "number": "123-456-7890",
            "type": "MOBILE"
          }
        }
      ],
      "email": "[email protected]",
      "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": "[email protected]",
            "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": "[email protected]",
        "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": "[email protected]",
      "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"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

x-fabric-tenant-id
string
required

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
string
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.

x-fabric-request-id
string

Unique request ID

Body

application/json

Create Invoice Request

invoiceNumber
string
required

Merchant-defined unique invoice number. If omitted, this is generated by fabric’s sequence generator using Configuration service.

Example:

23940791

shipmentId
string
required

24-character system-generated shipment ID for which invoice is generated

Example:

"62ff5c0bec0aed3c86202c32"

channelId
string
required

Sales channel ID

Example:

10

invoiceTotal
number<double>
required

Total invoiced amount captured for the order

Example:

245.7

totalTaxAmount
number<double>
required

Total tax amount invoiced

Example:

245.7

currency
string
required

Currency type in which amount is invoiced

Example:

"USD"

requestContext
object

Request reference context information

invoiceExternalId
string

Merchant-defined external optional order identifier

Example:

191763090

invoiceStatus
enum<string>

Current invoice status

Available options:
PENDING,
CAPTURED,
SETTLED,
SETTLE_FAILED,
PARTIAL_SETTLED,
APPROVED,
REJECTED,
CREATED
Example:

"CAPTURED"

invoiceType
string

Invoice type

Example:

"SHIPPING"

invoicedAt
string<date-time>

System-generated invoice creation time (UTC)

Example:

"2022-08-01T20:03:28.483Z"

shipmentNumber
string

Merchant-specified shipment number for which invoice is generated

Example:

217088603

shippedAt
string<date-time>

Order shipment time (UTC)

Example:

"2022-08-01T20:03:28.483Z"

orders
object[]
locationNumber
string

Unique value to identify ship-from location. This must be the locationNumber stored in the fabric Location service.

Example:

3235

location
object

Location in case of invoice type as shipment

retail
object

Optional field retail details

invoiceTotalInCurrencies
object[]
totalTaxAmountInCurrencies
object[]
currencies
object

Customer-defined currency groups supported for order

customer
object

Customer details

shipInfo
object

Shipment information

attributes
object

Customized attributes to save any additional info

Example:
{ "attribute1": "value" }

Response

Created

The invoice response model.

channelId
string
required

This is the sales channel ID.

Example:

"10"

currency
string
required

This is the ISO 4217 currency code for invoiced amounts.

Example:

"USD"

invoiceId
string
required

This is the system-generated unique invoice ID.

Example:

"62ff5c0bec0aed3c86202c32"

invoiceTotal
number<double>
required

This is the total invoiced amount captured for the order.

Example:

245.7

shipmentId
string
required

This is the 24-character system-generated shipment ID. The invoice is created against this shipment.

Example:

"62ff5c0bec0aed3c86202c32"

statusCode
enum<string>
required

This field indicates the current invoice processing status. CREATED — The invoice was generated by fabric. POSTED — The Invoice service sent a notification to the webhook service. ACKNOWLEDGED — The merchant acknowledged the invoice successfully.

Available options:
CREATED,
POSTED,
ACKNOWLEDGED
Example:

"CREATED"

totalTaxAmount
number<double>
required

This is the total tax amount included in the invoice.

Example:

19.57

version
integer<int64>
required

This field indicates the current version of the invoice document. The number increases each time the invoice is updated.

Example:

2

acknowledgedAt
string<date-time>

This is the timestamp of when the merchant acknowledged the invoice in UTC.

Example:

"2022-08-01T20:03:28.483Z"

auditLogs
object[]

This array contains audit logs that track invoice lifecycle events.

createdAt
string<date-time>

This is the timestamp of when the invoice was created in UTC.

Example:

"2022-08-01T20:03:28.483Z"

customer
object

This object contains customer details.

invoiceExternalId
string

This is an optional identifier assigned to the invoice by the merchant.

Example:

"191763090"

invoiceNumber
string

This is a merchant-defined unique invoice number. If omitted, fabric generates one using the Configuration service’s sequence generator.

Example:

"23940791"

invoiceStatus
enum<string>

This field shows the system-generated invoice status. CAPTURED — The authorizedAmount was successfully captured. SETTLED — The authorizedAmount was successfully settled with the customer. This may mean the amount was fully paid or refunded in case of returns. SETTLE_FAILED — The settlement of the authorizedAmount failed. PARTIAL_SETTLED — Only part of the authorizedAmount was settled.

Available options:
CAPTURED,
SETTLED,
SETTLE_FAILED,
PARTIAL_SETTLED
Example:

"CAPTURED"

invoiceTotalInCurrencies
object[]

The total invoiced amount represented in one or more currencies.
Each entry specifies the total value and its corresponding currency code,
following the structure defined in the amountInCurrencyResource schema.

invoiceType
enum<string>

This field specifies the system-updated invoice type. RETURN — Created for order returns. SHIPPING — Created when items are shipped. APPEASEMENT — Created for customer appeasements. ORDER_DONATION — Created when an order is donated. ORDER_CARRY — Created for Cash & Carry orders. EXCHANGE — Created for order exchanges.

Available options:
RETURN,
SHIPPING,
APPEASEMENT,
ORDER_DONATION,
ORDER_CARRY,
EXCHANGE
Example:

"SHIPPING"

invoicedAt
string<date-time>

This is the system-generated timestamp of when the invoice was created in UTC.

Example:

"2022-08-01T20:03:28.483Z"

location
object

This object contains location details.

locationNumber
string

This is the unique identifier of the ship-from location. The value must match the locationNumber stored in the fabric Location service.

Example:

"WH334"

orders
object[]

This array contains the invoice order details.

postedAt
string<date-time>

This is the timestamp of when the invoice was sent to a third-party system for financial processing in UTC.

Example:

"2022-08-01T20:03:28.483971941Z"

retail
object

This object contains optional retail details.

shipInfo
object

This object contains shipment information.

shipmentNumber
string

This is the merchant-specified shipment number. The invoice is created against this shipment.

Example:

"217088603"

shippedAt
string<date-time>

This is the timestamp of when the order was shipped in UTC.

Example:

"2022-08-01T20:03:28.483Z"

totalTaxAmountInCurrencies
object[]

The total tax amount invoiced represented in one or more currencies.
Each entry includes the tax value and its corresponding currency code,
following the structure defined in the amountInCurrencyResource schema.

updatedAt
string<date-time>

This is the timestamp of when the invoice was last updated in UTC.

Example:

"2022-08-01T20:03:28.483971941Z"