API Reference

Reference for the Delivery API in Omnium - read, search, create, update and delete deliveries, perform goods reception, take in despatch advices and receive their units by SSCC.

The Delivery API lets you read and maintain the deliveries of purchase orders and internal transfers, record goods reception, take in despatch advices from suppliers, and receive their units by SSCC. An ERP typically creates deliveries from purchase orders, keeps tracking and invoice data up to date, and reads what was received.

Base URL and authentication

All delivery endpoints are available at:

https://<tenantId>.api.omnium.no/api/Deliveries
RoleAccess
PurchaseOrderReadGroupsRead endpoints, CreateDelivery and adding comments
PurchaseOrderAdminGroupsEverything, including taking in despatch advices, receiving goods, updating and deleting deliveries

Endpoints

MethodEndpointDescriptionRole
GET/api/Deliveries/{deliveryId}Get a deliveryRead
GET/api/Deliveries/{deliveryId}/PurchaseOrderLinesGet the purchase order lines of a delivery, or the content of a unitRead
GET/api/Deliveries/{deliveryId}/ReceivingAdviceGet what was received against what was advisedRead
POST/api/Deliveries/SearchSearch deliveriesRead
GET/api/Deliveries/Units/Find?code=Find the units of despatch advices with a scanned codeRead
POST/api/Deliveries/CreateDelivery/{purchaseOrderId}Create a delivery from purchase order lines, or add lines to a deliveryRead
POST/api/Deliveries/DespatchAdviceTake in a despatch advice (ASN) and build its delivery treeAdmin
POST/api/Deliveries/{deliveryId}/ReceiveReceive units of a despatch adviceAdmin
PUT/api/DeliveriesUpdate a deliveryAdmin
PUT/api/Deliveries/UpdateManyUpdate many deliveriesAdmin
PATCH/api/Deliveries/{deliveryId}Update some fields of a deliveryAdmin
POST/api/Deliveries/{deliveryId}/AddPublicDeliveryCommentAdd a public commentRead
POST/api/Deliveries/{deliveryId}/AddInternalDeliveryCommentAdd an internal commentRead
POST/api/Deliveries/ProcessGoodsReceptionGoods reception on lines of any deliveryAdmin
POST/api/Deliveries/{deliveryId}/ProcessGoodsReceptionGoods reception on the lines of one delivery, or on the content of one unitAdmin
DELETE/api/Deliveries/{deliveryId}Delete a delivery, with the units under itAdmin

Delivery model

A delivery is either an ordinary delivery, the top delivery of a despatch advice, or a unit of a despatch advice: a pallet, carton or other package under a top delivery. See How Omnium models a despatch advice.

FieldTypeDescription
IdstringThe delivery ID
CreateddatetimeWhen the delivery was created
ModifieddatetimeWhen the delivery was last modified
DeliveryStatusstringNew, Confirmed, InProgress, Completed, OnHold or Cancelled. See statuses.
IsAutoDeliveryStatusDisabledbooltrue turns off the automatic status calculation, so the status is set by you
OrderTypestringPurchaseOrder or InternalTransfer
WarehouseCodestringThe receiving warehouse or store
SupplierWarehouseCodestringThe warehouse the goods are sent from, for an internal transfer
Suppliersarray of stringThe names of the suppliers
SupplierIdsarray of stringThe IDs of the suppliers
EstimatedTimeOfDeparturedatetimeWhen the goods leave the supplier
EstimatedTimeOfArrivaldatetimeWhen the goods are expected at the warehouse. Used by ATP.
DeliveryTrackingNumberstringThe carrier's tracking number
DeliveryTrackingLinkstringA link to track the shipment
DeliveryProviderstringThe carrier
InvoiceNumberstringThe supplier's invoice number
InvoiceDatedatetimeThe supplier's invoice date
IsCountedboolWhether the quantities were verified before goods reception
BarcodestringAny other code for the delivery, such as the carrier's package ID. A scan of it finds the delivery in goods reception. Kept as it is when an update leaves it out.
ExternalIdsarrayThe IDs of the delivery in other systems. Kept as they are when an update leaves them out.
Tagsarray of stringFree-text labels for grouping and filtering
PropertiesarrayCustom key-value properties
DeliveryNotesarrayInternal comments
PublicDeliveryNotesarrayPublic comments

