Locations & Trade PartnersUpdate a Location / Trade Partner

Update Trade Partners & Locations

Updates a standard location or its associated trade-partner information. The existing location id and TradePartner.Id identify the records being updated.

curl -X PUT "https://connect.wholechain.com/Integration/Location" \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: example_string" \
  -d '{
  "Location": {
    "id": "OCEANIC-PLANT-001",
    "Details": {
      "TradePartner": {
        "Id": "OCEANIC-EXPORTS",
        "Name": "Oceanic Exports",
        "ConnectionType": "SUPPLIER"
      },
      "Name": "Oceanic Processing Plant",
      "Gln": "9506000140445",
      "Extension": "PLANT-A",
      "Duns": "123456789",
      "ContactInformation": {
        "Name": "Maria Jacobs",
        "Phone": "+27 21 555 0142",
        "Email": "maria.jacobs@oceanicexports.example"
      },
      "Address": {
        "City": "Cape Town",
        "State": "Western Cape",
        "Country": "South Africa",
        "AddressLine1": "12 Marine Drive",
        "AddressLine2": "Paarden Eiland",
        "PostalCode": "7405",
        "GeoCoordinates": {
          "Latitude": -33.9208,
          "Longitude": 18.474
        },
        "DisplayAddress": "12 Marine Drive, Paarden Eiland, Cape Town, Western Cape, South Africa, 7405"
      }
    }
  }
}'
{
  "message": "Success",
  "result": {
    "id": "01a0e83e-dcd2-76e0-b008-5f4693db2d76",
    "accountId": "5a6b41f6-5a48-4a54-b94c-4a89125b7c7d",
    "tradePartnerId": "01a0e83e-dcc8-7cbf-843c-a896fd05ce90",
    "networkStatus": "NonWholechain",
    "tradePartnerName": "Oceanic Exports",
    "tradePartnerUrn": "urn:gdst:wholechain.com:party:oceanicexports.0",
    "name": "Oceanic Processing Plant",
    "gln": "9506000140445",
    "duns": null,
    "externalIdentifier": "OCEANIC-PLANT-001",
    "extension": "PLANT-A",
    "captainsName": null,
    "urn": "urn:gdst:wholechain.com:location:loc:oceanagroupltd.oceanicprocessingplant",
    "hasActiveInventory": false,
    "address": {
      "city": "Cape Town",
      "state": "Western Cape",
      "country": "South Africa",
      "addressLine1": "12 Marine Drive",
      "addressLine2": "Paarden Eiland",
      "postalCode": "7405",
      "geoCoordinates": {
        "latitude": -33.9208,
        "longitude": 18.474
      },
      "displayAddress": "12 Marine Drive, Paarden Eiland, Cape Town, Western Cape, South Africa"
    },
    "contact": null,
    "vessel": null,
    "wholechainId": null,
    "sharedWith": [],
    "createdTime": null,
    "isDefault": false,
    "geoJson": null,
    "foodFacilityRegistrationNumber": null,
    "locationGroupId": null,
    "locationType": null,
    "locationGroup": null,
    "dataPolicyElements": null,
    "ownerInfo": null
  },
  "errors": [],
  "validations": []
}
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

messagestring
Required
resultobject
Required
errorsobject[]
Required
validationsobject[]
Required

Introduction

This API allows you to update an existing trade partner, location, or vessel in Wholechain.

To update a record, use its existing ID and submit the fields that need to be changed.

Important: IDs cannot be changed.

  • TradePartner.Id cannot be updated.
  • Location id cannot be updated.
  • Use the existing ID to identify the record you want to update.

You can only update records that belong to your own Wholechain account.

Locations that have been shared to your account by another Wholechain account cannot be edited.

For vessel updates, see Updating a vessel.


Update a Trade Partner

To update a trade partner, provide the existing TradePartner.Id together with the updated trade partner details.

You can update fields such as:

  • Name
  • ConnectionType

Example

{
  "Locations": [
    {
      "id": "LOCATION-001",
      "Details": {
        "TradePartner": {
          "Id": "TP-001",
          "Name": "Updated Trade Partner Name",
          "ConnectionType": "SUPPLIER"
        }
      }
    }
  ]
}

In this example:

  • TP-001 identifies the existing trade partner.
  • The trade partner ID remains unchanged.
  • The trade partner name and connection type are updated.

Update a Location

To update a location, provide the existing location id and the existing TradePartner.Id, then submit the updated location details.

The location ID itself cannot be changed.

Example

{
  "Locations": [
    {
      "id": "LOCATION-001",
      "Details": {
        "TradePartner": {
          "Id": "TP-001",
          "Name": "Oceanic Exports",
          "ConnectionType": "SUPPLIER"
        },
        "Name": "Updated Processing Plant Name",
        "Gln": "9506000140445",
        "Extension": "UpdatedExtension",
        "ContactInformation": {
          "Name": "New Contact Name",
          "Phone": "+1234567890",
          "Email": "newcontact@example.com"
        },
        "Address": {
          "City": "Updated City",
          "State": "Updated State",
          "Country": "United States",
          "AddressLine1": "456 New Address",
          "PostalCode": "12345"
        }
      }
    }
  ]
}

Important Notes

  • TradePartner.Id cannot be changed.
  • Location id cannot be changed.
  • Always use the existing ID to identify the record being updated.
  • Trade partner details such as Name and ConnectionType can be updated.
  • Location details such as name, address, contact information, GLN, and extension can be updated.
  • Locations shared to your account by another Wholechain account are read-only and cannot be updated.