Documentation

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.

Request

POST /v1/som/shipments.create HTTP/1.1
Host: api.ingrid.com
Accept: application/json
Content-Type: application/json
Authorization: Bearer base64-encoded-api-token

{
"shipping_method": "pnl-mpc",
"shipment_value": 19900,
"shipping_date": "2021-11-29T10:18:28.069Z",
"number_of_parcels": 1,
"external_id": "ACME12345",
"location_ref": "592971",
"customer_info": {
"name": "Erik Johansson",
"email": "erik@example.com",
"phone": "0761234561",
"address": {
"care_of": "Anders Ekman",
"address_lines": [
"Industrigatan 5"
],
"city": "Stockholm",
"postal_code": "11239",
"country": "SE"
}
},
"address_to": {
"name": "ICA Västermalmsgallerian",
"address_lines": [
"S:t Eriksgatan 45"
],
"city": "Stockholm",
"postal_code": "11234",
"country": "SE"
},
"address_from": {
"name": "Acme, Main Warehouse",
"address_lines": [
"Frihamnsgatan 56"
],
"postal_code": "11556",
"city": "Stockholm",
"country": "SE"
},
"contents": {
"goods": [
{
"sku": "SKU12345",
"name": "Saucony Shadow 6000",
"quantity": 1,
"weight": 720,
"dimensions": {
"length": 600,
"width": 300,
"height": 250
},
"tags": [
"shoes",
"indigo",
"class_one"
]
}
]
},
"meta": {
"is_fragile": "true"
}
}

Response

HTTP/1.1 200 OK
Date: Mon, 29 Nov 2021 10:18:29 GMT
Content-Type: application/json
Content-Length: 887
Connection: close
Vary: Accept-Encoding
x-trace-id: S20211129101828Y7T2ZF3F36SZCJNF

{
"shipment": {
"id": "e0046523-53c1-4eb1-b39a-eec56984a703",
"site_id": "11756e4a98c64fa9a9c5d627fd88a236",
"customer_info": {
"address": {
"care_of": "Anders Ekman",
"address_lines": [
"Industrigatan 5"
],
"city": "Stockholm",
"postal_code": "11239",
"country": "SE"
},
"phone": "0761234561",
"email": "erik@example.com"
},
"meta": {
"is_fragile": "true"
},
"shipping_date": "2021-11-29T10:18:28Z",
"address_from": {
"name": "Acme, Main Warehouse",
"address_lines": [
"Frihamnsgatan 56"
],
"city": "Stockholm",
"postal_code": "11556",
"country": "SE"
},
"address_to": {
"name": "ICA Västermalmsgallerian",
"address_lines": [
"S:t Eriksgatan 45"
],
"city": "Stockholm",
"postal_code": "11234",
"country": "SE"
},
"line_items": [
{
"sku": "SKU12345",
"name": "Saucony Shadow 6000",
"quantity": "1",
"dimensions": {
"length": "600",
"height": "250",
"width": "300"
},
"tags": [
"shoes",
"indigo",
"class_one"
],
"weight": "720"
}
],
"parcels": [
{
"id": "441dc41b-0247-4386-98c8-8242d5cfeaee",
"shipment_id": "e0046523-53c1-4eb1-b39a-eec56984a703",
"line_items": [
{
"sku": "SKU12345",
"name": "Saucony Shadow 6000",
"quantity": "1",
"dimensions": {
"length": "600",
"height": "250",
"width": "300"
}
}
],
"deliveries": [
{
"id": "6a21567b-089a-4bd2-bc73-1b7a8c2505ad",
"parcel_id": "441dc41b-0247-4386-98c8-8242d5cfeaee",
"address_from": {
"name": "Acme, Main Warehouse",
"address_lines": [
"Frihamnsgatan 56"
],
"city": "Stockholm",
"postal_code": "11556",
"country": "SE"
},
"address_to": {
"name": "ICA Västermalmsgallerian",
"address_lines": [
"S:t Eriksgatan 45"
],
"city": "Stockholm",
"postal_code": "11234",
"country": "SE"
},
"shipping_method": "pnl-mpc",
"location_ref": "592971",
"delivery_status": "created",
"created_at": "2021-11-29T10:18:29Z",
"updated_at": "2021-11-29T10:18:29Z"
}
],
"created_at": "2021-11-29T10:18:29Z",
"updated_at": "2021-11-29T10:18:29Z",
"dimensions": {
"length": "600",
"height": "250",
"width": "300"
},
"weight": "720"
}
],
"external_id": "ACME12345",
"shipment_value": "19900",
"tos_id": "01FNNK7YMAP4TBVDRFFT4GE96G",
"contents": {
"goods": [
{
"sku": "SKU12345",
"name": "Saucony Shadow 6000",
"quantity": "1",
"dimensions": {
"length": "600",
"height": "250",
"width": "300"
},
"tags": [
"shoes",
"indigo",
"class_one"
],
"weight": "720"
}
]
},
"created_at": "2021-11-29T10:18:28Z",
"updated_at": "2021-11-29T10:18:28Z"
}
}