These fields are set by Omnium for a despatch advice and its units. They are read-only: an update ignores them.

FieldTypeDescription
DespatchAdviceNumberstringThe sender's despatch advice number, on the top delivery
DespatchAdviceHashstringA hash of the despatch advice message that built the tree, on the top delivery
IsContentCheckRequiredboolThe sender asks for the content of the units to be checked, on the top delivery
UnitTypestringShipment on the top delivery. Pallet, Carton, Parcel, RollCage, Container or Other on a unit.
SsccstringThe SSCC of a unit, 18 digits. Empty on the top delivery and on ordinary deliveries.
ParentDeliveryIdstringThe delivery a unit stands on or belongs to. Empty on the top delivery.
RootDeliveryIdstringThe top delivery of the despatch advice. On the top delivery, its own ID.
ChildDeliveryCountintThe number of units below this delivery, on all levels
ReceivedChildDeliveryCountintThe number of units below this delivery that are received
DeviationChildDeliveryCountintThe number of units below this delivery with a deviation
ReceptionIdstringThe ID of the booking of a unit's goods, as GoodsReceptionId on its inventory transactions
ReceptionDeviationstringA deviation for a unit as a whole: Missing, Damaged or Refused
ReceivedDatedatetimeWhen a unit was received or marked
ReceivedBystringWho received or marked a unit
ReceptionModestringHow a unit was received: AsAdvised or ContentChecked
UnitLinesarrayThe content of a unit. Empty on the top delivery and on ordinary deliveries.

Each content row in UnitLines:

FieldTypeDescription
PurchaseOrderIdstringThe purchase order of the order line on the top delivery
LineItemIdstringThe order line on the top delivery that this content belongs to
SkuIdstringThe SKU of the item
GtinstringThe barcode of the item as the sender stated it
QuantitydecimalThe advised quantity in this unit
ReceivedQuantitydecimalThe quantity received from this unit. Empty until the unit is received or marked.
ReceptionDeviationReasonCodestringWhy the received quantity differs from the advised, as the store gave it
BatchNumberstringThe batch or lot number, as advised
BestBeforeDatedatetimeThe best before date, as advised
ExpiryDatedatetimeThe expiry date, as advised
SerialNumbersarray of stringThe serial numbers, as advised

Read deliveries

Get a delivery

GET /api/Deliveries/{deliveryId}

Returns the delivery. A unit is returned like any delivery, with its content in UnitLines. 400 when the ID is missing, 404 when there is no such delivery.

Get the purchase order lines of a delivery

GET /api/Deliveries/{deliveryId}/PurchaseOrderLines

Returns the purchase order lines on the delivery. For a unit, it returns the content of the unit as purchase order lines: each row as its order line on the top delivery, with the advised quantity in the unit as Quantity, the received quantity in the unit as DeliveredQuantity, the unit's ID as DeliveryId and the amounts scaled to the quantity in the unit. 404 when the delivery has no lines.

Search deliveries

POST /api/Deliveries/Search
FieldTypeDescription
CreatedFromdatetimeCreated at or after
CreatedTodatetimeCreated at or before
EstimatedTimeOfArrivalFromdatetimeExpected at or after
EstimatedTimeOfArrivalTodatetimeExpected at or before
SelectedDeliveriesarray of stringDelivery IDs
SelectedStatusesarray of stringDelivery statuses
SelectedStoresarray of stringReceiving stores
OrderTypestringPurchaseOrder or InternalTransfer
Tagsarray of stringDeliveries with these tags
ExcludedTagsarray of stringDeliveries without these tags
SupplierIdsarray of stringSupplier IDs
SearchTextstringFree text
SortOrderstringThe sort order
PageintThe page, from 1
TakeintDeliveries per page. 10 when not set.
SsccstringUnits with this SSCC. A leading 00, spaces and brackets are ignored.
ParentDeliveryIdstringUnits directly on this delivery
RootDeliveryIdstringThe deliveries of one despatch advice: the top delivery and every unit under it
IncludeUnitsboolInclude the units of despatch advices. false by default.

CustomerName, Email and PurchaseOrderNumber are obsolete and have no effect.

The answer has TotalHits and Result, the deliveries of the page.

