Skip to content

Commit d354bee

Browse files
authored
Added purchase methods (#1)
1 parent 4f94a77 commit d354bee

File tree

7 files changed

+479
-89
lines changed

7 files changed

+479
-89
lines changed

README.md

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,13 +111,45 @@ Create a new sales invoice from Finvoice XML data:
111111
const newInvoiceId = await fennoa.sales.createInvoiceByFinvoiceXML(xml);
112112
```
113113

114+
### Purchases examples
115+
116+
Here is an example of fetching all purchase invoices from approval queue:
117+
118+
```javascript
119+
const purchases = await fennoa.purchases.getApprovalQueue();
120+
```
121+
122+
Fetch single purchase invoice by ID:
123+
124+
```javascript
125+
const purchaseInvoice = await fennoa.purchases.getPurchaseInvoiceById(12);
126+
```
127+
128+
Approve purchase invoice by approval ID with an optional comment:
129+
130+
```javascript
131+
fennoa.purchases.approvePurchaseInvoice(2, 'Approved by automation');
132+
```
133+
134+
Add payment to purchase invoice:
135+
136+
```javascript
137+
const paymentInfo = {
138+
purchase_invoice_id: 2,
139+
sum: 100,
140+
payment_date: '2025-03-01',
141+
description: 'Paid by automation'
142+
};
143+
144+
await fennoa.purchases.addPurchasePayment(paymentInfo);
145+
```
146+
114147
## Resources
115148

116149
- Fennoa website: https://www.fennoa.com/
117150
- Fennoa API Documentation: https://www.fennoa.com/api-documentation/
118151
- Fennoa login page: https://app.fennoa.com/login
119152

120-
## Changelog
153+
```
121154
122-
- 0.0.1 First release
123-
- 0.0.2 Switching FormData type import
155+
```

0 commit comments

Comments
 (0)