Retrieve products by criteria

POST /catalog/product/find/

Finds products based on specified criteria.

application/json

Body

Criteria for filtering and sorting products.

  • sort object

    Sorting options for the search results.

    Additional properties are allowed.

    Hide sort attributes Show sort attributes object
    • price string

      Order by price.

      Values are asc or desc.

    • quantity string

      Order by quantity.

      Values are asc or desc.

    • Order by update date.

      Values are asc or desc.

  • filters object

    Filtering options.

    Additional properties are allowed.

    Hide filters attributes Show filters attributes object
    • is_simple array[boolean]

      Filter by is_simple: yes|no

      At least 1 but not more than 1 element.

    • price object

      Filter by price range.

      Additional properties are allowed.

      Hide price attributes Show price attributes object
    • quantity object

      Filter by quantity range.

      Additional properties are allowed.

      Hide quantity attributes Show quantity attributes object
    • status array[integer]

      Product statuses (e.g., 1 = Active, 2 = Inactive, 3 = Disabled, 4 = Preorder, 5 = Available, 7 = Draft, 8 = Pending, 9 = Private, 10 = Publish, 11 = Archived).

      Values are 1, 2, 3, 4, 5, 7, 8, 9, 10, or 11.

    • sku array[string]

      Stock Keeping Unit (SKU) of the item.

  • _result object

    Additional properties are allowed.

    Hide _result attribute Show _result attribute object
    • limit object Required

      Additional properties are allowed.

      Hide limit attributes Show limit attributes object
      • offset integer Required

        Minimum value is 0.

      • count integer Required

        Minimum value is 1, maximum value is 100.

Responses

  • 200 application/json

    Products retrieved successfully.

    Hide headers attributes Show headers attributes
    Hide response attributes Show response attributes object
    • list array[object] Required

      A list of orders matching the query.

      Hide list attributes Show list attributes object
      • token string(uuid) Required

        A unique token that identifies the product.

      • external_id null | string Required

        An external identifier for the product, typically used for mapping with external systems.

      • sku null | string Required

        Stock Keeping Unit (SKU).

      • quantity integer Required

        The available stock quantity for the variant.

        Minimum value is 0, maximum value is 1000000.

      • is_simple boolean Required

        Indicates whether the product is a simple product (true) or has variants (false).

      • status string Required

        The current status of the product.

        Values are Active, Inactive, Disabled, Preorder, Available, Draft, Pending, Private, Publish, or Archive.

      • title string Required

        The name or title of the product.

      • images array[string(url)] Required

        A list of image URLs representing the product.

      • attributes array[object] Required

        A list of key-value pairs representing attributes.

        Hide attributes attributes Show attributes attributes object
        • name string Required

          The name of the attribute (e.g., material, size, color).

        • value string Required

          The value of the attribute corresponding to its name (e.g., cotton, red, large).

      • update_date string(date-time) Required

        The date and time when the product was last updated, in ISO 8601 format.

      • variants array[object] Required

        A list of product variants.

        Hide variants attributes Show variants attributes object
        • token string(uuid) Required

          A unique token identifying the product variant.

        • sku null | string Required

          Stock Keeping Unit (SKU).

        • barcode null | string Required

          The unique barcode for the variant, such as UPC or EAN.

        • price number Required

          The price of the variant in the specified currency.

          Minimum value is 0, maximum value is 1000000.0.

        • quantity integer Required

          The available stock quantity for the variant.

          Minimum value is 0, maximum value is 1000000.

        • images array[string(url)] Required

          A list of image URLs representing the product variant.

        • options array[object] Required

          A list of options specifying attributes of the variant (e.g., size, color).

          Hide options attributes Show options attributes object
          • name string Required

            The name of the option.

          • value string Required

            The value of the option.

        • attributes array[object] Required

          A list of key-value pairs representing attributes.

          Hide attributes attributes Show attributes attributes object
          • name string Required

            The name of the attribute (e.g., material, size, color).

          • value string Required

            The value of the attribute corresponding to its name (e.g., cotton, red, large).

        • weight null | number Required

          The weight of the product variant.

          Minimum value is 0.

        • weight_unit null | string Required

          The unit of measurement for the weight.

          Values are GRAMS, KILOGRAMS, OUNCES, POUNDS, or TONNES.

        • height null | number Required

          The height of the product variant.

          Minimum value is 0.

        • depth null | number Required

          The depth of the product variant.

          Minimum value is 0.

        • width null | number Required

          The width of the product variant.

          Minimum value is 0.

        • dimension_unit null | string Required

          The unit of measurement for dimensions (height, width, depth).

          Values are MILLILITERS, CENTILITERS, DECIMETERS, METERS, INCHES, YARD, or FEET.

        • update_date string(date-time) Required

          The date and time when the variant was last updated, in ISO 8601 format.

    • total integer Required

      The total number of products matching the query.

  • 400 application/json

    Bad request

    Hide headers attributes Show headers attributes
    Hide response attributes Show response attributes object
    • code string Required

      An error code that identifies the type of error that occurred.

    • message string Required

      A message that describes the error condition in a human-readable form.

    • data object | array Required

      Additional information that can help the caller understand or fix the issue.

  • 404 application/json

    Not found

    Hide response attributes Show response attributes object
    • code string Required

      An error code that identifies the type of error that occurred.

    • message string Required

      A message that describes the error condition in a human-readable form.

    • data object | array Required

      Additional information that can help the caller understand or fix the issue.

  • 401 application/json

    Unauthorized

    Hide response attributes Show response attributes object
    • code string Required

      An error code that identifies the type of error that occurred.

    • message string Required

      A message that describes the error condition in a human-readable form.

    • data object | array Required

      Additional information that can help the caller understand or fix the issue.

  • 429 application/json

    Too many requests

    Hide headers attributes Show headers attributes
    Hide response attributes Show response attributes object
    • code string Required

      An error code that identifies the type of error that occurred.

    • message string Required

      A message that describes the error condition in a human-readable form.

    • data object | array Required

      Additional information that can help the caller understand or fix the issue.

  • 500 application/json

    Internal server error

    Hide response attributes Show response attributes object
    • code string Required

      An error code that identifies the type of error that occurred.

    • message string Required

      A message that describes the error condition in a human-readable form.

    • data object | array Required

      Additional information that can help the caller understand or fix the issue.

