Receive a Container
Receive a Container. The request example includes all fields documented for this event, including optional fields.
curl -X POST "https://connect.wholechain.com/Integration/Events" \
-H "Content-Type: application/json" \
-H "X-API-KEY: example_string" \
-d '{
"Events": [
{
"$type": "receive",
"ShipFromLocation": {
"Id": "processing_001",
"Details": {
"TradePartner": {
"Id": "processor_001",
"Name": "Processor Name",
"ConnectionType": "SELF",
"Duns": "123456789"
},
"Name": "Processing Facility",
"Gln": "9506000140445",
"Extension": "SomeExtension",
"DunsPlus4": "1234",
"ContactInformation": {
"Name": "Processing Contact",
"Phone": "+1234567890",
"Email": "processing@example.com"
},
"Address": {
"City": "Cape Town",
"State": "Western Cape",
"Country": "South Africa",
"AddressLine1": "123 Processing Street",
"AddressLine2": "Building 2",
"PostalCode": "8001",
"GeoCoordinates": {
"Latitude": -33.9249,
"Longitude": 18.4241
}
}
}
},
"ShipToLocation": {
"Id": "warehouse_001",
"Details": {
"TradePartner": {
"Id": "my_company",
"Name": "My Company",
"ConnectionType": "SELF",
"Duns": "987654321"
},
"Name": "Main Warehouse",
"Gln": "9506000140446",
"Extension": "WarehouseExtension",
"DunsPlus4": "1234",
"ContactInformation": {
"Name": "Warehouse Contact",
"Phone": "+1234567891",
"Email": "warehouse@example.com"
},
"Address": {
"City": "Cape Town",
"State": "Western Cape",
"Country": "South Africa",
"AddressLine1": "456 Warehouse Road",
"AddressLine2": "Building 2",
"PostalCode": "8002",
"GeoCoordinates": {
"Latitude": -33.925,
"Longitude": 18.425
}
}
}
},
"ProductInstances": [],
"Container": {
"Id": "container_001",
"Type": "LogisticId"
},
"Id": "receive_container_001",
"ShipEventId": "ship_container_001",
"PurchaseOrder": "PO-12345",
"InvoiceNumber": "INV-12345",
"EventTime": "2024-03-30T18:30:00",
"EventTimeZone": "-05:00",
"CustomProperties": [
{
"Name": "quality_grade",
"Namespace": "custom",
"Value": "A"
}
],
"CertificationList": [
{
"Type": "urn:gdst:certType:harvestCoC",
"Standard": "MSC Chain of Custody",
"Agency": "MSC",
"Value": "YES",
"Identification": "MSC-C-12345"
}
]
}
]
}'
import requests
import json
url = "https://connect.wholechain.com/Integration/Events"
headers = {
"Content-Type": "application/json",
"X-API-KEY": "example_string"
}
data = {
"Events": [
{
"$type": "receive",
"ShipFromLocation": {
"Id": "processing_001",
"Details": {
"TradePartner": {
"Id": "processor_001",
"Name": "Processor Name",
"ConnectionType": "SELF",
"Duns": "123456789"
},
"Name": "Processing Facility",
"Gln": "9506000140445",
"Extension": "SomeExtension",
"DunsPlus4": "1234",
"ContactInformation": {
"Name": "Processing Contact",
"Phone": "+1234567890",
"Email": "processing@example.com"
},
"Address": {
"City": "Cape Town",
"State": "Western Cape",
"Country": "South Africa",
"AddressLine1": "123 Processing Street",
"AddressLine2": "Building 2",
"PostalCode": "8001",
"GeoCoordinates": {
"Latitude": -33.9249,
"Longitude": 18.4241
}
}
}
},
"ShipToLocation": {
"Id": "warehouse_001",
"Details": {
"TradePartner": {
"Id": "my_company",
"Name": "My Company",
"ConnectionType": "SELF",
"Duns": "987654321"
},
"Name": "Main Warehouse",
"Gln": "9506000140446",
"Extension": "WarehouseExtension",
"DunsPlus4": "1234",
"ContactInformation": {
"Name": "Warehouse Contact",
"Phone": "+1234567891",
"Email": "warehouse@example.com"
},
"Address": {
"City": "Cape Town",
"State": "Western Cape",
"Country": "South Africa",
"AddressLine1": "456 Warehouse Road",
"AddressLine2": "Building 2",
"PostalCode": "8002",
"GeoCoordinates": {
"Latitude": -33.925,
"Longitude": 18.425
}
}
}
},
"ProductInstances": [],
"Container": {
"Id": "container_001",
"Type": "LogisticId"
},
"Id": "receive_container_001",
"ShipEventId": "ship_container_001",
"PurchaseOrder": "PO-12345",
"InvoiceNumber": "INV-12345",
"EventTime": "2024-03-30T18:30:00",
"EventTimeZone": "-05:00",
"CustomProperties": [
{
"Name": "quality_grade",
"Namespace": "custom",
"Value": "A"
}
],
"CertificationList": [
{
"Type": "urn:gdst:certType:harvestCoC",
"Standard": "MSC Chain of Custody",
"Agency": "MSC",
"Value": "YES",
"Identification": "MSC-C-12345"
}
]
}
]
}
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": "receive",
"ShipFromLocation": {
"Id": "processing_001",
"Details": {
"TradePartner": {
"Id": "processor_001",
"Name": "Processor Name",
"ConnectionType": "SELF",
"Duns": "123456789"
},
"Name": "Processing Facility",
"Gln": "9506000140445",
"Extension": "SomeExtension",
"DunsPlus4": "1234",
"ContactInformation": {
"Name": "Processing Contact",
"Phone": "+1234567890",
"Email": "processing@example.com"
},
"Address": {
"City": "Cape Town",
"State": "Western Cape",
"Country": "South Africa",
"AddressLine1": "123 Processing Street",
"AddressLine2": "Building 2",
"PostalCode": "8001",
"GeoCoordinates": {
"Latitude": -33.9249,
"Longitude": 18.4241
}
}
}
},
"ShipToLocation": {
"Id": "warehouse_001",
"Details": {
"TradePartner": {
"Id": "my_company",
"Name": "My Company",
"ConnectionType": "SELF",
"Duns": "987654321"
},
"Name": "Main Warehouse",
"Gln": "9506000140446",
"Extension": "WarehouseExtension",
"DunsPlus4": "1234",
"ContactInformation": {
"Name": "Warehouse Contact",
"Phone": "+1234567891",
"Email": "warehouse@example.com"
},
"Address": {
"City": "Cape Town",
"State": "Western Cape",
"Country": "South Africa",
"AddressLine1": "456 Warehouse Road",
"AddressLine2": "Building 2",
"PostalCode": "8002",
"GeoCoordinates": {
"Latitude": -33.925,
"Longitude": 18.425
}
}
}
},
"ProductInstances": [],
"Container": {
"Id": "container_001",
"Type": "LogisticId"
},
"Id": "receive_container_001",
"ShipEventId": "ship_container_001",
"PurchaseOrder": "PO-12345",
"InvoiceNumber": "INV-12345",
"EventTime": "2024-03-30T18:30:00",
"EventTimeZone": "-05:00",
"CustomProperties": [
{
"Name": "quality_grade",
"Namespace": "custom",
"Value": "A"
}
],
"CertificationList": [
{
"Type": "urn:gdst:certType:harvestCoC",
"Standard": "MSC Chain of Custody",
"Agency": "MSC",
"Value": "YES",
"Identification": "MSC-C-12345"
}
]
}
]
})
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
"bytes"
"encoding/json"
)
func main() {
data := []byte(`{
"Events": [
{
"$type": "receive",
"ShipFromLocation": {
"Id": "processing_001",
"Details": {
"TradePartner": {
"Id": "processor_001",
"Name": "Processor Name",
"ConnectionType": "SELF",
"Duns": "123456789"
},
"Name": "Processing Facility",
"Gln": "9506000140445",
"Extension": "SomeExtension",
"DunsPlus4": "1234",
"ContactInformation": {
"Name": "Processing Contact",
"Phone": "+1234567890",
"Email": "processing@example.com"
},
"Address": {
"City": "Cape Town",
"State": "Western Cape",
"Country": "South Africa",
"AddressLine1": "123 Processing Street",
"AddressLine2": "Building 2",
"PostalCode": "8001",
"GeoCoordinates": {
"Latitude": -33.9249,
"Longitude": 18.4241
}
}
}
},
"ShipToLocation": {
"Id": "warehouse_001",
"Details": {
"TradePartner": {
"Id": "my_company",
"Name": "My Company",
"ConnectionType": "SELF",
"Duns": "987654321"
},
"Name": "Main Warehouse",
"Gln": "9506000140446",
"Extension": "WarehouseExtension",
"DunsPlus4": "1234",
"ContactInformation": {
"Name": "Warehouse Contact",
"Phone": "+1234567891",
"Email": "warehouse@example.com"
},
"Address": {
"City": "Cape Town",
"State": "Western Cape",
"Country": "South Africa",
"AddressLine1": "456 Warehouse Road",
"AddressLine2": "Building 2",
"PostalCode": "8002",
"GeoCoordinates": {
"Latitude": -33.925,
"Longitude": 18.425
}
}
}
},
"ProductInstances": [],
"Container": {
"Id": "container_001",
"Type": "LogisticId"
},
"Id": "receive_container_001",
"ShipEventId": "ship_container_001",
"PurchaseOrder": "PO-12345",
"InvoiceNumber": "INV-12345",
"EventTime": "2024-03-30T18:30:00",
"EventTimeZone": "-05:00",
"CustomProperties": [
{
"Name": "quality_grade",
"Namespace": "custom",
"Value": "A"
}
],
"CertificationList": [
{
"Type": "urn:gdst:certType:harvestCoC",
"Standard": "MSC Chain of Custody",
"Agency": "MSC",
"Value": "YES",
"Identification": "MSC-C-12345"
}
]
}
]
}`)
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": "receive",
"ShipFromLocation": {
"Id": "processing_001",
"Details": {
"TradePartner": {
"Id": "processor_001",
"Name": "Processor Name",
"ConnectionType": "SELF",
"Duns": "123456789"
},
"Name": "Processing Facility",
"Gln": "9506000140445",
"Extension": "SomeExtension",
"DunsPlus4": "1234",
"ContactInformation": {
"Name": "Processing Contact",
"Phone": "+1234567890",
"Email": "processing@example.com"
},
"Address": {
"City": "Cape Town",
"State": "Western Cape",
"Country": "South Africa",
"AddressLine1": "123 Processing Street",
"AddressLine2": "Building 2",
"PostalCode": "8001",
"GeoCoordinates": {
"Latitude": -33.9249,
"Longitude": 18.4241
}
}
}
},
"ShipToLocation": {
"Id": "warehouse_001",
"Details": {
"TradePartner": {
"Id": "my_company",
"Name": "My Company",
"ConnectionType": "SELF",
"Duns": "987654321"
},
"Name": "Main Warehouse",
"Gln": "9506000140446",
"Extension": "WarehouseExtension",
"DunsPlus4": "1234",
"ContactInformation": {
"Name": "Warehouse Contact",
"Phone": "+1234567891",
"Email": "warehouse@example.com"
},
"Address": {
"City": "Cape Town",
"State": "Western Cape",
"Country": "South Africa",
"AddressLine1": "456 Warehouse Road",
"AddressLine2": "Building 2",
"PostalCode": "8002",
"GeoCoordinates": {
"Latitude": -33.925,
"Longitude": 18.425
}
}
}
},
"ProductInstances": [],
"Container": {
"Id": "container_001",
"Type": "LogisticId"
},
"Id": "receive_container_001",
"ShipEventId": "ship_container_001",
"PurchaseOrder": "PO-12345",
"InvoiceNumber": "INV-12345",
"EventTime": "2024-03-30T18:30:00",
"EventTimeZone": "-05:00",
"CustomProperties": [
{
"Name": "quality_grade",
"Namespace": "custom",
"Value": "A"
}
],
"CertificationList": [
{
"Type": "urn:gdst:certType:harvestCoC",
"Standard": "MSC Chain of Custody",
"Agency": "MSC",
"Value": "YES",
"Identification": "MSC-C-12345"
}
]
}
]
}'
response = http.request(request)
puts response.body
{
"message": "Events processed successfully",
"result": [
{
"id": "01a0d877-7871-79a5-a8c8-a2f45673633d",
"externalEventId": "receive_container_001",
"type": "Receive",
"status": "Created",
"eventDate": "2024-03-30T18:30:00+00:00",
"productInstances": [
{
"quantity": 190.75,
"lotSerial": "lot_001",
"status": "Created",
"id": "01a0d877-7871-7426-b365-3a587ad4f893",
"name": "Raw Goods",
"urn": "urn:gdst:wholechain.com:product:lot:class:raindropsolutions.rawgoods-1.lot_001"
}
],
"containers": [
{
"id": "container_001",
"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 Receive Container event records when a container is received into a Wholechain location.
The Receive event identifies:
- where the container came from using
ShipFromLocation - where the container was received using
ShipToLocation - which container was received using
Container - when the event occurred using
EventTime - the unique identifier of the Receive event using
Id
When receiving a container, the products contained within the container do not need to be listed individually in ProductInstances. The container is referenced using its Id.
Request Headers
| Header | Description | Example Value |
|---|---|---|
X-API-KEY | Your API key. | YOUR_API_KEY_HERE |
Content-Type | Content type of the request. | application/json |
accept | Response content type. | */* |
Request Body
Event Object
| Field | Type | Description | Required |
|---|---|---|---|
$type | STRING | Defines the event type. For a Receive event, use receive. | Yes |
ShipFromLocation | OBJECT | Location the container was received from. | Yes |
ShipToLocation | OBJECT | Location receiving the container. | Yes |
ProductInstances | ARRAY | Product instances being received. Leave this empty when receiving only a container. | No |
Container | OBJECT | Container being received. | Yes |
Id | STRING | Unique identifier for the Receive event. | Yes |
ShipEventId | STRING | ID of the specific Ship event being received, when applicable. | No |
PurchaseOrder | STRING | Purchase order associated with the Receive event. | No |
InvoiceNumber | STRING | Invoice number associated with the Receive event. | 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
ShipFromLocation identifies where the container came from.
The location and its associated trade partner can be included directly in the Receive event.
"ShipFromLocation": {
"Id": "processing_000",
"Details": {
"TradePartner": {
"Id": "TpId123",
"Name": "Me",
"ConnectionType": "SELF",
"Duns": "123456789"
},
"Name": "Processing",
"Gln": "9506000140445",
"Extension": "SomeExtension",
"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
}
}
}
}
Ship To Location
ShipToLocation identifies the location receiving the container.
It uses the same location structure as ShipFromLocation.
"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
}
}
}
}
Location Fields
The same location structure can be used for both ShipFromLocation and ShipToLocation.
| Field | Type | Description | Required |
|---|---|---|---|
Id | STRING | Unique identifier for the location. | Yes |
Details | OBJECT | Details associated with the location. | Required only if the location does not already exist |
Details.TradePartner | OBJECT | Trade partner associated with the location. | Yes |
Details.TradePartner.Id | STRING | Unique identifier for the trade partner. | Yes |
Details.TradePartner.Name | STRING | Name of the trade partner. | Yes |
Details.TradePartner.ConnectionType | STRING | Relationship type, e.g. SUPPLIER, BUYER, SELF, or OTHER. | Yes |
Details.TradePartner.Duns | STRING | DUNS number of the trade partner. | No |
Details.Name | STRING | Name of the location. | Yes |
Details.Gln | STRING | Global Location Number. | No |
Details.Extension | STRING | Additional location information. | No |
Details.DunsPlus4 | STRING | DUNS Plus 4 identifier, if applicable. | No |
Details.ContactInformation | OBJECT | Contact information associated with the location. | No |
Details.ContactInformation.Name | STRING | Contact person's name. | No |
Details.ContactInformation.Phone | STRING | Contact phone number. | No |
Details.ContactInformation.Email | STRING | Contact email address. | No |
Details.Address | OBJECT | Address of the location. | Yes |
Details.Address.City | STRING | City. | No |
Details.Address.State | STRING | State or province. | No |
Details.Address.Country | STRING | Country. | Yes |
Details.Address.AddressLine1 | STRING | Primary address line. | Yes |
Details.Address.AddressLine2 | STRING | Secondary address line. | No |
Details.Address.PostalCode | STRING | Postal code. | No |
Details.Address.GeoCoordinates | OBJECT | Geographic coordinates. | No |
Details.Address.GeoCoordinates.Latitude | DECIMAL | Latitude. | No |
Details.Address.GeoCoordinates.Longitude | DECIMAL | Longitude. | No |
Container
The Container object identifies the container being received.
"Container": {
"Id": "123456"
}
Container Fields
| Field | Type | Description | Required |
|---|---|---|---|
Id | STRING | Unique identifier for the container being received. | Yes |
The container must already exist from a previous container creation, aggregation, or shipment event.
When receiving a container, ProductInstances should remain empty:
"ProductInstances": []
The products associated with the container are identified through the container itself.
Receiving a Specific Ship Event
When the container was previously shipped through Wholechain, ShipEventId can be used to identify the specific Ship event being received.
"ShipEventId": "ship_0003"
Use this when the Receive event should be directly connected to a specific pending shipment.
For the Receive to succeed:
- The Ship exists and has not been received yet; otherwise 422 "The shipment was already received." or 404 "No pending ship event found with ExternalEventId matching ShipEventId:
<id>". - The Ship EventTime is earlier than the Receive EventTime; otherwise 409 "Event time must be greater than the previous event."
- Each Receive line has the same LotSerial and Quantity as the Ship; otherwise 422 "Receive line for lot '
<lot>' does not match the referenced ship." - ShipToLocation equals the Ship's ShipToLocation; otherwise 422 "Receive location does not match the ship destination."
When ShipEventId is provided, the ProductInstances on the Receive event are ignored. The product instances from the referenced Ship event are recorded instead.
Example Receive a Container Payload — All Fields
The following example shows the standard Receive Container payload with all supported location, container, and event fields covered in this documentation.
Fields that are not applicable should be omitted rather than submitted with empty values.
{
"Events": [
{
"$type": "receive",
"ShipFromLocation": {
"Id": "processing_000",
"Details": {
"TradePartner": {
"Id": "TpId123",
"Name": "Supplier Name",
"ConnectionType": "SUPPLIER",
"Duns": "123456789"
},
"Name": "Processing Location",
"Gln": "9506000140445",
"Extension": "SomeExtension",
"ContactInformation": {
"Name": "Supplier Contact",
"Phone": "+1234567890",
"Email": "supplier@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
}
}
}
},
"ShipToLocation": {
"Id": "buyer_000",
"Details": {
"TradePartner": {
"Id": "buyer_123",
"Name": "My Company",
"ConnectionType": "SELF",
"Duns": "987654321"
},
"Name": "Receiving Location",
"Gln": "9506000140446",
"Extension": "SomeExtension",
"DunsPlus4": "1234",
"ContactInformation": {
"Name": "Receiving Contact",
"Phone": "+1234567891",
"Email": "receiving@example.com"
},
"Address": {
"City": "City Name",
"State": "State Name",
"Country": "Country Name",
"AddressLine1": "456 Warehouse Road",
"AddressLine2": "Unit 4",
"PostalCode": "54321",
"GeoCoordinates": {
"Latitude": 12.345679,
"Longitude": 98.765433
}
}
}
},
"ProductInstances": [],
"Container": {
"Id": "123456"
},
"Id": "receive_container_0001",
"ShipEventId": "ship_0003",
"PurchaseOrder": "1990091",
"InvoiceNumber": "12314154",
"EventTime": "2026-09-24T10:00:00",
"EventTimeZone": "+00:00"
}
]
}
Certifications and Custom Event Data
Certifications and custom event-level data can also be added to a Receive Container event but are documented separately.
→ See: Certifications
For information on attaching certifications to an event, see the dedicated Certifications documentation.
→ See: Custom Event Data
For information on adding custom event fields using CustomProperties, see the dedicated Custom Event Data documentation.
How Location Creation Works
Locations and trade partners are supplied directly within the standard Receive payload.
The API uses the supplied IDs to determine whether they already exist:
- If the location or trade partner ID does not exist, Wholechain creates it using the supplied
Details. - If the ID already exists, Wholechain uses the existing entity associated with that ID.
- The same payload structure can therefore be used for both new and existing locations and trade partners.
Important Notes
- Use
$type: "receive"when receiving a container. ShipFromLocationidentifies where the container came from.ShipToLocationidentifies where the container is being received.- Use
Container.Idto identify the container being received. - When receiving only a container,
ProductInstancesshould be an empty array. - The contents of the container do not need to be listed individually in the Receive event.
PurchaseOrderandInvoiceNumberare optional.- Use
ShipEventIdwhen receiving against a specific existing Ship event. - Optional location and event fields should be omitted when they do not apply.
- Certifications and custom event data are documented separately.