Skip to content

hmrc/emcs-tfe-reference-data

Repository files navigation

emcs-tfe-reference-data

Retrieve CN Code information, packaging types or wine operations from the CandE Oracle database

This microservice allows you to switch between using Oracle and the reference-data stub based on a feature switch in application.conf.

API endpoints

Retrieve CN Code information

POST /oracle/cn-code-information

Retrieve CN Code information for a given list of Product Codes and CN Codes

Request Body: CnInformationRequest Model

Example request body:

{
  "items": [
    {
      "productCode": "B000",
      "cnCode": "22030001"
    },
    {
      "productCode": "S500",
      "cnCode": "10000000"
    }
  ]
}

Responses

Success Response(s)

Status: 200 (OK)

Body: Key:value pair of String:CnCodeInformation Model

Example response body:

{
  "24029000": {
    "cnCodeDescription": "Cigars, cheroots, cigarillos and cigarettes not containing tobacco",
    "exciseProductCodeDescription": "Fine-cut tobacco for the rolling of cigarettes",
    "unitOfMeasureCode": 1
  }
}

Error Response(s)

Status: 500 (ISE)

Body: ErrorResponse Model

Retrieve particular packaging types

POST /oracle/packaging-types

Retrieve packaging type information for a list of packaging types

Request Body: JSON array of packaging types

Example request body:

[
  "VP",
  "NE",
  "TO"
]

Responses

Success Response(s)

Status: 200 (OK)

Body: Key:value pair of String:String

Example response body:

{
  "NE": "Unpacked or unpackaged",
  "TO": "Tun",
  "VP": "Vacuum-packed"
}

Error Response(s)

Status: 500 (ISE)

Body: ErrorResponse Model

Retrieve all packaging types

GET /oracle/packaging-types

Retrieve all packaging type information. An optional isCountable boolean query parameter can be provided to find countable packaging types. The response is sorted by the description in ascending (A-Z) order.

Responses

Success Response(s)

Status: 200 (OK)

Body: Key:value pair of String:String

Example response body:

{
  "CR": "Crate",
  "FD": "Framed crate",
  "VA": "Vat"
}

Error Response(s)

Status: 500 (ISE)

Body: ErrorResponse Model

Retrieve all wine operations

GET /oracle/wine-operations

Retrieve all wine operations.

Responses

Success Response(s)

Status: 200 (OK)

Body: Key:value pair of String:String

Example response body:

{
  "0": "The product has undergone none of the following operations",
  "1": "The product has been enriched",
  "2": "The product has been acidified",
  "3": "The product has been de-acidified"
}

Error Response(s)

Status: 500 (ISE)

Body: ErrorResponse Model

Retrieve particular wine operations

POST /oracle/wine-operations

Retrieve wine operation information for a list of wine operations

Request Body: JSON array of wine operations

Example request body:

[
  "4",
  "11",
  "9"
]

Responses

Success Response(s)

Status: 200 (OK)

Body: Key:value pair of String:String

Example response body:

{
  "4": "The product has been sweetened",
  "11": "The product has been partially dealcoholised",
  "9": "The product has been made using oak chips"
}

Error Response(s)

Status: 500 (ISE)

Body: ErrorResponse Model

Retrieve member states

GET /oracle/member-states

Retrieve member states list

Responses

Success Response(s)

Status: 200 (OK)

Body: Array of Country object

Example response body:

[
  {
    "countryCode": "FR",
    "country": "France"
  },
  {
    "countryCode": "AT",
    "country": "Austria"
  }
]

Error Response(s)

Status: 500 (ISE)

Body: ErrorResponse Model