Book Parcels

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

Request

POST /v1/som/shipments.bookParcels HTTP/1.1
Host: api.ingrid.com
Accept: application/json
Content-Type: application/json
Authorization: Bearer base64-encoded-api-token

{
"shipment_id": "e0046523-53c1-4eb1-b39a-eec56984a703"
}

Response

HTTP/1.1 200 OK
Date: Mon, 29 Nov 2021 10:18:31 GMT
Content-Type: application/json
Content-Length: 54
Connection: close
Vary: Accept-Encoding
x-trace-id: S20211129101830PM07APKNM9MW0P0D

{
"shipment": {
"id": "e0046523-53c1-4eb1-b39a-eec56984a703",
"site_id": "11756e4a98c64fa9a9c5d627fd88a236",
"customer_info": {
"address": {
"care_of": "Anders Ekman",
"address_lines": [
"Industrigatan 5"
],
"city": "Stockholm",
"postal_code": "11239",
"country": "SE"
},
"phone": "0761234561",
"email": "erik@example.com"
},
"meta": {
"is_fragile": "true"
},
"shipping_date": "2021-11-29T10:18:28Z",
"address_from": {
"name": "Acme, Main Warehouse",
"address_lines": [
"Frihamnsgatan 56"
],
"city": "Stockholm",
"postal_code": "11556",
"country": "SE"
},
"address_to": {
"name": "ICA Västermalmsgallerian",
"address_lines": [
"S:t Eriksgatan 45"
],
"city": "Stockholm",
"postal_code": "11234",
"country": "SE"
},
"line_items": [
{
"sku": "SKU12345",
"name": "Saucony Shadow 6000",
"quantity": "1",
"dimensions": {
"length": "600",
"height": "250",
"width": "300"
},
"tags": [
"shoes",
"indigo",
"class_one"
],
"weight": "720"
}
],
"parcels": [
{
"id": "441dc41b-0247-4386-98c8-8242d5cfeaee",
"shipment_id": "e0046523-53c1-4eb1-b39a-eec56984a703",
"line_items": [
{
"sku": "SKU12345",
"name": "Saucony Shadow 6000",
"quantity": "1",
"dimensions": {
"length": "600",
"height": "250",
"width": "300"
}
}
],
"deliveries": [
{
"id": "6a21567b-089a-4bd2-bc73-1b7a8c2505ad",
"parcel_id": "441dc41b-0247-4386-98c8-8242d5cfeaee",
"tracking_number": "00033333333000137661",
"label_url": "https://api.ingrid.com/v1/labels/path-to-generated-label.svg",
"address_from": {
"name": "Acme, Main Warehouse",
"address_lines": [
"Frihamnsgatan 56"
],
"city": "Stockholm",
"postal_code": "11556",
"country": "SE"
},
"address_to": {
"name": "ICA Västermalmsgallerian",
"address_lines": [
"S:t Eriksgatan 45"
],
"city": "Stockholm",
"postal_code": "11234",
"country": "SE"
},
"shipping_method": "pnl-mpc",
"location_ref": "592971",
"delivery_status": "booked",
"tracking_url": "https://tracking.postnord.com/SE?id=00033333333000137661",
"created_at": "2021-11-29T10:18:29Z",
"updated_at": "2021-11-29T10:18:31Z"
}
],
"created_at": "2021-11-29T10:18:30Z",
"updated_at": "2021-11-29T10:18:30Z",
"dimensions": {
"length": "600",
"height": "250",
"width": "300"
},
"weight": "720"
}
],
"external_id": "ACME12345",
"shipment_value": "19900",
"tos_id": "01FNNK7YMAP4TBVDRFFT4GE96G",
"contents": {
"goods": [
{
"sku": "SKU12345",
"name": "Saucony Shadow 6000",
"quantity": "1",
"dimensions": {
"length": "600",
"height": "250",
"width": "300"
},
"tags": [
"shoes",
"indigo",
"class_one"
],
"weight": "720"
}
]
},
"created_at": "2021-11-29T10:18:30Z",
"updated_at": "2021-11-29T10:18:30Z"
}
}

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.

