The Customs Declarations Information API can be used to request the status and versions of a declaration.
- Run locally:
sbt runwhich runs on port9834by default - Run with test endpoints:
sbt 'run -Dapplication.router=testOnlyDoNotUseInAppConf.Routes'
The Customs Declarations Information service can be run locally from Service Manager, using the following profiles:
| Profile Details | Command | Description |
|---|---|---|
| CUSTOMS_DECLARATION_ALL | sm2 --start CUSTOMS_DECLARATION_ALL | To run all CDS applications. |
| CUSTOMS_INVENTORY_LINKING_EXPORTS_ALL | sm2 --start CUSTOMS_INVENTORY_LINKING_EXPORTS_ALL | To run all CDS Inventory Linking Exports related applications. |
| CUSTOMS_INVENTORY_LINKING_IMPORTS_ALL | sm2 --start CUSTOMS_INVENTORY_LINKING_IMPORTS_ALL | To run all CDS Inventory Linking Imports related applications. |
- Run Unit Tests:
sbt test - Run Integration Tests:
sbt it/test - Run Unit and Integration Tests:
sbt test it/test - Run Unit and Integration Tests with coverage report:
./run_all_tests.sh
which runsclean coverage test it:test coverageReport dependencyUpdates"
This repository does not have any associated Acceptance Tests.
To run performance tests, see here.
For Customs Declarations API documentation, see here.
Path - internal routes prefixed by /customs/declarations-information |
Supported Methods | Description | |
|---|---|---|---|
/mrn/{mrn}/status |
GET | Retrieves the latest set of status details by MRN. | |
/ducr/{ducr}/status |
GET | Retrieves the latest set of status details by DUCR. | |
/ucr/{ucr}/status |
GET | Retrieves the latest set of status details by UCR. | |
/inventory-reference/{inventoryReference}/status |
GET | Retrieves the latest set of status details by inventory reference. | |
/mrn/{mrn}/version |
GET | Retrieves the latest versions of a declaration by MRN, with the most recent first. | |
/mrn/{mrn}/full |
GET | Retrieves the full declaration by MRN. | |
/search?partyRole=submitter&declarationCategory=EX&goodsLocationCode=BELBELOB4 |
GET | Retrieves matching declarations and returned in summary form. |
This service does not have any specific test-only endpoints.
The X-Client-ID header, together with the application context and version are used
to call the api-subscription-fields service to get the authenticatedEori to pass on to the backend request (where it is known as authenticatedPartyID).
So there is a direct dependency on the api-subscription-fields service. Note the service to get the authenticatedEori is not currently stubbed.
Make sure the api-subscription-fields service is running on port 9650. Then run the below curl command.
Please note that version 1.0 is used as an example in the commands given and you should insert the customs declarations information api version number which you will call subsequently.
Please note that value d65f2252-9fcf-4f04-9445-5971021226bb is used as an example in the commands given and you should insert the UUID value which suits your needs.
curl -v -X PUT "http://localhost:9650/field/application/d65f2252-9fcf-4f04-9445-5971021226bb/context/customs%2Fdeclarations-information/version/1.0" -H "Cache-Control: no-cache" -H "Content-Type: application/json" -d '{ "fields" : { "authenticatedEori" : "GB123456789000" } }'
When you then send a request to customs-declarations-information make sure you have the HTTP header X-Client-ID with the value d65f2252-9fcf-4f04-9445-5971021226bb
There is no lookup of api-subscription-fields for non-CSP requests.
Dynamic switching of service endpoints has been implemented for the declaration status connector. To configure dynamic switching of the endpoint there must be a corresponding section in the application config file (see example below). This should contain the endpoint config details.
The service customs-declarations-information has a default configuration and a stub configuration. Note
that default configuration is declared directly inside the customs-declarations-information section.
Prod {
...
services {
...
declaration-status {
host = some.host
port = 80
bearer-token = "some_token"
context = /declarations/querystatusinformation/v1
stub {
host = localhost
port = 9479
bearer-token = "some_stub_token"
context = /declarations/querystatusinformation/v1
}
}
}
}
default version (application/vnd.hmrc.1.0+xml):
curl -X "POST" http://customs-declarations-information-host/test-only/service/declaration-status/configuration -H 'content-type: application/json' -d '{ "environment": "stub" }'
The service customs-declarations-information is now configured to use the stub environment
curl -X "POST" http://customs-declarations-information-host/test-only/service/declaration-status/configuration -H 'content-type: application/json' -d '{ "environment": "default" }'
The service customs-declarations-information is now configured to use the default environment
curl -X "GET" http://customs-declarations-information-host/test-only/service/declaration-status/configuration
{
"service": "declaration-status",
"environment": "stub",
"url": "http://currenturl/customs-declarations-information"
"bearerToken": "current token"
}
This code is open source software licensed under the Apache 2.0 License.