# SOM API

SOM is responsible for shipment order management. Booking and tracking of the shipments, parcels and deliveries. Below are the endpoints (or methods) available.

# Domain Model

The domain model consists of three important objects - Shipment, Parcel and Delivery.

graph LR s(Shipment) p(Parcels) d(Deliveries) s-- has many -->p; p-- has many -->d;

# General Flow

Creating a Shipment, generating labels and tracking numbers and booking pickup involves three steps.

sequenceDiagram participant C as Client participant S as SOM C->>S: POST /shipments.create S->>C: Return Shipment with Parcels and Deliveries C->>S: POST /shipment.bookParcels S->>C: Return Shipment with Parcels and Deliveries C->>S: POST /deliveries.bookPickup S->>C: Return Delivery
  1. Create a shipment. Shipment, Parcels and Deliveries are created with a single call to shipments.create.
  2. To generate labels and tracking numbers for a Shipment, call shipments.bookParcels. This will create labels and tracking numbers for all Deliveries in the specified Shipment.
  3. The final step is to book one or all Deliveries attached to a Shipment. This is done by calling deliveries.bookPickup with the tracking number as a parameter. Once a delivery has been booked, it is handled by our booking service which will most often generate and upload an EDI file at a configured interval.

# Create Shipment

This call creates new shipment, parcels and deliveries at once in SOM. So called Composite Shipment.

# Book Parcels

Creates a booking with the shipping company. This is when tracking numbers, tracking links and shipping labels are generated.

# Book Pickup

When the shipment has received tracking numbers and labels it is time to book pickup. This call makes the actual booking and and notifies the shipping company about the delivery.

# Get Delivery

# Create and Book

Create and book shipment is essentially a wrapper for the three calls shipments.create, shipments.bookParcels and deliveries.bookPickup. It will create a shipment, generate labels and tracking numbers and finally book the created deliveries for pickup, all in one single call.

# Get Shipment

Returns the shipment by a specified parameter.

# Cancel Delivery

Cancels a delivery before it has been picked up by the carrier.

# Update Shipment

Updates a shipment

# Cancel Shipment

Cancels a shipment

Last Updated: 3/13/2020, 2:31:37 PM