Request

POST /v1/som/deliveries.bookPickup HTTP/1.1
Host: api.ingrid.com
Accept: application/json
Content-Type: application/json
Authorization: Bearer base64-encoded-api-token

{
"tracking_number": "00033333333000137647"
}

Response

HTTP/1.1 200 OK
Date: Mon, 29 Nov 2021 10:18:25 GMT
Content-Type: application/json
Content-Length: 42
Connection: close
Vary: Accept-Encoding
x-trace-id: S20211129101824BC3K87D67QY3SZPH

{
"delivery": {
"id": "a4e65515-fa3d-4a1c-baa9-80d88bc2a216",
"parcel_id": "64efd8b9-eff4-4f22-b1df-928f5dc8ef87",
"tracking_number": "00033333333000137647",
"label_url": "https://api.ingrid.com/v1/labels/path-to-generated-label.svg",
"address_from": {
"name": "Acme, Main Warehouse",
"address_lines": [
"Frihamnsgatan 56"
],
"city": "Stockholm",
"postal_code": "11556",
"country": "SE"
},
"address_to": {
"name": "ICA Västermalmsgallerian",
"address_lines": [
"S:t Eriksgatan 45"
],
"city": "Stockholm",
"postal_code": "11234",
"country": "SE"
},
"shipping_method": "pnl-mpc",
"location_ref": "592971",
"delivery_status": "pickup",
"tracking_url": "https://tracking.postnord.com/SE?id=00033333333000137647",
"created_at": "2021-11-29T10:18:23Z",
"updated_at": "2021-11-29T10:18:25Z"
}
}

Get Delivery

Request

GET /v1/som/deliveries.get?tracking_number=00033333333000137647 HTTP/1.1
Host: api.ingrid.com
Accept: application/json
Content-Type: application/json
Authorization: Bearer base64-encoded-api-token

Response

HTTP/1.1 200 OK
Date: Mon, 29 Nov 2021 10:18:26 GMT
Content-Type: application/json
Connection: close
Vary: Accept-Encoding
x-trace-id: S202111291018255VVRAR4QYM8APG6B

{
"delivery": {
"id": "a4e65515-fa3d-4a1c-baa9-80d88bc2a216",
"parcel_id": "64efd8b9-eff4-4f22-b1df-928f5dc8ef87",
"tracking_number": "00033333333000137647",
"label_url": "https://api.ingrid.com/v1/labels/path-to-generated-label.svg",
"address_from": {
"name": "Acme, Main Warehouse",
"address_lines": [
"Frihamnsgatan 56"
],
"city": "Stockholm",
"postal_code": "11556",
"country": "SE"
},
"address_to": {
"name": "ICA Västermalmsgallerian",
"address_lines": [
"S:t Eriksgatan 45"
],
"city": "Stockholm",
"postal_code": "11234",
"country": "SE"
},
"shipping_method": "pnl-mpc",
"location_ref": "592971",
"delivery_status": "pickup",
"tracking_url": "https://tracking.postnord.com/SE?id=00033333333000137647",
"created_at": "2021-11-29T10:18:23Z",
"updated_at": "2021-11-29T10:18:25Z"
}
}

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.

Request

POST /v1/som/shipments.createAndBook HTTP/1.1
Host: api.ingrid.com
Accept: application/json
Content-Type: application/json
Authorization: Bearer base64-encoded-api-token

