TWIN Supply Chain Docs
API Reference

Read Consignments

List and retrieve consignments, their events, and attached documents.

Use these endpoints to read consignments your organisation has published or that have been shared with you. All endpoints are read-only — to publish data see Publish Data.

Every request requires Cookie: access_token=<jwt>. See Authentication.


GET /supply-chain/data-space/consignments

GET /supply-chain/data-space/consignments
Cookie: access_token=<jwt>

List Consignments

Returns a paginated list of all consignments visible to your organisation.

Query parameters

ParameterTypeRequiredDescription
cursorstringNoCursor returned by the previous response — omit to start from the beginning
limitnumberNoNumber of results per page

Response 200

{
  "entities": [...],
  "cursor": "<next-page-cursor>"
}

cursor is omitted when there are no more results. Each item in entities follows this schema:

{
	"$schema": "https://json-schema.org/draft/2020-12/schema",
	"$id": "https://schema.twindev.org/supply-chain/ConsignmentOverview",
	"title": "ConsignmentOverview",
	"description": "Consignment overview interface for listing operations (supports both v1 and v2 payloads).",
	"type": "object",
	"properties": {
		"id": {
			"type": "string",
			"description": "A unique record id for this supply chain consignment in AIG."
		},
		"aigId": {
			"type": "string",
			"description": "The AIG vertex id for this consignment."
		},
		"identifier": {
			"type": "string",
			"description": "Unique identifier representing the consignment in supply chain."
		},
		"globalId": {
			"type": "string",
			"description": "Unique globalId identifier representing the consignment in supply chain."
		},
		"transportId": {
			"type": "string",
			"description": "Transport id for the consignment"
		},
		"dateOfEntry": {
			"type": "string",
			"description": "Entry date of the consignment"
		},
		"portOfEntry": {
			"type": "string",
			"description": "Entry location of the consignment"
		},
		"portOfExit": {
			"type": "string",
			"description": "Exit location of the consignment"
		},
		"firstConsignor": {
			"$ref": "https://schema.twindev.org/unece/UneceTradeParty",
			"description": "The first consignor of the consignment, which is the party that initially sent the goods."
		},
		"lastConsignee": {
			"$ref": "https://schema.twindev.org/unece/UneceTradeParty",
			"description": "The last consignee of the consignment"
		},
		"tradeParty": {
			"type": "array",
			"items": {
				"$ref": "https://schema.twindev.org/unece/UneceTradeParty"
			},
			"description": "The import and exporter of the consignment"
		},
		"carrierParty": {
			"$ref": "https://schema.twindev.org/unece/UneceTradeParty",
			"description": "The carrier party responsible for the consignment"
		},
		"commodities": {
			"type": "array",
			"items": {
				"$ref": "https://schema.twindev.org/unece/UneceConsignmentItem"
			},
			"description": "Commodities in the consignment"
		},
		"reference": {
			"type": "string",
			"description": "Reference field for the goods load (v2)."
		},
		"transportModeCode": {
			"type": "string",
			"description": "Transport mode code."
		},
		"transportMeans": {
			"type": "array",
			"items": {
				"$ref": "https://schema.twindev.org/unece/UneceLogisticsTransportEquipment"
			},
			"description": "Details of the transport means used for the consignment"
		},
		"latestStatus": {
			"type": "object",
			"properties": {
				"name": {
					"type": "string",
					"description": "Status name."
				},
				"date": {
					"type": "string",
					"description": "Status date."
				}
			},
			"required": [
				"name",
				"date"
			],
			"description": "Latest status information e.g. Planned."
		},
		"dateCreated": {
			"type": "string",
			"description": "The date when this entry was created."
		},
		"dateUpdated": {
			"type": "string",
			"description": "The date when this entry was updated."
		},
		"payloadVersion": {
			"type": "string",
			"description": "Payload version (v1 for Consignment, v2 for GoodsLoad)."
		}
	},
	"required": [
		"id",
		"identifier",
		"latestStatus",
		"dateCreated"
	]
}

Errors

StatusCause
401Missing or invalid credentials

GET /supply-chain/data-space/consignments/:id

GET /supply-chain/data-space/consignments/:id
Cookie: access_token=<jwt>

Get a Consignment

Returns the full consignment. :id accepts globalId or identifier.

Response 200

The response is IConsignmentView: all UNECE D23B fields as originally published, plus the following TWIN-specific fields:

FieldTypeRequiredDescription
idstringYesTWIN's internal ID for this consignment
createdstringYesISO 8601 creation timestamp
updatedstringYesISO 8601 last-updated timestamp
documentsarrayYesDocuments attached to this consignment
eventsarrayYesSupply chain events added via Add — see events
systemEventsarrayNoEvents generated automatically by TWIN — see systemEvents
includedConsignmentsarrayNoNested consignments associated with this one
resolvedTransportModeobjectNoTransport mode with human-readable label — see resolvedTransportMode
resolvedTransportEquipmentarrayNoEquipment list with resolved type codes — see resolvedTransportEquipment
events

Supply chain events added via Add. Each item is the full event object as published and contains at minimum:

FieldTypeDescription
typeCodestringOne of the twin:* event type codes — see Add an event
occurrenceDateTimestringISO 8601 timestamp
occurrenceLocationobjectLocation where the event occurred — LogisticsLocation
systemEvents

