Customs flows

The main goal of CAS is to fully automate your customs flow. This is done by sending data from your backend system like an ERP to CAS, where the data will be processed and will result in the necessary declarations to customs.

To be able to process the data correctly, we'll need to configure one or more customs flows existing out of one or more steps. The configuration of the customs flows can be done through the user interface of CAS.

The flow starts with a customs shipment

A customs shipment describes your transfer of goods, and is the starting point for a customs flow in CAS. The customs flow in CAS will translate the customs shipment to one or more documents, including - but not limited to - declarations for customs systems, or excise movements for EMCS systems.

Therefore, creating a customs shipment successfully is one of the first steps when integrating with the CAS solution. This is done by using the Create customs shipment endpoint. After the creation of the customs shipment, CAS will process the documents such as the declaration through different declaration statuses.

Message types

When sending a customs shipment to the ingestion API, the messageType field determines how CAS handles the data:

messageType Behavior When to use
New Creates a new customs shipment and starts the customs flow First-time ingestion of a shipment (default if omitted)
Replace Replaces an existing customs shipment entirely, restarting the customs flow When you need to re-send all data from scratch; only possible before the declaration reaches Accepted status
Update Updates an existing customs shipment with the provided data Selective changes to an existing shipment; CAS resolves which declarations need updating
Upsert Creates the customs shipment if it does not exist, updates it if it already exists (matched by externalReference) Simplest option when you want create-or-update semantics without checking beforehand

Deductions

It is not necessary to send all data with every customs shipment, even though this might be advisable, it is not always practical. Therefore, CAS is capable to deduce a lot of the necessary data based on the master data and the rules configured in decision tables. This part of the flow we refer to as the deductions.

Validations

With every step in the customs flow, CAS will execute a number of validations. If the validations detect an issue, the declaration are moved into the Invalid status.

Corrections

Corrections to a customs shipment can be done through the API. There are four possible correction mechanisms:

  • Replace customs shipment
  • Update/Upsert customs shipment
  • Update declaration
  • Invalidate declaration

The correct method depends on the declaration’s state in the customs flow.

Replace customs shipment by the ingestion API

Replacing a customs shipment is only possible when the declaration has not reached the Accepted status or beyond.

Replacing is done by simply changing the message type to "Replace" when sending the customs shipment to CAS to the ingestion API. This will restart the complete customs flow and all manual edits will be lost. However, it will also mean that all relevant deductions can be executed again starting from the new data.

Update/Upsert customs shipment by the ingestion API

When ingesting customs shipment using an Update/Upsert message type, CAS looks up the existing customs shipment based on the provided external reference. Once found, the existing customs shipment is updated with the provided data resulting into creating, updating/amending, deleting/invalidating declarations within the customs flow. Relevant messages are also sent to customs if needed to inform them about the changes. This approach is allowed when customs flow remains unchanged.

Update declaration

Update endpoints allow modifying an existing declaration including updating the header information and creating, updating, or deleting items. Updates are only possible when the declaration has not yet been sent to customs or the declaration has been rejected by customs. During the update process, all relevant deductions and validations are executed. Using the update endpoints allows targeted changes without restarting the entire customs flow.

For details on managing individual goods items, see Declaration items.

Update endpoints follow a selective update model, meaning that only fields explicitly provided in the request body will be updated. Fields that are not included in the request remain unchanged. When a field is a collection of elements, if a collection is provided without casReference, the entire existing collection will be fully replaced by the new one. To update specific items within a collection, use casReference. For elements identified by casReference, only the fields provided will be updated, while non-provided fields for that element remain unchanged.

Invalidate declaration

When the declaration is already sent to customs (status Accepted and beyond), you'll need to invalidate the declaration as customs will need to be informed of the change.