{
"shipping_method": "pnl-mpc",
"shipment_value": 19900,
"shipping_date": "2021-11-29T10:18:26.120Z",
"number_of_parcels": 1,
"external_id": "ACME12345",
"location_ref": "592971",
"customer_info": {
"name": "Erik Johansson",
"email": "erik@example.com",
"phone": "0761234561",
"address": {
"care_of": "Anders Ekman",
"address_lines": [
"Industrigatan 5"
],
"city": "Stockholm",
"postal_code": "11239",
"country": "SE"
}
},
"address_to": {
"name": "ICA Västermalmsgallerian",
"address_lines": [
"S:t Eriksgatan 45"
],
"city": "Stockholm",
"postal_code": "11234",
"country": "SE"
},
"address_from": {
"name": "Acme, Main Warehouse",
"address_lines": [
"Frihamnsgatan 56"
],
"postal_code": "11556",
"city": "Stockholm",
"country": "SE"
},
"contents": {
"goods": [
{
"sku": "SKU12345",
"name": "Saucony Shadow 6000",
"quantity": 1,
"weight": 720,
"dimensions": {
"length": 600,
"width": 300,
"height": 250
},
"tags": [
"shoes",
"indigo",
"class_one"
]
}
]
},
"meta": {
"is_fragile": "true"
}
}

Response

HTTP/1.1 200 OK
Date: Mon, 29 Nov 2021 10:18:27 GMT
Content-Type: application/json
Content-Length: 887
Connection: close
Vary: Accept-Encoding
x-trace-id: S20211129101826HC2XACSM1CXXGWNF

{
"shipment": {
"id": "36cada0d-7d16-46cd-9082-6be5847727e0",
"site_id": "11756e4a98c64fa9a9c5d627fd88a236",
"customer_info": {
"address": {
"care_of": "Anders Ekman",
"address_lines": [
"Industrigatan 5"
],
"city": "Stockholm",
"postal_code": "11239",
"country": "SE"
},
"phone": "0761234561",
"email": "erik@example.com"
},
"meta": {
"is_fragile": "true"
},
"shipping_date": "2021-11-29T10:18:26Z",
"address_from": {
"name": "Acme, Main Warehouse",
"address_lines": [
"Frihamnsgatan 56"
],
"city": "Stockholm",
"postal_code": "11556",
"country": "SE"
},
"address_to": {
"name": "ICA Västermalmsgallerian",
"address_lines": [
"S:t Eriksgatan 45"
],
"city": "Stockholm",
"postal_code": "11234",
"country": "SE"
},
"line_items": [
{
"sku": "SKU12345",
"name": "Saucony Shadow 6000",
"quantity": "1",
"dimensions": {
"length": "600",
"height": "250",
"width": "300"
},
"tags": [
"shoes",
"indigo",
"class_one"
],
"weight": "720"
}
],
"parcels": [
{
"id": "ccaf7e3e-b4df-4bad-a3cc-fc022e037f95",
"shipment_id": "36cada0d-7d16-46cd-9082-6be5847727e0",
"line_items": [
{
"sku": "SKU12345",
"name": "Saucony Shadow 6000",
"quantity": "1",
"dimensions": {
"length": "600",
"height": "250",
"width": "300"
}
}
],
"deliveries": [
{
"id": "fc67766b-c611-4ac0-80b9-0f49d6aef03a",
"parcel_id": "ccaf7e3e-b4df-4bad-a3cc-fc022e037f95",
"tracking_number": "00033333333000137654",
"label_url": "https://api.ingrid.com/v1/labels/path-to-generated-label.svg",
"address_from": {
"name": "Acme, Main Warehouse",
"address_lines": [
"Frihamnsgatan 56"
],
"city": "Stockholm",
"postal_code": "11556",
"country": "SE"
},
"address_to": {
"name": "ICA Västermalmsgallerian",
"address_lines": [
"S:t Eriksgatan 45"
],
"city": "Stockholm",
"postal_code": "11234",
"country": "SE"
},
"shipping_method": "pnl-mpc",
"location_ref": "592971",
"delivery_status": "booked",
"tracking_url": "https://tracking.postnord.com/SE?id=00033333333000137654",
"created_at": "2021-11-29T10:18:27Z",
"updated_at": "2021-11-29T10:18:27Z"
}
],
"created_at": "2021-11-29T10:18:27Z",
"updated_at": "2021-11-29T10:18:27Z",
"dimensions": {
"length": "600",
"height": "250",
"width": "300"
},
"weight": "720"
}
],
"external_id": "ACME12345",
"shipment_value": "19900",
"tos_id": "01FNNK7WM037VJJED1VB77RRAR",
"contents": {
"goods": [
{
"sku": "SKU12345",
"name": "Saucony Shadow 6000",
"quantity": "1",
"dimensions": {
"length": "600",
"height": "250",
"width": "300"
},
"tags": [
"shoes",
"indigo",
"class_one"
],
"weight": "720"
}
]
},
"created_at": "2021-11-29T10:18:26Z",
"updated_at": "2021-11-29T10:18:26Z"
}
}

