Skip to main content

Add Attached eDoc

Attach any type of document to anything in CargoWise that has an eDocs tab. PDF's, Microsoft Word documents, text files, or anything else you want to attach as an eDoc.

Security

The utility can be restricted to specific API clients, the modules that eDocs can be attached too, and the types of eDocs that can be accepted.

API Requests

API requests are made up of a JSON body which includes properties to define the CargoWise target to attach the eDoc to and the eDoc itself.

The CargoWise target to attach the eDoc too can be defined directly if its unique key is known, or defined using search criteria if the unique key isn't know.

JSON request properties:

  • DataTargetType - The type of CargoWise record being targeted.
  • DataTargetKey - The unique key of the CargoWise record being targeted, if known.
  • DataTargetKeyShipmentSearchCriteria - Search criteria used to find a unique CargoWise record, when the unique key isn't known. Search criteria is made up of a collection of search criteria, each with the following properties:
    • Property: The property to match a value against.
    • Value: The value to match against.
  • DocumentTypeCode - The type of document to be attached as e.g. CIV for Commercial Invoice, PKL for Packing List, etc.
  • FileName - The file name of document to be attached.
  • FileContent - The file content of the document to be attached. This must be a Base64 encoded string.
  • IsPublished - Flag to indicate if the document to be attached should be published or private.

Direct key targeting example properties:

{
"DataTargetType": "WarehouseOrder",
"DataTargetKey": "W00012345",
...
}

Search criteria targeting example properties:

{
"DataTargetType": "WarehouseOrder",
"DataTargetKeyShipmentSearchCriteria": [
{
"Property": "/Shipment/Order/OrderNumber",
"Value": "SO-12345"
},
{
"Property": "/Shipment/OrganizationAddressCollection/OrganizationAddress/AddressType",
"Value": "ConsignorDocumentaryAddress"
},
{
"Property": "/Shipment/OrganizationAddressCollection/OrganizationAddress/OrganizationCode",
"Value": "TSTORGCHC"
}
],
...
}

Document to attach example properties:

{
...
"DocumentTypeCode": "CIV",
"FileName": "invoice.txt",
"FileContent": "Q29tcGxlY3QgZXhhbXBsZSBmaWxlLg==",
"IsPublished": false
}

Full example to add a Commercial Invoice text file document to a Warehouse Order located using search criteria:

{
"DataTargetType": "WarehouseOrder",
"DataTargetKeyShipmentSearchCriteria": [
{
"Property": "/Shipment/Order/OrderNumber",
"Value": "SO-12345"
},
{
"Property": "/Shipment/OrganizationAddressCollection/OrganizationAddress/AddressType",
"Value": "ConsignorDocumentaryAddress"
},
{
"Property": "/Shipment/OrganizationAddressCollection/OrganizationAddress/OrganizationCode",
"Value": "TSTORGCHC"
}
],
"DocumentTypeCode": "CIV",
"FileName": "invoice.txt",
"FileContent": "Q29tcGxlY3QgZXhhbXBsZSBmaWxlLg==",
"IsPublished": false
}