POST /catalog/product/find/
curl \
 -X POST https://m2e.cloud/api/v1/api/catalog/product/find/ \
 -H "Content-Type: application/json" \
 -d '{"sort":{"quantity":"desc"},"_result":{"limit":{"count":10,"offset":0}},"filters":{"status":[1],"quantity":{"to":12,"from":10}}}'
Request example
{
  "sort": {
    "quantity": "desc"
  },
  "_result": {
    "limit": {
      "count": 10,
      "offset": 0
    }
  },
  "filters": {
    "status": [
      1
    ],
    "quantity": {
      "to": 12,
      "from": 10
    }
  }
}
Response examples (200)
# Headers
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 90
X-RateLimit-Retry-After: 2022-11-04T13:43:28Z

# Payload
{
  "list": [
    {
      "token": "1529970e-7508-489f-8a79-281225ee330e",
      "external_id": "0011-0022-11",
      "sku": "WBH-12345",
      "quantity": 100,
      "is_simple": false,
      "status": "Active",
      "title": "Wireless Bluetooth Headphones",
      "images": [
        "https://example.com/image1.jpg"
      ],
      "attributes": [
        {
          "name": "material",
          "value": "cotton"
        }
      ],
      "update_date": "2020-12-30T15:30:50Z",
      "variants": [
        {
          "token": "1529970e-7508-489f-8a79-281225ee330e",
          "sku": "WBH-12345",
          "barcode": "012345678905",
          "price": 79.99,
          "quantity": 100,
          "images": [
            "https://example.com/variant-image1.jpg"
          ],
          "options": [
            {
              "name": "Size",
              "value": "Medium"
            }
          ],
          "attributes": [
            {
              "name": "material",
              "value": "cotton"
            }
          ],
          "weight": 0.5,
          "weight_unit": "GRAMS",
          "height": 10.0,
          "depth": 5.0,
          "width": 8.0,
          "dimension_unit": "CENTILITERS",
          "update_date": "2020-12-30T15:30:50Z"
        }
      ]
    }
  ],
  "total": 1
}
Response examples (400)
[
  {
    "code": null,
    "message": "All array items must match schema"
  },
  {
    "code": null,
    "message": "The required properties (currency) are missing"
  }
]
Response examples (404)
[
  {
    "code": 404,
    "message": "Entity is not found."
  }
]
Response examples (401)
[
  {
    "code": 401,
    "message": "Unauthorized"
  }
]
Response examples (429)
[
  {
    "code": 429,
    "message": "Too many requests."
  }
]
Response examples (500)
[
  {
    "code": 500,
    "message": "Internal server error."
  }
]