Get Shipment

Returns the shipment by a specified parameter.

Request

GET /v1/som/shipments.get?id=36cada0d-7d16-46cd-9082-6be5847727e0 HTTP/1.1
Host: api.ingrid.com
Accept: application/json
Content-Type: application/json
Authorization: Bearer base64-encoded-api-token

Response

HTTP/1.1 200 OK
Date: Mon, 29 Nov 2021 10:18:28 GMT
Content-Type: application/json
Connection: close
Vary: Accept-Encoding
x-trace-id: S20211129101828DZTCN88HHEZF6JXP

{
"shipment": {
"id": "36cada0d-7d16-46cd-9082-6be5847727e0",
"site_id": "11756e4a98c64fa9a9c5d627fd88a236",
"customer_info": {
"address": {
"care_of": "Anders Ekman",
"address_lines": [
"Industrigatan 5"
],
"city": "Stockholm",
"postal_code": "11239",
"country": "SE"
},
"phone": "0761234561",
"email": "erik@example.com"
},
"meta": {
"is_fragile": "true"
},
"shipping_date": "2021-11-29T10:18:26Z",
"address_from": {
"name": "Acme, Main Warehouse",
"address_lines": [
"Frihamnsgatan 56"
],
"city": "Stockholm",
"postal_code": "11556",
"country": "SE"
},
"address_to": {
"name": "ICA Västermalmsgallerian",
"address_lines": [
"S:t Eriksgatan 45"
],
"city": "Stockholm",
"postal_code": "11234",
"country": "SE"
},
"line_items": [
{
"sku": "SKU12345",
"name": "Saucony Shadow 6000",
"quantity": "1",
"dimensions": {
"length": "600",
"height": "250",
"width": "300"
},
"tags": [
"shoes",
"indigo",
"class_one"
],
"weight": "720"
}
],
"parcels": [
{
"id": "ccaf7e3e-b4df-4bad-a3cc-fc022e037f95",
"shipment_id": "36cada0d-7d16-46cd-9082-6be5847727e0",
"line_items": [
{
"sku": "SKU12345",
"name": "Saucony Shadow 6000",
"quantity": "1",
"dimensions": {
"length": "600",
"height": "250",
"width": "300"
}
}
],
"deliveries": [
{
"id": "fc67766b-c611-4ac0-80b9-0f49d6aef03a",
"parcel_id": "ccaf7e3e-b4df-4bad-a3cc-fc022e037f95",
"tracking_number": "00033333333000137654",
"label_url": "https://api.ingrid.com/v1/labels/path-to-generated-label.svg",
"address_from": {
"name": "Acme, Main Warehouse",
"address_lines": [
"Frihamnsgatan 56"
],
"city": "Stockholm",
"postal_code": "11556",
"country": "SE"
},
"address_to": {
"name": "ICA Västermalmsgallerian",
"address_lines": [
"S:t Eriksgatan 45"
],
"city": "Stockholm",
"postal_code": "11234",
"country": "SE"
},
"shipping_method": "pnl-mpc",
"location_ref": "592971",
"delivery_status": "pickup",
"tracking_url": "https://tracking.postnord.com/SE?id=00033333333000137654",
"created_at": "2021-11-29T10:18:27Z",
"updated_at": "2021-11-29T10:18:27Z"
}
],
"created_at": "2021-11-29T10:18:27Z",
"updated_at": "2021-11-29T10:18:27Z",
"dimensions": {
"length": "600",
"height": "250",
"width": "300"
},
"weight": "720"
}
],
"external_id": "ACME12345",
"shipment_value": "19900",
"tos_id": "01FNNK7WM037VJJED1VB77RRAR",
"contents": {
"goods": [
{
"sku": "SKU12345",
"name": "Saucony Shadow 6000",
"quantity": "1",
"dimensions": {
"length": "600",
"height": "250",
"width": "300"
},
"tags": [
"shoes",
"indigo",
"class_one"
],
"weight": "720"
}
]
},
"created_at": "2021-11-29T10:18:26Z",
"updated_at": "2021-11-29T10:18:26Z"
}
}

