This API permits requesting the status of a declaration.
The user must supply an MRN, DUCR, UCR or inventory reference as a parameter in the request URL. The endpoint returns a set of latest status details.
curl -v -X GET "http://localhost:9000/mrn/{valid mrn}/status" \
-H 'Accept: application/vnd.hmrc.1.0+xml' \
-H 'Authorization: Bearer {ADD VALID TOKEN}' \
-H 'X-Badge-Identifier: {Badge Id}' \
-H 'X-Submitter-Identifier: {Submitter Id}' \
-H 'X-Client-ID: {Valid Client Id}' \
-H 'cache-control: no-cache'
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.