Declarations

During the execution of a customs flow, declarations are created which can be retrieved through the Get declaration endpoint. The most efficient way to retrieve a declaration is by the unique id received through a web hook event as described in Notifications. However, it is also possible to search for a declaration based on a number of criteria (e.g. your own reference for the customs shipment externalReference) by using the Search declarations endpoint.

Errors

When the declaration is in an Invalid or CustomsError status you can find the errors in the response data under the errors field.

For example, when you send in data like (JSON fragment)

{
  "singleAdministrativeDcoument": {
    "declType": "IM",
    "addDeclType": "A",
    "additionalDocuments": [
      {
        "category": "N",
        "refNum": "SDoc1",
        "type": "380"
      }
   	],
    "agentStatus": "2",
    "declarationOfficeCode": "NL000567",
    "invoiceCurrency": "EUR",
    "agent": {
      "businessPartnerReference": [
        {
          "code": "NL100004337",
          "type": "Eori"
        }
      ]
    }
  }
}

you can get a validation error like (JSON fragment)

{
  "errors": [
    {
      "errorCode": "V0010",
      "message": "Invalid additional declaration type",
      "description": "SingleAdministrativeDocument.AddDeclType must be of type 'D'",
      "fieldReference": [
        {
          "fieldName": "AddDeclType1",
          "path": "SingleAdministrativeDocument"
        }
      ]
    }
  ]
}