Cancel Delivery

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

Request

POST /v1/som/deliveries.cancel HTTP/1.1
Host: api.ingrid.com
Accept: application/json
Content-Type: application/json
Authorization: Bearer base64-encoded-api-token

{
"tracking_number": "00033333333000136619"
}

Response

HTTP/1.1 200 OK
Date: Mon, 01 Mar 2021 12:19:40 GMT
Content-Type: application/json
Content-Length: 42
Connection: close
Vary: Accept-Encoding
x-trace-id: 01EZPVNMVG9A2303F4RF1SS6MT

{}

Update Shipment

Updates a shipment

Request

POST /v1/som/shipments.update HTTP/1.1
Host: api.ingrid.com
Accept: application/json
Content-Type: application/json
Authorization: Bearer base64-encoded-api-token

{
"shipment_id": "4659fc78-a9cf-4012-8709-6479e51aa119",
"shipping_method": "pnl-mpc",
"shipment_value": 27800,
"shipping_date": "2021-03-01T12:19:40.652Z",
"number_of_parcels": 1,
"external_id": "ACME12345",
"location_ref": "592971",
"customer_info": {
"name": "Erik Johansson",
"email": "erik@example.com",
"phone": "0761234561",
"address": {
"care_of": "Anders Ekman",
"address_lines": [
"Industrigatan 5"
],
"city": "Stockholm",
"postal_code": "11239",
"country": "SE"
}
},
"address_to": {
"name": "ICA Västermalmsgallerian",
"address_lines": [
"S:t Eriksgatan 45"
],
"city": "Stockholm",
"postal_code": "11234",
"country": "SE"
},
"address_from": {
"name": "Acme, Main Warehouse",
"address_lines": [
"Frihamnsgatan 56"
],
"postal_code": "11556",
"city": "Stockholm",
"country": "SE"
},
"contents": {
"goods": [
{
"sku": "SKU12345",
"name": "Saucony Shadow 6000",
"quantity": 1,
"weight": 720,
"dimensions": {
"length": 600,
"width": 300,
"height": 250
},
"tags": [
"shoes",
"indigo",
"class_one"
]
},
{
"sku": "SKU23456",
"name": "Stüssy Small Stock Crew Socks - One Size",
"quantity": 1,
"weight": 50,
"tags": [
"socks",
"indigo",
"class_one"
]
}
]
},
"meta": {
"is_fragile": "true",
"spring_promo": "true"
}
}

Response

HTTP/1.1 200 OK
Date: Mon, 01 Mar 2021 12:19:41 GMT
Content-Type: application/json
Content-Length: 1095
Connection: close
Vary: Accept-Encoding
x-trace-id: 01EZPVNNV2D664XW57S0GD96EM

