hmrc / obligations-api Goto Github PK
View Code? Open in Web Editor NEWLicense: Apache License 2.0
License: Apache License 2.0
Hi
I am passing the following via curl on the test api for VAT to submit a return:
$strURL = "https://test-api.service.hmrc.gov.uk/organisations/vat/{vrn}/obligations/?from=2021-01-01&to=2021-03-31&status=O&scope=write:vat"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $strURL); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); curl_setopt($ch, CURLOPT_TIMEOUT, 3); curl_setopt($ch, CURLOPT_HTTPGET, true); $varHeadersPeriodKey = array( "accept:application/vnd.hmrc.1.0+json", "authorization:Bearer abc123dohrayme" ); curl_setopt($ch, CURLOPT_HTTPHEADER, $varHeadersPeriodKey); $contentPeriodKey = trim(curl_exec($ch)); curl_close($ch);
however when my response comes back all i seem to be getting is:
{ "code": "INVALID_SCOPE", "message": "Can not access the required resource. Ensure this token has all the required scopes." }
I cant find anywhere the sample curl code that i should be using for this.
I have attempted to include the scope into above and i am using the same scope to retrieve the Token once the oAuth has granted me the code.
How do i go about retrieving the period key please.
Kind regards
M@
Can we have obligations output for a 'self-employment' business in the testing '/obligations/details/{nino}/end-of-period-statement' endpoint?
This would then match the '/obligations/details/{nino}/income-and-expenditure' endpoint as currently we just get
"obligations": [
{
"typeOfBusiness": "uk-property",
"businessId": "XAIS12345678912",
"obligationDetails": [
{
"periodStartDate": "2018-04-06",
"periodEndDate": "2019-04-05",
"dueDate": "2020-01-31",
"status": "Open"
}
]
},
{
"typeOfBusiness": "foreign-property",
"businessId": "XAIS12345678911",
"obligationDetails": [
{
"periodStartDate": "2021-04-06",
"periodEndDate": "2022-04-05",
"dueDate": "2023-01-31",
"status": "Open"
}
]
}
]
while the '/obligations/details/{nino}/income-and-expenditure' endpoint returns (in testing)
"obligations": [
{
"typeOfBusiness": "self-employment",
"businessId": "XAIS12345678911",
"obligationDetails": [
{
"periodStartDate": "2018-04-06",
"periodEndDate": "2018-07-05",
"dueDate": "2018-08-05",
"receivedDate": "2018-08-01",
"status": "Fulfilled"
},
{
"periodStartDate": "2018-07-06",
"periodEndDate": "2018-10-05",
"dueDate": "2018-11-05",
"status": "Open"
},
{
"periodStartDate": "2018-10-06",
"periodEndDate": "2019-01-05",
"dueDate": "2019-02-05",
"status": "Open"
},
{
"periodStartDate": "2019-01-06",
"periodEndDate": "2019-04-05",
"dueDate": "2019-05-06",
"status": "Open"
}
]
},
{
"typeOfBusiness": "uk-property",
"businessId": "XAIS12345678912",
"obligationDetails": [
{
"periodStartDate": "2018-04-06",
"periodEndDate": "2018-07-05",
"dueDate": "2018-08-05",
"receivedDate": "2018-08-01",
"status": "Fulfilled"
},
{
"periodStartDate": "2018-07-06",
"periodEndDate": "2018-10-05",
"dueDate": "2018-11-05",
"status": "Open"
},
{
"periodStartDate": "2018-10-06",
"periodEndDate": "2019-01-05",
"dueDate": "2019-02-05",
"status": "Open"
},
{
"periodStartDate": "2019-01-06",
"periodEndDate": "2019-04-05",
"dueDate": "2019-05-06",
"status": "Open"
}
]
},
{
"typeOfBusiness": "foreign-property",
"businessId": "XAIS12345678911",
"obligationDetails": [
{
"periodStartDate": "2021-04-06",
"periodEndDate": "2021-07-05",
"dueDate": "2021-08-05",
"receivedDate": "2021-08-01",
"status": "Fulfilled"
},
{
"periodStartDate": "2021-07-06",
"periodEndDate": "2021-10-05",
"dueDate": "2021-11-05",
"status": "Open"
},
{
"periodStartDate": "2021-10-06",
"periodEndDate": "2022-01-05",
"dueDate": "2022-02-05",
"status": "Open"
},
{
"periodStartDate": "2022-01-06",
"periodEndDate": "2022-04-05",
"dueDate": "2022-05-06",
"status": "Open"
}
]
}
]
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.