Locations & Trade PartnersUpdate a Vessel

Update a Vessel

Updates an existing vessel location. The location id and TradePartner.Id identify the records being updated and must remain unchanged.

curl -X PUT "https://connect.wholechain.com/Integration/Location" \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: example_string" \
  -d '{
  "Locations": [
    {
      "id": "VESSEL-001",
      "Details": {
        "TradePartner": {
          "Id": "OCEANIC-EXPORTS",
          "Name": "Oceanic Exports",
          "ConnectionType": "SUPPLIER"
        },
        "Name": "Vessel One",
        "Gln": "9506000140445",
        "Extension": "SomeExtension",
        "CaptainsName": "Captain John",
        "Duns": "123456789",
        "Vessel": {
          "VesselName": "Vessel One",
          "VesselFlagState": "United States",
          "IMONumber": "IMO1234567",
          "VesselSatelliteTrackingAuthority": "Tracking Authority",
          "VesselPublicRegistryLink": "https://example.com/vessel/VESSEL-001",
          "VesselRegistration": "REG123456",
          "UnloadingPort": "Port Name"
        },
        "ContactInformation": {
          "Name": "Contact Name",
          "Phone": "+1234567890",
          "Email": "contact@example.com"
        },
        "Address": {
          "City": "Home Port City",
          "State": "Home Port State",
          "Country": "United States",
          "AddressLine1": "123 Harbor Road",
          "AddressLine2": "Dock 4",
          "PostalCode": "12345",
          "GeoCoordinates": {
            "Latitude": 12.345678,
            "Longitude": 98.765432
          },
          "DisplayAddress": "123 Harbor Road, Home Port City, United States"
        }
      }
    }
  ]
}'
{}
PUT
/Integration/Location
PUT
Base URLstring

Target server for requests. Edit to use your own host.

Content-Typestring
Required

The media type of the request body

Options: application/json
header
X-API-KEYstring
Required

API key used to authenticate the request.

Request Preview
Response

Response will appear here after sending the request

Responses

Success. The live API documentation does not publish a response-body contract for this operation.

Introduction

This API allows you to update an existing vessel in Wholechain.

Because a vessel is stored as a location in Wholechain, the existing vessel is identified using its:

  • Location id
  • TradePartner.Id

These IDs identify the existing records and should remain unchanged when submitting an update.

You can update information such as:

  • Vessel name
  • Captain's name
  • Flag state
  • IMO number
  • Vessel registration
  • Satellite tracking authority
  • Public registry link
  • Unloading port
  • Contact information
  • Home port information
  • Trade partner name or connection type

The vessel-specific information is stored within the Vessel object. The current location structure supports CaptainsName separately as part of the main Details object.

How It Works

To update a vessel:

  1. Use the existing vessel location id.
  2. Use the existing TradePartner.Id.
  3. Include the updated vessel and location information.
  4. Submit the request using the update endpoint.

For example, if the existing vessel is:

TradePartner.Id: OCEANIC-EXPORTS
Location id: VESSEL-001
Vessel Name: Vessel One
Captain: Captain John

and the captain changes, the IDs remain the same:

TradePartner.Id: OCEANIC-EXPORTS
Location id: VESSEL-001
Vessel Name: Vessel One
Captain: Captain Sarah

You are updating the existing vessel, not creating a new vessel.


Important: Do Not Change the IDs

Location ID

The vessel location id identifies the existing vessel location.

When updating a vessel, use the same id that was originally used to create it.

Existing:
id: VESSEL-001

Update:
id: VESSEL-001

Do not provide a new Location ID when attempting to update an existing vessel.

Trade Partner ID

TradePartner.Id identifies the organization associated with the vessel.

When updating the vessel, use the existing TradePartner.Id.

Existing:
TradePartner.Id: OCEANIC-EXPORTS

Update:
TradePartner.Id: OCEANIC-EXPORTS

The trade partner name or relationship information may be updated, but the ID identifying that trade partner remains the same.


Request Headers