{
"shipment": {
"id": "4659fc78-a9cf-4012-8709-6479e51aa119",
"site_id": "11756e4a98c64fa9a9c5d627fd88a236",
"customer_info": {
"address": {
"care_of": "Anders Ekman",
"address_lines": [
"Industrigatan 5"
],
"city": "Stockholm",
"postal_code": "11239",
"country": "SE"
},
"phone": "0761234561",
"email": "erik@example.com"
},
"meta": {
"is_fragile": "true",
"spring_promo": "true"
},
"shipping_date": "2021-03-01T12:19:40Z",
"address_from": {
"name": "Acme, Main Warehouse",
"address_lines": [
"Frihamnsgatan 56"
],
"city": "Stockholm",
"postal_code": "11556",
"country": "SE"
},
"address_to": {
"name": "ICA Västermalmsgallerian",
"address_lines": [
"S:t Eriksgatan 45"
],
"city": "Stockholm",
"postal_code": "11234",
"country": "SE"
},
"line_items": [
{
"sku": "SKU12345",
"name": "Saucony Shadow 6000",
"quantity": "1",
"dimensions": {
"length": "600",
"height": "250",
"width": "300"
},
"tags": [
"shoes",
"indigo",
"class_one"
],
"weight": "720"
}
],
"parcels": [
{
"id": "316b6769-b537-4dd9-96f1-a824e747f8bb",
"shipment_id": "4659fc78-a9cf-4012-8709-6479e51aa119",
"deliveries": [
{
"id": "c3cbf98f-fe7a-4de1-ae78-3e2a36758c2a",
"parcel_id": "316b6769-b537-4dd9-96f1-a824e747f8bb",
"address_from": {
"name": "Acme, Main Warehouse",
"address_lines": [
"Frihamnsgatan 56"
],
"city": "Stockholm",
"postal_code": "11556",
"country": "SE"
},
"address_to": {
"name": "ICA Västermalmsgallerian",
"address_lines": [
"S:t Eriksgatan 45"
],
"city": "Stockholm",
"postal_code": "11234",
"country": "SE"
},
"shipping_method": "pnl-mpc",
"location_ref": "592971",
"delivery_status": "created",
"created_at": "2021-03-01T12:19:40Z",
"updated_at": "2021-03-01T12:19:41Z",
"label_url": "https://api.ingrid.com/v1/labels/path-to-generated-label.svg"
}
],
"created_at": "2021-03-01T12:19:41Z",
"updated_at": "2021-03-01T12:19:41Z",
"dimensions": {
"length": "600",
"height": "250",
"width": "300"
},
"weight": "720"
}
],
"external_id": "ACME12345",
"shipment_value": "27800",
"tos_id": "01EZPVNN71H7JDH6B9HZ080YGH",
"contents": {
"goods": [
{
"sku": "SKU12345",
"name": "Saucony Shadow 6000",
"quantity": "1",
"dimensions": {
"length": "600",
"height": "250",
"width": "300"
},
"tags": [
"shoes",
"indigo",
"class_one"
],
"weight": "720"
}
]
},
"created_at": "2021-03-01T12:19:41Z",
"updated_at": "2021-03-01T12:19:41Z"
}
}

Cancel Shipment

Cancels a shipment

Request

POST /v1/som/shipments.cancel HTTP/1.1
Host: api.ingrid.com
Accept: application/json
Content-Type: application/json
Authorization: Bearer base64-encoded-api-token

{
"shipment_id": "4659fc78-a9cf-4012-8709-6479e51aa119"
}

Response

HTTP/1.1 200 OK
Date: Mon, 01 Mar 2021 12:19:41 GMT
Content-Type: application/json
Content-Length: 54
Connection: close
Vary: Accept-Encoding
x-trace-id: 01EZPVNP6VB8ZJS4CXXWB5N1P6

{}

Add Parcel

Allows adding new parcel to already existing shipment. It is possible to add the parcel to the newly created (CreateShipment) carrier pickup that is not yet requested. If the shipment was booked using BookParcels, using AddParcel will book and generate a new label for the added parcel. The endpoint also works with custom booking methods. If a return shipment is connected with the provided shipment, a parcel will be added there.

Typical use case would be to generate labels separately for each parcel in a warehouse.

POST /v1/som/shipments.add_parcel HTTP/1.1
Host: api.ingrid.com
Accept: application/json
Content-Type: application/json
Authorization: Bearer base64-encoded-api-token

{
"site_id": "5ba74bc0-c44d-4abf-b3df-2acdedc7c8bc",
"shipment_id": "886772b7-ecb2-4a54-bcbb-5c6c60abcfa8"
}
HTTP/1.1 200 OK
Date: Mon, 01 Mar 2021 12:19:41 GMT
Content-Type: application/json
Content-Length: 1095
Connection: close
Vary: Accept-Encoding
x-trace-id: 01EZPVNNV2D664XW57S0GD96EM

