POST
/
invoices
/
search
curl --request POST \
  --url https://api.fabric.inc/v3/invoices/search \
  --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 '{
  "filters": [
    {
      "condition": "EQ",
      "field": "invoice.orders.orderNumber",
      "value": "30490384"
    },
    {
      "condition": "IN",
      "field": "invoice.invoiceType",
      "values": [
        "RETURN",
        "SHIPMENT"
      ]
    }
  ],
  "sort": "-invoice.invoicedAt"
}'
{
  "data": [
    {
      "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"
            }
          ]
        }
      ],
      "channelId": "10",
      "createdAt": "2022-08-01T20:03:28.483Z",
      "currency": "USD",
      "customer": {
        "accountId": "62272e917b12209e68751d94",
        "address": {
          "addressLine1": "123 Main St.",
          "addressLine2": "Suite 100",
          "addressLine3": "Seventh floor",
          "addressLine4": "Attention: Pat E. Kake",
          "city": "Seattle",
          "countryCode": "US",
          "email": "test@example.com",
          "latitude": 47.6205,
          "longitude": -122.3493,
          "name": {
            "firstName": "Alex",
            "lastName": "Doe",
            "middleName": "E"
          },
          "phone": {
            "number": "123-456-7890",
            "type": "MOBILE"
          },
          "postalCode": "98121",
          "region": "WA",
          "type": "Home"
        },
        "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"
      },
      "invoiceId": "62ff5c0bec0aed3c86202c32",
      "invoiceNumber": "23940791",
      "invoiceStatus": "CAPTURED",
      "invoiceTotal": 245.7,
      "invoiceType": "SHIPPING",
      "invoicedAt": "2022-08-01T20:03:28.483Z",
      "location": {
        "address": {
          "addressLine1": "123 Main St.",
          "addressLine2": "Suite 100",
          "addressLine3": "Seventh floor",
          "addressLine4": "Attention: Pat E. Kake",
          "city": "Seattle",
          "contacts": [
            {
              "email": "test@example.com",
              "name": {
                "firstName": "Alex",
                "lastName": "Doe",
                "middleName": "E"
              },
              "phone": {
                "number": "123-456-7890",
                "type": "MOBILE"
              }
            }
          ],
          "countryCode": "US",
          "email": "test@example.com",
          "latitude": 47.6205,
          "longitude": -122.3493,
          "name": {
            "firstName": "Alex",
            "lastName": "Doe",
            "middleName": "E"
          },
          "phone": {
            "number": "123-456-7890",
            "type": "MOBILE"
          },
          "postalCode": "98121",
          "region": "WA",
          "type": "Home"
        },
        "locationNumber": "3235"
      },
      "locationNumber": "3235",
      "orders": [
        {
          "adjustments": [
            {
              "adjustmentCounter": 1,
              "attributes": {},
              "notes": "Any additional info",
              "quantity": 1,
              "reasonCode": "Incorrect Item",
              "subReasonCode": "Late shipping",
              "value": 34.56
            }
          ],
          "appeasements": [
            {
              "amount": 34.56,
              "appeasementCounter": 1,
              "invoicedAmount": 34.56,
              "payments": [
                {
                  "paymentCounter": 1,
                  "refundAmount": 34.56
                }
              ],
              "reasonCode": "Incorrect Item",
              "subReasonCode": "Late shipping"
            }
          ],
          "discounts": [
            {
              "amount": 2,
              "promotionCode": "HNY2022",
              "promotionId": "HNY2022",
              "promotionName": "Happy New Year",
              "quantity": 2,
              "type": "promotion"
            }
          ],
          "fees": [
            {
              "amount": 34.56,
              "quantity": 1,
              "refundAmount": 345.56,
              "type": "tax"
            }
          ],
          "invoiceOrderTotal": 245.7,
          "items": [
            {
              "adjustmentTotal": 123.45,
              "adjustments": [
                {
                  "adjustmentCounter": 1,
                  "attributes": {},
                  "notes": "Any additional info",
                  "quantity": 1,
                  "reasonCode": "Incorrect Item",
                  "subReasonCode": "Late shipping",
                  "value": 34.56
                }
              ],
              "appeasements": [
                {
                  "amount": 34.56,
                  "appeasementCounter": 1,
                  "invoicedAmount": 34.56,
                  "payments": [
                    {
                      "paymentCounter": 1,
                      "refundAmount": 34.56
                    }
                  ],
                  "reasonCode": "Incorrect Item",
                  "subReasonCode": "Late shipping"
                }
              ],
              "currency": "USD",
              "discounts": [
                {
                  "amount": 2,
                  "promotionCode": "HNY2022",
                  "promotionId": "HNY2022",
                  "promotionName": "Happy New Year",
                  "quantity": 2,
                  "type": "promotion"
                }
              ],
              "fees": [
                {
                  "amount": 34.56,
                  "quantity": 1,
                  "refundAmount": 345.56,
                  "type": "tax"
                }
              ],
              "invoiceLineNumber": 3,
              "invoiceLineTotal": 600,
              "invoiceQuantity": 10,
              "itemAppeasementTotal": 344.455,
              "itemDiscountsTotal": 3.45,
              "itemFeeTotal": 33.4,
              "itemId": 1234455322,
              "itemTaxTotal": 2.4,
              "itemUnitPrice": 33.4,
              "lineItemCreatedAt": "2022-11-22T10:26:38Z",
              "lineItemId": "1adfrghhh2346aaaf",
              "lineItemNumber": 1,
              "locationStoreId": "4512345",
              "orderId": "33adfrghhh2346aaaffff",
              "returnExpirationDays": "21",
              "returns": [
                {
                  "exchangeLineItemId": "62f3dfc438bcab1951be0a19",
                  "fees": [
                    {
                      "amount": 34.56,
                      "name": "RETURN_FEE",
                      "reason": "Return fee",
                      "type": "FEE"
                    }
                  ],
                  "invoicedAmount": 11.29,
                  "isExchangeItemReturned": true,
                  "reasonCode": "Incorrect item",
                  "refundAmount": 11.29,
                  "refunds": [
                    {
                      "amount": 34.56,
                      "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,
                  "type": "tax"
                }
              ],
              "type": "WEB_PICKUP",
              "uom": "EA"
            }
          ],
          "orderId": "62ff5c0bec0aed3c86202c32",
          "orderNumber": "217088603",
          "orderSubtype": "INTERNATIONAL",
          "orderType": "WEB",
          "orderedAt": "2022-05-12T09:30:31.198Z",
          "payments": [
            {
              "attributes": {},
              "authorizedAmount": 256.1,
              "billToAddress": {
                "addressLine1": "123 Main St.",
                "addressLine2": "Suite 100",
                "addressLine3": "Seventh floor",
                "addressLine4": "Attention: Pat E. Kake",
                "city": "Seattle",
                "countryCode": "US",
                "email": "test@example.com",
                "latitude": 47.6205,
                "longitude": -122.3493,
                "name": {
                  "firstName": "Alex",
                  "lastName": "Doe",
                  "middleName": "E"
                },
                "phone": {
                  "number": "123-456-7890",
                  "type": "MOBILE"
                },
                "postalCode": "98121",
                "region": "WA",
                "type": "Home"
              },
              "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,
                "settlementStatusCode": "SETTLED"
              }
            }
          ],
          "returns": [
            {
              "fees": [
                {
                  "amount": 34.56,
                  "name": "RETURN_FEE",
                  "reason": "Return fee",
                  "type": "FEE"
                }
              ],
              "invoicedAmount": 11.29,
              "paymentCounterRefundDetails": [
                {
                  "amount": 34.56,
                  "paymentCounter": 1
                }
              ],
              "refunds": [
                {
                  "amount": 34.56,
                  "name": "RETURN_FEE",
                  "reason": "Return fee",
                  "type": "FEE"
                }
              ],
              "returnCounter": 1,
              "totalRefundAmount": 11.29
            }
          ],
          "taxDetails": [
            {
              "amount": 34.56,
              "type": "tax"
            }
          ]
        }
      ],
      "postedAt": "2022-08-01T20:03:28.483971941Z",
      "retail": {
        "cashierId": "CE-321",
        "locationNumber": 334
      },
      "shipInfo": {
        "discounts": [
          {
            "amount": 2.99,
            "promotionCode": "SHIPFREE",
            "promotionId": "SHIPFREE",
            "promotionName": "Free Shipping",
            "quantity": 1,
            "unit": "AMOUNT_OFF",
            "value": 10
          }
        ],
        "estimatedDeliveryDate": "2022-05-12T09:30:31.198Z",
        "estimatedShipDate": "2022-05-12T09:30:31.198Z",
        "isInvoiced": true,
        "locationNumber": "123",
        "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.",
          "addressLine2": "Suite 100",
          "addressLine3": "Seventh floor",
          "addressLine4": "Attention: Pat E. Kake",
          "city": "Seattle",
          "countryCode": "US",
          "email": "test@example.com",
          "latitude": 47.6205,
          "longitude": -122.3493,
          "name": {
            "firstName": "Alex",
            "lastName": "Doe",
            "middleName": "E"
          },
          "phone": {
            "number": "123-456-7890",
            "type": "MOBILE"
          },
          "postalCode": "98121",
          "region": "WA",
          "type": "Home"
        },
        "shipToDiscount": 12.6,
        "shipToId": "b03b72dc-78d8-4ea4-90fc-2fe6a1fe6569",
        "shipToPrice": 20,
        "shipToTaxTotal": 12.6,
        "shipToType": "SHIP_TO_ADDRESS",
        "shipToUnitPrice": 20,
        "shipmentInstructions": "Handle with care",
        "taxCode": "FR01",
        "taxDetails": [
          {
            "amount": 34.56,
            "attributes": {},
            "currency": "USD",
            "name": "STATE",
            "rate": 10,
            "rateType": "PERCENTAGE",
            "taxCode": "FR01"
          }
        ]
      },
      "shipmentId": "62ff5c0bec0aed3c86202c32",
      "shipmentNumber": "217088603",
      "shippedAt": "2022-08-01T20:03:28.483Z",
      "statusCode": "CREATED",
      "totalTaxAmount": 245.7,
      "updatedAt": "2022-08-01T20:03:28.483971941Z",
      "version": 2
    }
  ],
  "pagination": {
    "count": 1000,
    "limit": 10,
    "offset": 1
  }
}

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

Query Parameters

fetchOnlyIds
boolean
default:false
offset
integer
default:0

Number of records to skip before returning all records. Default is 0 if no value is specified.

Example:

0

limit
integer
default:10

Maximum number of records returned per page. Default is 10 if no value is specified.

Required range: 1 <= x <= 100
Example:

10

Body

application/json

Sort and filter criteria for invoice search

Response

200
application/json
OK

Invoice search response