Skip to content

Commit 71ed19c

Browse files
committed
updating readme to include the new api call
1 parent d62212f commit 71ed19c

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

README.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,50 @@ oauthClient
437437
});
438438
```
439439

440+
441+
You can also make the calling using the endpoint path:
442+
443+
```javascript
444+
// Body sample from API explorer examples
445+
const body = {
446+
TrackQtyOnHand: true,
447+
Name: 'Garden Supplies',
448+
QtyOnHand: 10,
449+
InvStartDate: '2015-01-01',
450+
Type: 'Inventory',
451+
IncomeAccountRef: {
452+
name: 'Sales of Product Income',
453+
value: '79',
454+
},
455+
AssetAccountRef: {
456+
name: 'Inventory Asset',
457+
value: '81',
458+
},
459+
ExpenseAccountRef: {
460+
name: 'Cost of Goods Sold',
461+
value: '80',
462+
},
463+
};
464+
465+
oauthClient
466+
.makeApiCall({
467+
url: '/v3/company/1234/item',
468+
method: 'POST',
469+
headers: {
470+
'Content-Type': 'application/json',
471+
},
472+
body: JSON.stringify(body),
473+
})
474+
.then(function (response) {
475+
console.log('The API response is : ' + response);
476+
})
477+
.catch(function (e) {
478+
console.log('The error is ' + JSON.stringify(e));
479+
});
480+
```
481+
482+
483+
440484
The client validates the ID Token and returns boolean `true` if validates successfully else it would
441485
throw an exception.
442486

0 commit comments

Comments
 (0)