{
"shipment": {
"id": "4659fc78-a9cf-4012-8709-6479e51aa119",
"site_id": "11756e4a98c64fa9a9c5d627fd88a236",
"customer_info": {
"address": {
"care_of": "Anders Ekman",
"address_lines": [
"Industrigatan 5"
],
"city": "Stockholm",
"postal_code": "11239",
"country": "SE"
},
"phone": "0761234561",
"email": "erik@example.com"
},
"meta": {
"is_fragile": "true"
},
"shipping_date": "2021-03-01T12:19:40Z",
"address_from": {
"name": "Acme, Main Warehouse",
"address_lines": [
"Frihamnsgatan 56"
],
"city": "Stockholm",
"postal_code": "11556",
"country": "SE"
},
"address_to": {
"name": "ICA Västermalmsgallerian",
"address_lines": [
"S:t Eriksgatan 45"
],
"city": "Stockholm",
"postal_code": "11234",
"country": "SE"
},
"line_items": [
{
"sku": "SKU12345",
"name": "Saucony Shadow 6000",
"quantity": "1",
"dimensions": {
"length": "600",
"height": "250",
"width": "300"
},
"tags": [
"shoes",
"indigo",
"class_one"
],
"weight": "720"
}
],
"parcels": [
{
"id": "316b6769-b537-4dd9-96f1-a824e747f8bb",
"shipment_id": "4659fc78-a9cf-4012-8709-6479e51aa119",
"deliveries": [
{
"id": "c3cbf98f-fe7a-4de1-ae78-3e2a36758c2a",
"parcel_id": "316b6769-b537-4dd9-96f1-a824e747f8bb",
"address_from": {
"name": "Acme, Main Warehouse",
"address_lines": [
"Frihamnsgatan 56"
],
"city": "Stockholm",
"postal_code": "11556",
"country": "SE"
},
"address_to": {
"name": "ICA Västermalmsgallerian",
"address_lines": [
"S:t Eriksgatan 45"
],
"city": "Stockholm",
"postal_code": "11234",
"country": "SE"
},
"shipping_method": "pnl-mpc",
"location_ref": "592971",
"delivery_status": "created",
"created_at": "2021-03-01T12:19:40Z",
"updated_at": "2021-03-01T12:19:40Z"
}
],
"created_at": "2021-03-01T12:19:40Z",
"updated_at": "2021-03-01T12:19:40Z",
"dimensions": {
"length": "600",
"height": "250",
"width": "300"
},
"weight": "720"
},
{
"id": "ddee0942-e5d8-4a9b-a2d0-69c256e66d60",
"shipment_id": "4659fc78-a9cf-4012-8709-6479e51aa119",
"deliveries": [
{
"id": "fcd7d87a-1772-4044-bc25-68a14de34203",
"parcel_id": "ddee0942-e5d8-4a9b-a2d0-69c256e66d60",
"address_from": {
"name": "Acme, Main Warehouse",
"address_lines": [
"Frihamnsgatan 56"
],
"city": "Stockholm",
"postal_code": "11556",
"country": "SE"
},
"address_to": {
"name": "ICA Västermalmsgallerian",
"address_lines": [
"S:t Eriksgatan 45"
],
"city": "Stockholm",
"postal_code": "11234",
"country": "SE"
},
"shipping_method": "pnl-mpc",
"location_ref": "592971",
"delivery_status": "created",
"created_at": "2021-03-01T13:29:40Z",
"updated_at": "2021-03-01T13:29:40Z"
}
],
"created_at": "2021-03-01T13:29:40Z",
"updated_at": "2021-03-01T13:29:40Z",
"dimensions": {
"length": "600",
"height": "250",
"width": "300"
},
"weight": "720"
}
],
"external_id": "ACME12345",
"shipment_value": "19900",
"tos_id": "01EZPVNN71H7JDH6B9HZ080YGH",
"contents": {
"goods": [
{
"sku": "SKU12345",
"name": "Saucony Shadow 6000",
"quantity": "1",
"dimensions": {
"length": "600",
"height": "250",
"width": "300"
},
"tags": [
"shoes",
"indigo",
"class_one"
],
"weight": "720"
}
]
},
"created_at": "2021-03-01T12:19:40Z",
"updated_at": "2021-03-01T12:19:40Z"
}
}

Last updated: Mon, Jan 17, 09:51 AM