Skip to main content

Getting a List of Products in Mailship

Learn to retrieve, sort, filter, and paginate product lists in Mailship via POST requests to API. Customize requests to suit your needs.

Updated over a year ago

To retrieve a list of products in Mailship, you can send a POST request to the https://app.mailship.eu/api/product/list endpoint. This endpoint allows you to apply sorting, filtering, and pagination to the product list.

You can filter products based on various criteria, such as ID, SKU, name, type, weight, and more. Sorting and pagination options are available, and you can select specific fields to include in the response.

  • id: Filter by the product ID using operators such as eq (equal), neq (not equal), null (null value), in (value in array), and nin (value not in array).

  • productSku: Filter by the product SKU using similar operators as above.

  • internalSku: Filter by the internal SKU.

  • name: Filter by the product name.

  • type: Filter by the product type.

  • weight, height, width, length: Filter by the corresponding dimensions using operators such as eq (equal), neq (not equal), null (null value), gt (greater than), gte (greater than or equal to), lt (less than), and lte (less than or equal to).

  • referenceNumbers: Filter by reference numbers associated with the product.

  • packagingType: Filter by the packaging type.

Request Body

The request body should include parameters for sorting, filtering, and pagination. Here's an example request body:

Sorting

You can sort the products based on different fields such as name, SKU, or weight. Specify the sorting criteria in the sort parameter of the request body.

Filtering

Filtering allows you to narrow down the list of products based on specific criteria. For example, you can filter by category, active status, or any other field available in the product data. Specify the filter criteria in the filter parameter of the request body.

Pagination

To retrieve the products in chunks, you can use pagination. The pagination parameter in the request body allows you to specify the limit (number of items per page) and the offset (starting index) for the pagination.

Examples and Common Scenarios

Here are some examples of using the API for common scenarios:

  1. Retrieve all active products:

    {
    "filter": {
    "active": true
    },
    "pagination": {
    "limit": 50,
    "offset": 0
    }
    }

  2. Retrieve products sorted by name in descending order:

    {
    "sort": [
    {
    "field": "name",
    "direction": "desc"
    }
    ],
    "pagination": {
    "limit": 20,
    "offset": 0
    }
    }

  3. Retrieve products in a specific category:

    {
    "filter": {
    "category": "clothing"
    },
    "pagination": {
    "limit": 10,
    "offset": 0
    }
    }

Feel free to customize the request body based on your specific needs and criteria.

For more information and detailed API documentation, refer to the API reference.
​
​


​

Did this answer your question?