A search leaves units out unless it sets IncludeUnits, Sscc, ParentDeliveryId or RootDeliveryId. The top delivery of a despatch advice is always included. See Read the units of a despatch advice.

Find units by a scanned code

GET /api/Deliveries/Units/Find?code=395201230000041022

Returns the units whose SSCC or barcode is exactly the code, received units included. 404 when no unit has the code. See Find units by a scanned code.

Get the receiving advice

GET /api/Deliveries/{deliveryId}/ReceivingAdvice

Returns what was received against what was advised, for the whole despatch advice when you give its top delivery or any of its units, or for the order lines of an ordinary delivery. 400 when the ID is missing, 404 when the delivery, or the top delivery of a unit, is not found. See Get the receiving advice for the model and an example.


Create deliveries

Create a delivery from purchase order lines

POST /api/Deliveries/CreateDelivery/{purchaseOrderId}?existingDeliveryId=&cancelRemainingLineItems=&expectedDeliveryDate=&barcode=&newDeliveryId=&preventDuplicateLineItems=

The body is a list of the purchase order lines to put on the delivery:

FieldTypeDescription
LineItemIdstringThe order line. When it is left out, Code finds the first line with that SKU that is on no delivery.
CodestringThe SKU of the line
QuantitydecimalThe quantity to put on the delivery. A smaller quantity than the line has splits the line. A line with no quantity is skipped.
PackageBarcodestringThe barcode of the package that holds the line
Query parameterTypeDescription
existingDeliveryIdstringAdd the lines to this delivery instead of creating a new one. A unit of a despatch advice cannot take order lines: the call answers 400 Could not create delivery.
cancelRemainingLineItemsboolCancel what is left on the purchase order
expectedDeliveryDatedatetimeThe estimated time of arrival
barcodestringA barcode for the delivery, used to find it in goods reception
newDeliveryIdstringThe ID of the new delivery. Your own responsibility.
preventDuplicateLineItemsboolAnswer 400 when the request names a line item ID more than once

Returns the delivery. 400 when lines are missing, unknown on the purchase order, or already on a delivery; 404 when the purchase order is not found.

Take in a despatch advice

POST /api/Deliveries/DespatchAdvice

Creates the top delivery of a shipment with the order lines of the message, one unit delivery per package with a usable SSCC or carrier package ID, and order lines for items that were not ordered. Answers 200 with the result, 400, 404 or 409 when the message is rejected, and 500 when building failed. See Despatch advice (ASN) for the request, the matching rules, the rejections and the warnings.


Update deliveries

Update a delivery

PUT /api/Deliveries

The body is the whole delivery, with Id. The request replaces the stored delivery, so a field it leaves out is cleared, with these exceptions:

  • Barcode and ExternalIds are kept as stored when the request leaves them out.
  • The read-only fields of a despatch advice and its units are always kept as stored.
  • On a delivery of a despatch advice, the intake warnings are kept.

When the estimated time of arrival changes, Omnium recalculates ATP for the delivery, and on a top delivery it copies the date to every unit. Returns the delivery. 404 when it is not stored.

Update many deliveries

PUT /api/Deliveries/UpdateMany

The body is a list of whole deliveries. The same fields are kept as for PUT /api/Deliveries, from the stored deliveries. This endpoint does not recalculate ATP or copy the arrival date to units. Returns 200 without a body.

Update some fields of a delivery

PATCH /api/Deliveries/{deliveryId}

Changes only the fields you set. The body must have Id.

FieldType
Idstring
DeliveryTrackingNumberstring
DeliveryTrackingLinkstring
DeliveryProviderstring
InvoiceNumberstring
InvoiceDatedatetime
EstimatedTimeOfDeparturedatetime
EstimatedTimeOfArrivaldatetime
Propertiesarray

A changed estimated time of arrival is handled as for PUT. Returns the delivery.

Add comments

POST /api/Deliveries/{deliveryId}/AddPublicDeliveryComment
POST /api/Deliveries/{deliveryId}/AddInternalDeliveryComment

The body is a comment. The public comment goes in PublicDeliveryNotes and the internal comment in DeliveryNotes. When the comment has no Creator, the name of the API user is used. Returns the comments of the delivery, newest first. 404 when the delivery is not found.


Receive goods

Receive units of a despatch advice