Events generated automatically by TWIN in response to network activity.

Schema:

{
	"$schema": "https://json-schema.org/draft/2020-12/schema",
	"$id": "https://schema.twindev.org/supply-chain/SystemEvent",
	"title": "SystemEvent",
	"description": "System Event.",
	"type": "object",
	"properties": {
		"@context": {
			"$ref": "https://schema.twindev.org/supply-chain/SupplyChainContextType",
			"description": "The JSON-LD context."
		},
		"id": {
			"type": "string",
			"description": "The ID of the system event (URI)."
		},
		"type": {
			"const": "SystemEvent",
			"description": "The JSON-LD type. Always \"SystemEvent\" for system events."
		},
		"typeCode": {
			"$ref": "https://schema.twindev.org/supply-chain/SystemEventTypeCodes",
			"description": "A code specifying the type of system event."
		},
		"source": {
			"$ref": "https://schema.twindev.org/supply-chain/EventObject",
			"description": "The source of the event (app or service)."
		},
		"object": {
			"$ref": "https://schema.twindev.org/supply-chain/EventObject",
			"description": "The directly concerned element (Consignment, Document, etc.)."
		},
		"target": {
			"$ref": "https://schema.twindev.org/supply-chain/EventObject",
			"description": "The affected element from the action (if any)."
		},
		"date": {
			"type": "string",
			"description": "The date and time that the event occurred in ISO 8601 format."
		}
	},
	"required": [
		"type",
		"typeCode",
		"source",
		"object",
		"date"
	]
}

Type codes:

{
	"$schema": "https://json-schema.org/draft/2020-12/schema",
	"$id": "https://schema.twindev.org/supply-chain/SystemEventTypeCodes",
	"title": "SystemEventTypeCodes",
	"description": "Type for System Event Type Codes.",
	"anyOf": [
		{
			"const": "CREATE"
		},
		{
			"const": "ADD"
		},
		{
			"const": "UPDATE"
		},
		{
			"const": "DELETE"
		},
		{
			"const": "NOTIFY"
		},
		{
			"const": "MATCH"
		},
		{
			"const": "UNMATCHED"
		}
	]
}
typeCodeWhen TWIN generates it
CREATEA consignment was created
ADDAn event or document was added
UPDATEA consignment was updated
DELETEA consignment or document was deleted
MATCHA location operator confirmed a match
NOTIFYA border agency notification was sent
UNMATCHEDA location operator match could not be confirmed
resolvedTransportMode

A TWIN-resolved transport mode code with human-readable label.

FieldTypeDescription
rawstringFull UNECE code string, e.g. "unece:TransportModeCodeList#3"
codestringExtracted code, e.g. "3"
labelstringHuman-readable label, e.g. "Road transport"
resolvedTransportEquipment

Each item in the array:

FieldTypeDescription
identifierstringEquipment identifier
transportMeansTypesarrayResolved type codes — each item has raw, code, and label (same shape as resolvedTransportMode)

Errors

StatusCause
401Missing or invalid credentials
404Consignment not found

GET /supply-chain/data-space/consignments/:id/events

GET /supply-chain/data-space/consignments/:id/events
Cookie: access_token=<jwt>

List Consignment Events

Returns the supply chain events for a consignment as an ordered list. Each item has the same shape as the events array above.

Errors

StatusCause
401Missing or invalid credentials
404Consignment not found

GET /supply-chain/data-space/consignments/:id/documents

GET /supply-chain/data-space/consignments/:id/documents
Cookie: access_token=<jwt>

List Consignment Documents

Returns a list of documents attached to a consignment.

Response 200

Returns an array of DocumentAttachment objects. Top-level fields represent the latest revision — older revisions are in history.

FieldTypeRequiredDescription
idstringYesUnique ID of the latest revision in storage
documentIdstringYesBusiness identifier, e.g. "INV-12345"
documentCodestringYesUNECE document type code — UneceDocumentCodeList
documentRevisionnumberYesRevision number as a 0-based index
hrefstringYesURL to retrieve the latest revision's content
documentTypestringNoHuman-readable document type, e.g. "Commercial Invoice"
metadataobjectNoBlob metadata for the latest revision — see metadata
historyarrayNoPrevious revisions — see history
metadata
FieldTypeDescription
encodingFormatstringMIME type, e.g. "application/pdf"
blobSizenumberFile size in bytes
fileExtensionstringFile extension, e.g. "pdf"
history

Previous revisions sorted ascending by documentRevision.

FieldTypeDescription
idstringUnique ID of this revision in storage
documentRevisionnumberRevision number as a 0-based index
hrefstringURL to retrieve this revision's content

Errors

StatusCause
401Missing or invalid credentials
404Consignment not found

GET /supply-chain/data-space/consignments/:id/documents/:documentId

GET /supply-chain/data-space/consignments/:id/documents/:documentId
Cookie: access_token=<jwt>

Get a Consignment Document

Returns a single document attached to a consignment.

Response 200

Returns a single DocumentAttachment object — same shape as List Consignment Documents.

Errors

StatusCause
401Missing or invalid credentials
404Consignment or document not found

On this page