HeaderDescriptionExample Value
X-API-KEYYour Wholechain API key.<YOUR_API_KEY>
Content-TypeContent type of the request.application/json
acceptResponse content type.*/*

Payload Structure

The request contains a Locations array.

Each vessel contains:

  • Existing Location ID
  • Existing Trade Partner ID
  • Trade partner information
  • Vessel location information
  • Captain's name
  • Vessel information
  • Contact information
  • Home port information

The vessel uses the same underlying location structure as when it was created, including the standard location information and additional Vessel object.


Location Object

Column NameData TypeDescriptionRequired
idSTRINGExisting unique identifier of the vessel location. Use the same ID as the existing vessel.Yes
DetailsOBJECTContains the trade partner, location, and vessel information.Yes

Details Object

Column NameData TypeDescription
TradePartnerOBJECTIdentifies the existing trade partner associated with the vessel.
NameSTRINGName of the vessel location.
GlnSTRINGGlobal Location Number associated with the location, if applicable.
ExtensionSTRINGAdditional identifier or extension associated with the location.
CaptainsNameSTRINGName of the vessel captain.
DunsSTRINGDUNS number associated with the location.
VesselOBJECTContains vessel-specific information.
ContactInformationOBJECTContact information associated with the vessel.
AddressOBJECTHome port information associated with the vessel.

Trade Partner Object

The TradePartner object identifies the organization associated with the vessel.

Column NameData TypeDescription
IdSTRINGExisting Trade Partner ID. Keep this value unchanged when updating the existing trade partner.
NameSTRINGName of the trade partner.
ConnectionTypeSTRINGRelationship between the trade partner and your Wholechain account.

Connection Type

Supported connection types are:

Connection TypeDescription
SELFThe trade partner represents your own organization.
SUPPLIERThe trade partner supplies products or materials to your organization.
BUYERThe trade partner purchases products or materials from your organization.

The connection type describes the relationship between your Wholechain account and the trade partner, not the function of the vessel itself.


Vessel Object

The Vessel object contains the vessel-specific information that can be updated.

Column NameData TypeDescription
VesselNameSTRINGName of the vessel.
VesselFlagStateSTRINGCountry or state under which the vessel is registered or flagged.
IMONumberSTRINGInternational Maritime Organization number associated with the vessel, if applicable.
VesselSatelliteTrackingAuthoritySTRINGAuthority or system responsible for the vessel's satellite tracking.
VesselPublicRegistryLinkSTRINGPublic URL where vessel registration information can be verified.
VesselRegistrationSTRINGVessel registration number or identifier.
UnloadingPortSTRINGPort where the vessel unloads its catch or product.

These are the vessel-specific fields currently contained within the Wholechain Vessel object.


Contact Information Object

The contact information associated with the vessel can also be updated.

Column NameData TypeDescription
NameSTRINGName of the primary contact for the vessel.
PhoneSTRINGContact phone number.
EmailSTRINGContact email address.

Address Object

The Address object represents the home port associated with the vessel.

When updating the address information, provide the updated information for the vessel's home port.

This does not represent the vessel's current or live geographic position.

For example, if a vessel changes its registered home port from one port to another, the Address object can be updated to reflect the new home port.

Column NameData TypeDescription
CitySTRINGCity of the vessel's home port.
StateSTRINGState, province, or region of the home port.
CountrySTRINGCountry of the vessel's home port.
AddressLine1STRINGPrimary address line for the home port.
AddressLine2STRINGSecondary address line, if applicable.
PostalCodeSTRINGPostal or ZIP code of the home port.
GeoCoordinatesOBJECTLatitude and longitude of the home port.
DisplayAddressSTRINGFormatted human-readable address of the home port.

GeoCoordinates Object

Column NameData TypeDescription
LatitudeDECIMALLatitude of the vessel's home port.
LongitudeDECIMALLongitude of the vessel's home port.

The coordinates should identify the vessel's home port, not its position while at sea.


Example: Update Vessel Information

Assume VESSEL-001 already exists in Wholechain and belongs to OCEANIC-EXPORTS.

The following request updates information about that vessel while retaining the same Location ID and Trade Partner ID.

{
  "Locations": [
    {
      "id": "VESSEL-001",
      "Details": {
        "TradePartner": {
          "Id": "OCEANIC-EXPORTS",
          "Name": "Oceanic Exports",
          "ConnectionType": "SUPPLIER"
        },
        "Name": "Vessel One",
        "Gln": "9506000140445",
        "Extension": "SomeExtension",
        "CaptainsName": "Captain Sarah",
        "Duns": "123456789",
        "Vessel": {
          "VesselName": "Vessel One",
          "VesselFlagState": "United States",
          "IMONumber": "IMO1234567",
          "VesselSatelliteTrackingAuthority": "Updated Tracking Authority",
          "VesselPublicRegistryLink": "https://example.com/vessel/VESSEL-001",
          "VesselRegistration": "REG123456",
          "UnloadingPort": "Updated Port Name"
        },
        "ContactInformation": {
          "Name": "Contact Name",
          "Phone": "+1234567890",
          "Email": "contact@example.com"
        },
        "Address": {
          "City": "Home Port City",
          "State": "Home Port State",
          "Country": "United States",
          "AddressLine1": "123 Harbor Road",
          "AddressLine2": "Dock 4",
          "PostalCode": "12345",
          "GeoCoordinates": {
            "Latitude": 12.345678,
            "Longitude": 98.765432
          },
          "DisplayAddress": "123 Harbor Road, Home Port City, United States"
        }
      }
    }
  ]
}

In this example:

UNCHANGED
TradePartner.Id: OCEANIC-EXPORTS
Location id: VESSEL-001

UPDATED
Captain: Captain Sarah
Satellite Tracking Authority: Updated Tracking Authority
Unloading Port: Updated Port Name

The existing IDs allow Wholechain to identify which vessel and trade partner should be updated.


Example: Update the Vessel's Home Port

If the vessel's home port changes, keep the vessel and trade partner IDs the same and update the Address object.

{
  "Locations": [
    {
      "id": "VESSEL-001",
      "Details": {
        "TradePartner": {
          "Id": "OCEANIC-EXPORTS",
          "Name": "Oceanic Exports",
          "ConnectionType": "SUPPLIER"
        },
        "Name": "Vessel One",
        "Address": {
          "City": "New Home Port City",
          "State": "New Home Port State",
          "Country": "United States",
          "AddressLine1": "456 Harbor Road",
          "PostalCode": "54321",
          "GeoCoordinates": {
            "Latitude": 21.345678,
            "Longitude": 88.765432
          },
          "DisplayAddress": "456 Harbor Road, New Home Port City, United States"
        }
      }
    }
  ]
}

The Address update changes the vessel's home port information. It is not used to record movements or the vessel's current location.

What Can Be Updated?

You can update information associated with the vessel while continuing to use the existing vessel and trade partner IDs.

For example:

VESSEL-001
│
├── Vessel Name
├── Captain
├── Flag State
├── IMO Number
├── Vessel Registration
├── Satellite Tracking Authority
├── Public Registry Link
├── Unloading Port
├── Contact Information
└── Home Port Information

Important Notes

  • A vessel is stored as a location in Wholechain.
  • Use the existing vessel location id when updating a vessel.
  • Use the existing TradePartner.Id when updating the trade partner associated with the vessel.
  • Do not change the Location ID when attempting to update an existing vessel.
  • Do not change the Trade Partner ID when attempting to update the existing trade partner.
  • CaptainsName is stored in the main Details object.
  • Vessel-specific information is stored within the Vessel object.
  • The Address object represents the vessel's home port.
  • Address coordinates represent the home port and not the vessel's live geographic position.
  • Vessel information such as the captain, flag state, IMO number, registration, tracking authority, registry link, and unloading port can be updated.
  • Contact information associated with the vessel can be updated.
  • Trade partner details such as the name or ConnectionType can be updated while retaining the existing TradePartner.Id.
  • You can only update vessel/location records that belong to your account. Locations shared with your account by another trade partner are not editable through this update.
  • If you need to register a different vessel rather than modify the existing vessel, create a new vessel with its own unique Location ID instead.