POST /api/Deliveries/{deliveryId}/Receive

Receives a unit, or the top delivery, with every unit under it that is not received yet, as advised, or with deviations and counted quantities from the request. See Receive units.

Goods reception on one delivery

POST /api/Deliveries/{deliveryId}/ProcessGoodsReception?confirmOverDelivery=false

The body is a list of goods reception lines. The lines must be on the delivery, and each line must name a physical warehouse. A GoodsReceptionId that was used before is answered with 400.

When deliveryId is a unit of a despatch advice, the lines are the counted content of that unit, ReceptionDeviationReasonCode on a line says why a quantity differs from the advised, and confirmOverDelivery lets a line book more than is open on its order line. The answer is then the reception result of the unit, with 409 when the unit was not received. See Receive the content of one unit per line.

Goods reception on any delivery

POST /api/Deliveries/ProcessGoodsReception

The body is a list of goods reception lines, which can be on different deliveries. Each line must name a physical warehouse. See Goods reception.


Delete a delivery

DELETE /api/Deliveries/{deliveryId}

Takes the order lines off the delivery and deletes it. A delivery of a despatch advice is deleted with every unit below it: the top delivery with all its units, or a pallet with its cartons. The deliveries above a deleted unit lower their unit count by the deleted unit and the units under it.

404 when the delivery is not found. 409 Conflict, with the reason as text, when the delivery is a received unit, or has a received unit below it. Nothing is changed then.


What changes for an existing integration

Despatch advices add units to the deliveries of a tenant. An integration that does not use them keeps working as before:

  • Lists. POST /api/Deliveries/Search leaves units out unless you ask for them. The top delivery of a despatch advice is in the list like any delivery, with all its order lines.
  • Exports. Units are never exported, neither by the delivery export connectors, the ExportDeliveries workflow step nor a manual export. Connected systems get the top delivery with all its lines.
  • New fields. The delivery has the new fields in the delivery model. Barcode and ExternalIds can be written and are kept when an update leaves them out. The despatch advice fields are read-only.
  • PUT and UpdateMany keep the despatch advice fields, the unit fields and the content of a unit as stored, whatever the request holds, so an update cannot cut a unit out of its tree. On a delivery of a despatch advice the intake warnings are kept.
  • PATCH has no despatch advice fields, so it cannot change them.
  • Arrival date. A PUT or PATCH that changes the estimated time of arrival of a top delivery also changes it on every unit. UpdateMany does not.
  • Delete takes the units under a delivery with it, and is refused with 409 when goods of them are received.
  • CreateDelivery answers 400 when existingDeliveryId is a unit. Order lines go on the top delivery.
  • Goods reception per line on a top delivery works as before. Receive goods that are in units through their units, see Receive goods that are in no unit.
  • Events. Taking in a despatch advice raises delivery events for the top delivery, as creating a delivery and adding lines to it does. Creating units raises no events. Receive raises one delivery event for the delivery in the route, which can be a unit; the other units it receives raise none. A unit also raises delivery events when another endpoint acts on it directly, such as PUT, PATCH, a comment or DELETE.

Purchase orders

A despatch advice can add order lines to a purchase order for items that were not ordered, and it uses the buyer's line number to find lines. The purchase order line has four fields for this:

FieldTypeDescription
LineNumberstringThe buyer's own line number on the order, such as 103. A despatch advice can name the line by it. You can write it with PUT and PATCH.
OriginstringEmpty for a line that was ordered. AddedByDespatchAdvice for a line a despatch advice added. Read-only.
AddedDatedatetimeWhen a line that was not ordered was added. Read-only.
ReceptionDeviationReasonCodestringRead-only. Empty on the order line itself; the reason codes of a despatch advice are on the content rows of its units. GET /api/Deliveries/{deliveryId}/PurchaseOrderLines on a unit returns the code of each row on its line.

Your ERP does not know the lines a despatch advice added, so a purchase order update keeps them: PUT /api/PurchaseOrders, UpdateAndRunWorkflow, UpdateMany, and PATCH with KeepExistingOrderLines set to false put back every stored line with Origin AddedByDespatchAdvice that the request leaves out, with its reservations. The read-only fields always come from the stored line with the same line item ID.


For the full interactive API reference, see the swagger documentation.