v1

latestOpenAPI 3.0.32026-07-131435187.6 KB
Departures

Get all cached messages related to a departure

Get all messages related to a specific departure declaration sent to the customs office of departure within the past 60 days. You can filter for departure declarations received before and/or after a specific date and time. Movements older than 60 days are archived, so any messages to related to them cannot be returned by the API. For a multi-page query you can filter for a specific page, and optionally the number of items per page. A successful response will include the total count of the number of messages and Movement Reference Number (MRN) only after it has been allocated to a movement. <br/><br/> The status parameter in a successful response can have the following values:

  • Pending: the file has not yet been uploaded or checks are not yet completed
  • Processing: the file has been received by us and the message is being processed
  • Success: the file has been processed successfully
  • Failed: there was a problem with the file and the message was not processed

Note: You can view a transit movement only if your Economic Operators Registration and Identification (EORI) number matches the EORI number that created the transit declaration for that movement. Your EORI number is part of the bearer token that you use for API authentication.

get/customs/transits/movements/departures/{departureId}/messages

Path parameters

departureIdstring required

The departure ID specifying the departure to return.

Query parameters

receivedSincestring date-time
Example:2021-06-21T09:00:00Z

This is an optional query parameter that you can use to filter for departure declarations received after a specific date and time.

pageinteger
Example:2

This is an optional query parameter (default value is 1) that allows the selection of a specific page from a multi-page query. If used, you must enter a positive number.

countinteger
Example:50

This is an optional query parameter (default value is 25) that you can use to select the number of items per page in a multi-page query. If used, you must enter a positive number. The maximum value allowed is 500.

receivedUntilstring date-time
Example:2023-06-15T09:00:00Z

This is an optional query parameter that you can use to filter for arrivals updated before a specific date and time.

Headers

Accept'application/vnd.hmrc.3.0+json' required

Specifies the response format and the version of the API to be used.

Response

A successful get all messages related to departure response

totalCountnumber required

Example response

{
  "_links": {
    "self": {
      "href": "/customs/transits/movements/departures/6365135ba5e821ee/messages"
    },
    "departure": {
      "href": "/customs/transits/movements/departures/6365135ba5e821ee"
    }
  },
  "totalCount": 1,
  "messages": [
    {
      "_links": {
        "self": {
          "href": "/customs/transits/movements/departures/6365135ba5e821ee/message/634982098f02f00a"
        },
        "departure": {
          "href": "/customs/transits/movements/departures/6365135ba5e821ee"
        }
      },
      "id": "634982098f02f00a",
      "departureId": "6365135ba5e821ee",
      "received": "2022-11-10T15:32:51.459Z",
      "type": "IE015",
      "status": "Success"
    }
  ]
}