Ship a Container
Ships an existing container. ProductInstances must be an empty array because the products are identified through the container.
curl -X POST "https://connect.wholechain.com/Integration/Events" \
-H "Content-Type: application/json" \
-H "X-API-KEY: example_string" \
-d '{
"Events": [
{
"$type": "ship",
"ShipFromLocation": {
"Id": "processing_000"
},
"ShipToLocation": {
"Id": "buyer_000",
"Details": {
"TradePartner": {
"Id": "buyer_123",
"Name": "BuyerTP",
"ConnectionType": "BUYER",
"Duns": "123456789"
},
"Name": "Buyer Location",
"Gln": "9506000140445",
"Extension": "SomeExtension",
"DunsPlus4": "1234",
"ContactInformation": {
"Name": "Contact Name",
"Phone": "+1234567890",
"Email": "contact@example.com"
},
"Address": {
"City": "City Name",
"State": "State Name",
"Country": "Country Name",
"AddressLine1": "123 Main St",
"AddressLine2": "Apt 4B",
"PostalCode": "12345",
"GeoCoordinates": {
"Latitude": 12.345678,
"Longitude": 98.765432
}
}
}
},
"ProductInstances": [],
"Container": {
"Id": "123456"
},
"Id": "0004",
"PurchaseOrder": "1990091",
"InvoiceNumber": "12314154",
"EventTime": "2024-03-30T16:00:00",
"EventTimeZone": "-05:00",
"CustomProperties": [
{
"Name": "expiry_date",
"Namespace": "custom",
"Value": "2024-03-30"
}
],
"CertificationList": [
{
"Type": "urn:gdst:certType:harvestCoC",
"Standard": "MSC Chain of Custody",
"Agency": "MSC",
"Value": "NO",
"Identification": "NA"
},
{
"Type": "urn:gdst:certType:fishingAuth",
"Standard": "Los Angeles Fishing Authorization",
"Agency": "Los Angeles Fishing Authorization",
"Value": "YES",
"Identification": "FA-2024-001"
},
{
"Type": "urn:gdst:certType:humanPolicy",
"Standard": "WHO Human Decency Policy",
"Agency": "WHO",
"Value": "YES",
"Identification": "WHO-2024-001"
}
]
}
]
}'
import requests
import json
url = "https://connect.wholechain.com/Integration/Events"
headers = {
"Content-Type": "application/json",
"X-API-KEY": "example_string"
}
data = {
"Events": [
{
"$type": "ship",
"ShipFromLocation": {
"Id": "processing_000"
},
"ShipToLocation": {
"Id": "buyer_000",
"Details": {
"TradePartner": {
"Id": "buyer_123",
"Name": "BuyerTP",
"ConnectionType": "BUYER",
"Duns": "123456789"
},
"Name": "Buyer Location",
"Gln": "9506000140445",
"Extension": "SomeExtension",
"DunsPlus4": "1234",
"ContactInformation": {
"Name": "Contact Name",
"Phone": "+1234567890",
"Email": "contact@example.com"
},
"Address": {
"City": "City Name",
"State": "State Name",
"Country": "Country Name",
"AddressLine1": "123 Main St",
"AddressLine2": "Apt 4B",
"PostalCode": "12345",
"GeoCoordinates": {
"Latitude": 12.345678,
"Longitude": 98.765432
}
}
}
},
"ProductInstances": [],
"Container": {
"Id": "123456"
},
"Id": "0004",
"PurchaseOrder": "1990091",
"InvoiceNumber": "12314154",
"EventTime": "2024-03-30T16:00:00",
"EventTimeZone": "-05:00",
"CustomProperties": [
{
"Name": "expiry_date",
"Namespace": "custom",
"Value": "2024-03-30"
}
],
"CertificationList": [
{
"Type": "urn:gdst:certType:harvestCoC",
"Standard": "MSC Chain of Custody",
"Agency": "MSC",
"Value": "NO",
"Identification": "NA"
},
{
"Type": "urn:gdst:certType:fishingAuth",
"Standard": "Los Angeles Fishing Authorization",
"Agency": "Los Angeles Fishing Authorization",
"Value": "YES",
"Identification": "FA-2024-001"
},
{
"Type": "urn:gdst:certType:humanPolicy",
"Standard": "WHO Human Decency Policy",
"Agency": "WHO",
"Value": "YES",
"Identification": "WHO-2024-001"
}
]
}
]
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
const response = await fetch("https://connect.wholechain.com/Integration/Events", {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-API-KEY": "example_string"
},
body: JSON.stringify({
"Events": [
{
"$type": "ship",
"ShipFromLocation": {
"Id": "processing_000"
},
"ShipToLocation": {
"Id": "buyer_000",
"Details": {
"TradePartner": {
"Id": "buyer_123",
"Name": "BuyerTP",
"ConnectionType": "BUYER",
"Duns": "123456789"
},
"Name": "Buyer Location",
"Gln": "9506000140445",
"Extension": "SomeExtension",
"DunsPlus4": "1234",
"ContactInformation": {
"Name": "Contact Name",
"Phone": "+1234567890",
"Email": "contact@example.com"
},
"Address": {
"City": "City Name",
"State": "State Name",
"Country": "Country Name",
"AddressLine1": "123 Main St",
"AddressLine2": "Apt 4B",
"PostalCode": "12345",
"GeoCoordinates": {
"Latitude": 12.345678,
"Longitude": 98.765432
}
}
}
},
"ProductInstances": [],
"Container": {
"Id": "123456"
},
"Id": "0004",
"PurchaseOrder": "1990091",
"InvoiceNumber": "12314154",
"EventTime": "2024-03-30T16:00:00",
"EventTimeZone": "-05:00",
"CustomProperties": [
{
"Name": "expiry_date",
"Namespace": "custom",
"Value": "2024-03-30"
}
],
"CertificationList": [
{
"Type": "urn:gdst:certType:harvestCoC",
"Standard": "MSC Chain of Custody",
"Agency": "MSC",
"Value": "NO",
"Identification": "NA"
},
{
"Type": "urn:gdst:certType:fishingAuth",
"Standard": "Los Angeles Fishing Authorization",
"Agency": "Los Angeles Fishing Authorization",
"Value": "YES",
"Identification": "FA-2024-001"
},
{
"Type": "urn:gdst:certType:humanPolicy",
"Standard": "WHO Human Decency Policy",
"Agency": "WHO",
"Value": "YES",
"Identification": "WHO-2024-001"
}
]
}
]
})
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
"bytes"
"encoding/json"
)
func main() {
data := []byte(`{
"Events": [
{
"$type": "ship",
"ShipFromLocation": {
"Id": "processing_000"
},
"ShipToLocation": {
"Id": "buyer_000",
"Details": {
"TradePartner": {
"Id": "buyer_123",
"Name": "BuyerTP",
"ConnectionType": "BUYER",
"Duns": "123456789"
},
"Name": "Buyer Location",
"Gln": "9506000140445",
"Extension": "SomeExtension",
"DunsPlus4": "1234",
"ContactInformation": {
"Name": "Contact Name",
"Phone": "+1234567890",
"Email": "contact@example.com"
},
"Address": {
"City": "City Name",
"State": "State Name",
"Country": "Country Name",
"AddressLine1": "123 Main St",
"AddressLine2": "Apt 4B",
"PostalCode": "12345",
"GeoCoordinates": {
"Latitude": 12.345678,
"Longitude": 98.765432
}
}
}
},
"ProductInstances": [],
"Container": {
"Id": "123456"
},
"Id": "0004",
"PurchaseOrder": "1990091",
"InvoiceNumber": "12314154",
"EventTime": "2024-03-30T16:00:00",
"EventTimeZone": "-05:00",
"CustomProperties": [
{
"Name": "expiry_date",
"Namespace": "custom",
"Value": "2024-03-30"
}
],
"CertificationList": [
{
"Type": "urn:gdst:certType:harvestCoC",
"Standard": "MSC Chain of Custody",
"Agency": "MSC",
"Value": "NO",
"Identification": "NA"
},
{
"Type": "urn:gdst:certType:fishingAuth",
"Standard": "Los Angeles Fishing Authorization",
"Agency": "Los Angeles Fishing Authorization",
"Value": "YES",
"Identification": "FA-2024-001"
},
{
"Type": "urn:gdst:certType:humanPolicy",
"Standard": "WHO Human Decency Policy",
"Agency": "WHO",
"Value": "YES",
"Identification": "WHO-2024-001"
}
]
}
]
}`)
req, err := http.NewRequest("POST", "https://connect.wholechain.com/Integration/Events", bytes.NewBuffer(data))
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("X-API-KEY", "example_string")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
require 'net/http'
require 'json'
uri = URI('https://connect.wholechain.com/Integration/Events')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['Content-Type'] = 'application/json'
request['X-API-KEY'] = 'example_string'
request.body = '{
"Events": [
{
"$type": "ship",
"ShipFromLocation": {
"Id": "processing_000"
},
"ShipToLocation": {
"Id": "buyer_000",
"Details": {
"TradePartner": {
"Id": "buyer_123",
"Name": "BuyerTP",
"ConnectionType": "BUYER",
"Duns": "123456789"
},
"Name": "Buyer Location",
"Gln": "9506000140445",
"Extension": "SomeExtension",
"DunsPlus4": "1234",
"ContactInformation": {
"Name": "Contact Name",
"Phone": "+1234567890",
"Email": "contact@example.com"
},
"Address": {
"City": "City Name",
"State": "State Name",
"Country": "Country Name",
"AddressLine1": "123 Main St",
"AddressLine2": "Apt 4B",
"PostalCode": "12345",
"GeoCoordinates": {
"Latitude": 12.345678,
"Longitude": 98.765432
}
}
}
},
"ProductInstances": [],
"Container": {
"Id": "123456"
},
"Id": "0004",
"PurchaseOrder": "1990091",
"InvoiceNumber": "12314154",
"EventTime": "2024-03-30T16:00:00",
"EventTimeZone": "-05:00",
"CustomProperties": [
{
"Name": "expiry_date",
"Namespace": "custom",
"Value": "2024-03-30"
}
],
"CertificationList": [
{
"Type": "urn:gdst:certType:harvestCoC",
"Standard": "MSC Chain of Custody",
"Agency": "MSC",
"Value": "NO",
"Identification": "NA"
},
{
"Type": "urn:gdst:certType:fishingAuth",
"Standard": "Los Angeles Fishing Authorization",
"Agency": "Los Angeles Fishing Authorization",
"Value": "YES",
"Identification": "FA-2024-001"
},
{
"Type": "urn:gdst:certType:humanPolicy",
"Standard": "WHO Human Decency Policy",
"Agency": "WHO",
"Value": "YES",
"Identification": "WHO-2024-001"
}
]
}
]
}'
response = http.request(request)
puts response.body
{
"message": "Events processed successfully",
"result": [
{
"id": "01a0d877-7871-79a5-a8c8-a2f45673633d",
"externalEventId": "ship_container_001",
"type": "Ship",
"status": "Created",
"eventDate": "2024-03-30T16:00:00+00:00",
"productInstances": [],
"containers": [
{
"id": "123456",
"status": "Created"
}
],
"directShipFallback": null,
"externalShipmentFailure": null
}
],
"locations": [
{
"id": "01a0d877-76de-7e96-ac8c-962a914952bf",
"status": "Created"
}
],
"products": [
{
"id": "01a0d877-7719-720e-8fd8-224e3fec0602",
"status": "Created"
}
],
"errors": [],
"validations": []
}
/Integration/Events
Target server for requests. Edit to use your own host.
The media type of the request body
API key used to authenticate the request.
Required. events.
Request Preview
Response
Response will appear here after sending the request
Responses
Optional. message.
Optional. result.
Optional. locations.
Optional. products.
Optional. errors.
Optional. validations.
Introduction
A Ship Container event records the movement of an existing container from one Location to another.
A container shipment can represent either:
- Internal movement — for example, shipping a container from one warehouse to another Location within your business.
- External movement — for example, shipping a container from your Location to a customer, buyer, or other external Trade Partner.
The event identifies:
- The container being shipped
- The Location it is shipping from
- The Location it is shipping to
- The date and time the shipment occurred
The purpose of this endpoint is to create a Ship event for a container in Wholechain.
Creating a Ship Container Event
Submit an event payload containing:
- The event information
- The Location the container is shipping from
- The Location the container is shipping to
- The container identifier
- The date and time of the shipment
Wholechain uses Container.Id to identify the container being shipped.
Use the Required column in the tables below to determine which fields must be provided.
Event Object
| Column Name | Data Type | Description | Required |
|---|---|---|---|
$type | STRING | Defines the event type. Use ship. | Yes |
Id | STRING | Unique identifier for the Ship event. | Yes |
PurchaseOrder | STRING | Purchase order associated with the shipment. | No |
InvoiceNumber | STRING | Invoice number associated with the shipment. | No |
EventTime | DATETIME | Local date and time when the event occurred, without a UTC offset, for example 2024-03-30T13:00:00. The time zone is taken from EventTimeZone. Any offset included in this value is ignored. | Yes |
EventTimeZone | STRING | Optional. Time zone of the event as a UTC offset in ±HH:MM format, for example -05:00. If omitted, the account's default time zone (selected when the account was created) is used. | No |
Ship From Location
Every Ship Container event must identify the Location where the container is shipping from.
| Column Name | Data Type | Description | Required |
|---|---|---|---|
ShipFromLocation.Id | STRING | Unique identifier for the Location the container is shipping from. | Yes |
Example
"ShipFromLocation": {
"Id": "processing_000"
}
The Ship From Location is the Location where the container exists before the shipment is processed.
Ship To Location
Every Ship Container event must identify the destination Location.
The destination can be:
- Another Location within your own business
- A Location belonging to an external Trade Partner
| Column Name | Data Type | Description | Required |
|---|---|---|---|
ShipToLocation.Id | STRING | Unique identifier for the destination Location. | Yes |
ShipToLocation.Details | OBJECT | Information used to create the destination Location if it does not already exist. | Yes, if the Location does not exist |
Existing Destination Location
If the destination Location already exists in Wholechain, only its Id needs to be supplied:
"ShipToLocation": {
"Id": "warehouse_002"
}
Creating a Destination Location
If the supplied ShipToLocation.Id does not exist, include the Details object.
Wholechain uses this information to create the destination Location before processing the Ship Container event.
"ShipToLocation": {
"Id": "buyer_000",
"Details": {
"TradePartner": {
"Id": "buyer_123",
"Name": "BuyerTP",
"ConnectionType": "BUYER",
"Duns": "123456789"
},
"Name": "Buyer Location",
"Gln": "9506000140445",
"Extension": "SomeExtension",
"DunsPlus4": "1234",
"ContactInformation": {
"Name": "Contact Name",
"Phone": "+1234567890",
"Email": "contact@example.com"
},
"Address": {
"City": "City Name",
"State": "State Name",
"Country": "Country Name",
"AddressLine1": "123 Main St",
"AddressLine2": "Apt 4B",
"PostalCode": "12345",
"GeoCoordinates": {
"Latitude": 12.345678,
"Longitude": 98.765432
}
}
}
}
The same structure can be used when the destination is another Location within your business.
Trade Partner
Every Location belongs to a Trade Partner.
| Column Name | Data Type | Description | Required |
|---|---|---|---|
TradePartner | OBJECT | Trade Partner associated with the destination Location. | Yes, if creating the Location |
TradePartner.Id | STRING | Unique identifier for the Trade Partner. | Yes, if creating the Trade Partner |
TradePartner.Name | STRING | Name of the Trade Partner. | Yes, if creating the Trade Partner |
TradePartner.ConnectionType | STRING | Relationship to the Trade Partner, such as SELF, SUPPLIER, BUYER, or OTHER. | Yes, if creating the Trade Partner |
TradePartner.Duns | STRING | DUNS number associated with the Trade Partner. | No |
If the Trade Partner already exists in Wholechain, reference its existing ID.
If it does not exist, Wholechain creates it from the supplied information before creating the Location.
Internal Shipment
For a shipment between Locations within your business, use:
"ConnectionType": "SELF"
External Shipment
For a shipment to an external customer or buyer, use:
"ConnectionType": "BUYER"
Location Information
| Column Name | Data Type | Description | Required |
|---|---|---|---|
Name | STRING | Name of the Location. | Yes, if creating the Location |
Gln | STRING | Global Location Number. | No |
Extension | STRING | Additional Location information. | No |
DunsPlus4 | STRING | DUNS Plus 4 identifier, when applicable. | No |
ContactInformation | OBJECT | Contact information associated with the Location. | No |
ContactInformation.Name | STRING | Name of the contact person. | No |
ContactInformation.Phone | STRING | Phone number of the contact person. | No |
ContactInformation.Email | STRING | Email address of the contact person. | No |
Address
| Column Name | Data Type | Description | Required |
|---|---|---|---|
Address | OBJECT | Address information for the Location. | Yes, if creating the Location |
Address.City | STRING | City where the Location is situated. | No |
Address.State | STRING | State or region where the Location is situated. | No |
Address.Country | STRING | Country of the Location. | Yes, if creating the Location |
Address.AddressLine1 | STRING | Primary address line. | Yes, if creating the Location |
Address.AddressLine2 | STRING | Secondary address line. | No |
Address.PostalCode | STRING | Postal code. | No |
Address.GeoCoordinates | OBJECT | Geographical coordinates. | No |
Address.GeoCoordinates.Latitude | DECIMAL | Latitude of the Location. | No |
Address.GeoCoordinates.Longitude | DECIMAL | Longitude of the Location. | No |
Container
The Container object identifies the container being shipped.
| Column Name | Data Type | Description | Required |
|---|---|---|---|
Container | OBJECT | Container being shipped. | Yes |
Container.Id | STRING | Unique identifier for the container. | Yes |
Example
"Container": {
"Id": "123456"
}
The container must already exist in Wholechain before it can be shipped.
Complete Request Example
The following example ships a container from an existing source Location to an external buyer Location.
If the destination Location or Trade Partner does not exist, Wholechain creates it from the supplied details.
{
"Events": [
{
"$type": "ship",
"ShipFromLocation": {
"Id": "processing_000"
},
"ShipToLocation": {
"Id": "buyer_000",
"Details": {
"TradePartner": {
"Id": "buyer_123",
"Name": "BuyerTP",
"ConnectionType": "BUYER",
"Duns": "123456789"
},
"Name": "Buyer Location",
"Gln": "9506000140445",
"Extension": "SomeExtension",
"DunsPlus4": "1234",
"ContactInformation": {
"Name": "Contact Name",
"Phone": "+1234567890",
"Email": "contact@example.com"
},
"Address": {
"City": "City Name",
"State": "State Name",
"Country": "Country Name",
"AddressLine1": "123 Main St",
"AddressLine2": "Apt 4B",
"PostalCode": "12345",
"GeoCoordinates": {
"Latitude": 12.345678,
"Longitude": 98.765432
}
}
}
},
"Container": {
"Id": "123456"
},
"Id": "0004",
"PurchaseOrder": "1990091",
"InvoiceNumber": "12314154",
"EventTime": "2024-03-30T16:00:00",
"EventTimeZone": "-05:00",
"CustomProperties": [
{
"Name": "expiry_date",
"Namespace": "TEST",
"Value": "2024-03-30",
"PropertyLocation": "ILMD"
}
],
"CertificationList": [
{
"Type": "urn:gdst:certType:harvestCoC",
"Standard": "MSC Chain of Custody",
"Agency": "MSC",
"Value": "NO",
"Identification": "NA"
},
{
"Type": "urn:gdst:certType:fishingAuth",
"Standard": "Los Angeles Fishing Authorization",
"Agency": "Los Angeles Fishing Authorization",
"Value": "",
"Identification": ""
},
{
"Type": "urn:gdst:certType:humanPolicy",
"Standard": "WHO Human Decency Policy",
"Agency": "WHO",
"Value": "",
"Identification": ""
}
]
}
]
}
Internal and External Container Shipments
Internal Shipment
Warehouse A → Warehouse B
Both Locations belong to your business.
External Shipment
Your Location → Buyer Location
The Ship From Location belongs to your business, and the Ship To Location belongs to the external Trade Partner.
How Wholechain Processes the Event
When a Ship Container event is submitted, Wholechain:
- Identifies the Ship From Location.
- Identifies the Ship To Location.
- Creates the Ship To Location and Trade Partner when they do not already exist and the required details are supplied.
- Identifies the container using
Container.Id. - Creates the Ship event and records the container's movement to the Ship To Location.
Important Notes
- Use
$type: "ship"when shipping a container. ShipFromLocation.Ididentifies where the container is shipping from.ShipToLocation.Ididentifies where the container is shipping to.- Use
Container.Idto identify the container being shipped. PurchaseOrderandInvoiceNumberare optional.- Optional fields should be omitted when they do not apply.