Skip to main content

Loading Receipts

Loading Receipts: A method for stock synchronization using the Mailship API to post stock movements, ensuring accurate inventory data.

Updated over a year ago

Stock synchronization is a crucial aspect of managing your inventory. It ensures that the data in your system matches the actual physical inventory in your warehouse. Mailship provides two methods for stock synchronization. This article will focus on the first method

Loading Receipts


Loading receipts is a method of stock synchronization that involves using the Mailship API to post stock movements. The endpoint for this operation is http://app.mailship.eu/api/stock-movement/list.

This endpoint accepts a JSON object that specifies the criteria for the stock movements you want to post. The JSON object can include a wide range of parameters, such as the movement type, product SKU, warehouse, and quantity.

{
"criteria": {
"id": {
"eq": "string"
},
"movementType": {
"eq": "string"
},
"ean": {
"eq": "string"
},
"quantity": {
"eq": 0
},
"warehouse": {
"eq": "string"
}
},
"limit": 100,
"offset": 200,
"select": [
"id",
"product",
"movementType",
"warehouse",
"quantity"
]
}

In this example, the criteria object specifies the conditions for the stock movements. The eq field under each parameter is used to specify the exact value that the parameter should match. For instance, "id": {"eq": "string"} would only match stock movements with an ID equal to "string".


The limit field specifies the maximum number of stock movements to return, and the offset field specifies the number of stock movements to skip before starting to return results.


The select array specifies the fields to return for each stock movement. In this example, the returned stock movements will only include the ID, product, movement type, warehouse, and quantity.

Result

The result of the API call is a JSON object that contains information about the stock movements that match the criteria specified in your request.

Here's a breakdown of what each field in the response represents:

  • id: The unique identifier of the stock movement.

  • product: The unique identifier of the product involved in the stock movement.

  • movementType: The type of the stock movement. In this case, "IN" indicates that it's an inbound movement (i.e., stock coming into the warehouse).

  • movementSubType: The subtype of the stock movement. In this case, "new" indicates that it's a new stock.

  • organisation: The unique identifier of the organization that owns the product.

  • warehouse: The unique identifier of the warehouse where the stock movement occurred.

  • wms: The unique identifier of the WMS (Physical Warehouse) used.

  • inboundReceipt: The unique identifier of the inbound receipt associated with the stock movement.

  • outboundReceipt: The unique identifier of the outbound receipt associated with the stock movement.

  • expedition: The unique identifier of the expedition associated with the stock movement.

  • expeditionItem: The unique identifier of the expedition item associated with the stock movement.

  • stockChange: The unique identifier of the stock change associated with the stock movement.

  • stockChangeItem: The unique identifier of the stock change item associated with the stock movement.

  • internalStockChange: The unique identifier of the internal stock change associated with the stock movement.

  • internalStockChangeItem: The unique identifier of the internal stock change item associated with the stock movement.

  • transfer: The unique identifier of the transfer associated with the stock movement.

  • transferItem: The unique identifier of the transfer item associated with the stock movement.

  • ean: The European Article Number (EAN) of the product.

  • serialNumber: The serial number of the product.

  • quantity: The quantity of the product involved in the stock movement.

  • lot: The lot number of the product.

  • lotDate: The date associated with the lot number.

  • warranty: The warranty date of the product.

  • createdAt: The date and time when the stock movement was created.

  • movedAt: The date and time when the stock movement occurred.

  • reported: A boolean value indicating whether the stock movement has been reported.

  • wmsInternalId: The internal ID of the stock movement in the WMS.

  • productProductGroup.id: The unique identifier of the product group that the product belongs to.

  • productProductGroup.name: The name of the product group that the product belongs to.

The paging object at the end of the response provides information about the pagination of the results:

  • returned: The number of results returned in this response.

  • from: The index of the first result in this response.

  • to: The index of the last result in this response.

  • total: The total number of results that match the criteria specified in your request.

Usage Examples

Here are a few examples of how you might use this endpoint:

  1. Retrieve all stock movements for a specific product: You can do this by setting the eq field under product to the SKU of the product.

    {
    "criteria": {
    "product": {
    "eq": "your-product-sku"
    }
    },
    "limit": 100,
    "offset": 0,
    "select": [
    "id",
    "product",
    "movementType",
    "warehouse",
    "quantity"
    ]
    }

  2. Retrieve all stock movements of a certain type: You can do this by setting the eq field under movementType to the type of movement you want to retrieve.

    {
    "criteria": {
    "movementType": {
    "eq": "your-movement-type"
    }
    },
    "limit": 100,
    "offset": 0,
    "select": [
    "id",
    "product",
    "movementType",
    "warehouse",
    "quantity"
    ]
    }

  3. Retrieve all stock movements for a specific warehouse: You can do this by setting the eq field under warehouse to the ID of the warehouse.

    {
    "criteria": {
    "warehouse": {
    "eq": "your-warehouse-id"
    }
    },
    "limit": 100,
    "offset": 0,
    "select": [
    "id",
    "product",
    "movementType",
    "warehouse",
    "quantity"
    ]
    }


These arejust a few examples of how you can use the Loading Receipts method for stock synchronization. The flexibility of the criteria object allows you to tailor your requests to your specific needs.

Remember, the key to effective stock synchronization is regular updates. Make sure to post stock movements as they occur to keep your system up-to-date.



Did this answer your question?