Outbound movement created via API not visible

Hi openBoxes Team,

I created a Outbound movement via the API

curl -b cookies.txt -X POST -H "Content-Type: application/json" -d '{"name":"TestOrderAPI","origin":"1","destination":"ff80818178bca5670178bdd388c50003","expectedShippingDate":"04/14/2021 18:46 Z","shipmentType.id":"1"}' http://192.168.178.175:8080/openboxes/api/generic/shipment

That worked well and when I query the API I’m getting back all Outbound movements that I created:

  {
      "id": "ff80818178cc947b0178ccab149c0002",
      "name": "BW-LA-WP-13Apr2021-TestOutboundMOve2",
      "status": "PENDING",
      "origin": {
        "id": "1",
        "name": "Warehouse Langenargen",
        "type": "DEPOT"
      },
      "destination": {
        "id": "ff80818178bca5670178bdd388c50003",
        "name": "Wordpress",
        "type": "DEPOT"
      },
      "expectedShippingDate": "04/13/2021 19:17 Z",
      "actualShippingDate": null,
      "expectedDeliveryDate": null,
      "actualDeliveryDate": null,
      "shipmentItems": [],
      "containers": []
    } 

Then outbound movements are stored in the DB and so far it seems good, but I can’t see the Outbound movments on the UI

Hope that you can help me out.

Cheers
Stefan

1 Like

Very good question, Stefan. Thank you for asking this.

So shipments are just one part of a stock movement. Inbound stock movements usually start with an order (i.e. vendor purchase order), but can also be represented by just a shipment. Outbound stock movements always start with a requisition (request from a consumer) and are picked (Picklist), packed and shipped (Shipment). Shipments are used to carry the metadata and items for the delivery of goods from a supplier to your location (inbound) or from your location to a consumer (outbound).

So to answer your question more specifically … right now you have half of the equation. The other half requires the Requisition that represents what the destination “Wordpress” actually wanted. The reason we need both a Requisition and Shipment is for demand. I don’t want to get too deep into this but as an example let’s say a downstream consumer asked for 10 EA of Product A, but you were only able to send them 5 EA of Product A. If we were only tracking Shipments then this outbound movement would only contribute 5 EA to the demand calculation and you’d be missing a key ingredient to figure out what your true demand is (i.e. what your consumers actually wanted).

You can use the Stock Movement API to create a stock movement that will show up in the UI.
https://docs.openboxes.com/en/latest/api-guide/stockMovement/

NOTE: You can still use the Generic API to modify the underlying entities, but you should be able to do everything you need with the Stock Movement API.