Skip to content

hmrc/cbcr

Repository files navigation

cbcr

The CBCR Service responsible for interacting with the Country-By-Country-Reporting Domain and interfacing with relevant HODS.

All endpoints are auth protected and for private use within the CBCR Domain.

API

URI Http Method Description Json Statuses
/file-upload-response POST Create a new FileUpload Response UploadFileResponse 200,400,500
/file-upload-response/:envelopeId GET Returns an existing FileUpload response by its EnvelopeId UploadFileResponse 200,204,401
/subscription-data POST Create a nw SubscriptionData Entity SubscriptionDetails 200,400,401,500
/subscription-data/:cbcid PUT Update an existing SubscriptionData Entiy by CBCid SubscriptionDetails 200,400,401,500
/subscription-data/cbc-id/:cbcid GET Returns an existing SubscriptionData by CBCid SubscriptionDetails 200,401,404
/subscription-data/utr/:utr GET Returns an existing SubscriptionData by Utr SubscriptionDetails 200,401,404
/subscription-data/:cbcid DELETE Delete an existing SubscriptionData by CBCid 200,401,404,500,501
/business-partner-record/:utr GET Returns an existing BusinessPartnerRecord by Utr BusinessPartnerRecord 200,401,404,500
/subscription POST Create a new Subscription SubscriptionDetails 200,401,400,500
/subscription/:safeId GET Return an existing Subscription SubscriptionDetails 200,401,404,500
/subscription/:safeId PUT Update an existing Subscritpion SubscriptionDetails 200,401,400,500
/message-ref-id/:id PUT Update an existing MessageRefId Entity MessageRefId 200,401,500
/message-ref-id/:id GET Return an existing MessageRefId Entity MessageRefId 200,401,404
/doc-ref-id/:id PUT Update a DocRefId Entity DocRefID 200,401,409,500
/doc-ref-id/:id DELETE Delete a DocRefId Entity - if enabled in config DocRefID 200,400,500,501
/doc-ref-id/:id GET Return an existing DocRefId Entity DocRefID 200,401,404,409
/corr-doc-ref-id/:cid/:id PUT Update an existing CorrDocRefId Entity 200,400,401,404,500
/reporting-entity/:id GET Return an existing ReportingEntity ReportingEntityData 200,401,404,500
/reporting-entity POST Create a ReportingEntity ReportingEntityData 200,401,400,500
/reporting-entity PUT Update an existing ReportingEntity ReportingEntityData 200,401,400
/email POST Create a new CBCR email 202,400,401

Http Response Codes

We use a subset of the standard Http Response Codes:

Code   Description
200 Ok
202 Accepted
204 No Content
400 Bad Request
401 Unauthorized
404 Not Found
409 Conflict
500 Internal Server Error

Json

FileUploadResponse

{
  "envelopeId": "df09bb9b-b0b2-4a8a-9576-8ecd2fedc602",
  "fileId": "f858bb69-6e01-44a2-aeb2-51c660f2d4c0",
  "status": "AVAILABLE",
  "reason": "foo"
}

SubscriptionDetails

{
  "businessPartnerRecord": {
    "safeId": "X1234567788",
    "organisation": {
      "organisationName": "Foo Ltd"
    },
    "address": {
      "addressLine1": "1 The Street",
      "countryCode": "GB"
    }
  },
  "subscriberContact": {
    "firstName": "Joesph",
    "lastName": "Blogger",
    "phoneNumber": "123456",
    "email": "[email protected]"
  },
  "cbcId": "XTCBC0100000001",
  "utr": "7000000002"
}

Business Partner Record

{
  "safeId": "X1234567788",
  "organisation": {
    "organisationName": "Foo Ltd"
  },
  "address": {
    "addressLine1": "1 The Street",
    "countryCode": "GB"
  }
}

MessageRefId

{
  "messageRefId": "GB2016RGXBCBC0100100000CBC40120170311T090000X"
}

DocRefId

{
 "id": "GB2016RGXBCBC0100100000CBC40120170311T090000X_5000000020OECD1ENT"
}

ReportingEntityData

{
  "cbcReportsDRI": [
    "GB2016RGXVCBC0000000056CBC40120170311T090000X_7000000002OECD1REP"
  ],
  "additionalInfoDRI": "GB2016RGXVCBC0000000056CBC40120170311T090000X_7000000002OECD1REP",
  "reportingEntityDRI": "GB2016RGXVCBC0000000056CBC40120170311T090000X_7000000002OECD1REP",
  "tin": "90000000001",
  "ultimateParentEntity": "Foo Corp",
  "reportingRole": "CBC701"
}

Running

Use default JVM settings.

sbt 'run -Dapplication.router=testOnlyDoNotUseInAppConf.Routes'

=======

License

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