aade-mydata-client
Version:
Node.js Client for AADE myDATA (my Digital Accounting and Tax Application) REST API
108 lines (70 loc) • 2.67 kB
Markdown
Node.js Client for AADE myDATA (my Digital Accounting and Tax Application) REST API
## Features
✅ HTTP requests to AADE myDATA REST API through axios <br />
✅ XML to JSON conversion (currently myData API only supports response data in XML. The client parses these data in JSON format.)<br />
✅ JSON to XML conversion (The client parses your JSON data to XML for the request body.)<br />
✅ Javascript/Typescript support<br />
✅ Compatible with myDATA REST API v1.0.2<br />
📝 TODO: Methods requestTransmittedDocs(), sendIncomeClassification(), sendExpensesClassification() are not yet ready<br />
## Installation
npm install -S aade-mydata-client
## Usage
#### TypeScript
```ts
import { AADEmyDataClient } from 'aade-mydata-client';
class YourClass {
public myDataClient: AADEmyDataClient;
constructor() {
this.myDataClient = new AADEmyDataClient({
userId: 'YOUR_USER_ID',
subscriptionKey: 'YOUR_SUBSCRIPTION_KEY',
livemode: false // true for production API requests
});
}
// Example call for RequestDocs
async main(): Promise<void> {
const invoices = await this.myDataClient.requestDocs({ mark: 0 });
// this method returns Invoice[] for credentials you defined in the client above
}
}
```
```js
const AADEmyDataClient = require('aade-mydata-client').AADEmyDataClient;
const myDataClient = new AADEmyDataClient({
userId: 'YOUR_USER_ID',
subscriptionKey: 'YOUR_SUBSCRIPTION_KEY',
livemode: false // true for production API requests
});
const main = async () => {
try {
const invoices = await myDataClient.requestDocs({ mark: 0 });
console.log(invoices);
} catch (error) {
}
}
main();
```
Submits one or more invoices, including corrected/amending
Returns all documents submitted for the corresponding AADE account.
Request transmitted documents
Submits invoice for income
Submit invoice for expenses
Method for cancelling a invoice
<table>
<tr>
<td align="center"><a href="https://johnmakridis.github.io"><img src="https://avatars.githubusercontent.com/u/19326052?v=4" width="120px;" alt="John Makridis"/> <br />John Makridis</a>
</td>
</tr>
</table>
If you want to contribute to this repository <a href="https://johnmakridis.github.io">send me a message</a>.