Giter Club home page Giter Club logo

hmrc.customs-manage-subscription's Introduction

Customs Manage Subscription

This microservice notifies a ROSM user with an email regarding the outcome of their subscription (enrolment) with Customs.

Requirements

This service is written in Scala and Play, and requires a Java 8 JRE to run.

Endpoints

POST /:formBundleId

Request headers specification:

HTTP Header Acceptable value
Content-Type application/json

We don't validate Accept header to allow tax-enrolments callbacks.

Request body specification:

Field Name Size Field Type Description
url String Complete URL (with parameters expanded) which will allow details to be determined about the subscription (if successful) - the form bundle ID. (Not used)
state 9 String Indicates success /failure: ["SUCCEEDED", "ERROR"]
errorResponse String Body of GG/ETMP response in the case of state == "ERROR". (Not used)

Example Request body:

{
    "url": "http://domain:port/tax-enrolments/subscriptions/72138873457",
    "state": "ERROR",
    "errorResponse": "...."
}

Response code specification:

  • 204 If the request is processed successful
  • 400 This status code will be returned in case of incorrect data, incorrect data format, missing parameters etc are provided in the request
  • 500 In case of a system error such as time out, server down etc, this HTTP status code will be returned
  • 405 Any operation other than POST will be responded with "405 Method not allowed" HTTP error

POST /handle-subscription

Request headers specification:

HTTP Header Acceptable value
Content-Type application/json
Accept application/vnd.hmrc.1.0+json
Authorization Bearer SOME_TOKEN_VALUE

Example Request body:

 {
        "formBundleId": "formBundleId",
        "recipienttDetails": {
            "recipientFullName": "fullName",
            "recipientEmailAddress": "[email protected]"
        },
        "sapNumber": "sapNumber"
}

Response code specification:

  • 204 If the request is processed successful
  • 400 This status code will be returned in case of incorrect data, incorrect data format, missing parameters etc are provided in the request
  • 406 This status code will be returned in case of invalid or missing accept header
  • 415 This status code will be returned in case of invalid or missing content type header
  • 500 In case of a system error such as time out, server down etc, this HTTP status code will be returned
  • 405 Any operation other than POST will be responded with "405 Method not allowed" HTTP error

PUT /save4later/:id/:key

Request headers specification:

HTTP Header Acceptable value
Content-Type application/json
Accept application/vnd.hmrc.1.0+json

Example Request body:

 {
       
  "completionDate": "5 May 2017",
  "journey": "GetYourEORI",
  "orgName": "Test Company Name",
  "recipientEmailAddress": "[email protected]",
  "recipientFullName": "Full Name"
 
  }

Response code specification:

  • 201 If the request is processed successful
  • 400 This status code will be returned in case of incorrect data, incorrect data format, missing parameters etc are provided in the request
  • 404 This status code will be returned in case of empty body

GET /save4later/:id/:key

Example Request

/save4later/id-1/key-1

Example Response body

{
  "completionDate": "5 May 2017",
  "journey": "GetYourEORI",
  "orgName": "Test Company Name",
  "recipientEmailAddress": "[email protected]",
  "recipientFullName": "Full Name"
}

Response code specification:

  • 200 If the request is processed successful
  • 404 This status code will be returned in case of id and key not found

DELETE /save4later/:id/:key

Example Request

/save4later/id-1/key-1

Response code specification:

  • 204 If the request is processed successful
  • 404 This status code will be returned in case of id and key not found

DELETE /save4later/:id

Example Request

/save4later/id-1

Response code specification:

  • 204 If the request is processed successful
  • 404 This status code will be returned in case of id not found

POST /notifyRCM

Request headers specification:

HTTP Header Acceptable value
Content-Type application/json
Accept application/vnd.hmrc.1.0+json
Authorization Bearer SOME_TOKEN_VALUE

Example Request body:

 {
        "timestamp": "23-May-2019 20:10:10",
        "name": "fullName",
        "email": "[email protected]"
        "eori": "GBXXXXXXXXX000"
}

Response code specification:

  • 204 If the request is processed successful
  • 400 This status code will be returned in case of incorrect data, incorrect data format, missing parameters etc are provided in the request
  • 406 This status code will be returned in case of invalid or missing accept header
  • 415 This status code will be returned in case of invalid or missing content type header
  • 500 In case of a system error such as time out, server down etc, this HTTP status code will be returned
  • 405 Any operation other than POST will be responded with "405 Method not allowed" HTTP error

Acronyms

In the context of this application we use the following acronyms and define their meanings. Provided you will also find a web link to discover more about the systems and technology.

  • API: Application Programming Interface

  • JRE: Java Runtime Environment

  • JSON: JavaScript Object Notation

  • CDS: Custom Declaration Services

  • URL: Uniform Resource Locator

License

This code is open source software licensed under the Apache 2.0 License.

hmrc.customs-manage-subscription's People

Contributors

hmrc-web-operations avatar paulblakehmrc avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.