Comments (5)
Hi @tallday. Have you checked the source code of this module to make sure the function is there?
from xero-node.
It doesnt look like the function is there to me. Thats why im confused as the documentation provides the example. @philals
from xero-node.
Hi @tallday, if you check the tests files it's often more helpful (and potentially more correct) than the documentation:
it('create multiple banktransactions', done => {
const banktransactions = [];
for (let i = 0; i < 2; i += 1) {
banktransactions.push(
currentApp.core.bankTransactions.newBankTransaction({
Type: 'SPEND',
Contact: {
Name: 'Johnny McGibbons',
},
LineItems: [
{
Description: 'Annual Bank Account Fee',
UnitAmount: 0.01,
AccountCode: expenseAccountCode,
},
],
BankAccount: {
AccountID: bankAccountId,
},
})
);
}
currentApp.core.bankTransactions
.saveBankTransactions(banktransactions)
.then(response => {
expect(response.entities).to.have.length.greaterThan(0);
response.entities.forEach(bankTransaction => {
expect(bankTransaction.BankTransactionID).to.not.equal('');
expect(bankTransaction.BankTransactionID).to.not.equal(undefined);
});
done();
})
.catch(err => {
console.error(util.inspect(err, null, null));
done(wrapError(err));
});
});
In this case the function is actually saveBankTransactions()
and it takes an array of banktransaction objects that were created from the newBankTransaction()
constructor.
Hope that helps.
from xero-node.
Thanks very much. This has help me a lot @jordanwalsh23.
I have since determined that I was actually wanting to create bank statements not transactions. Which then I discovered this https://xero.uservoice.com/forums/5528-xero-api/suggestions/340274-import-bank-statement-lines-via-the-api
from xero-node.
Thanks for the help @jordanwalsh23
from xero-node.
Related Issues (20)
- The LeaveApplicationV2 endpoint doesn't include LeaveTypeID HOT 3
- Approving/rejecting leave request fails with unexpected error HOT 6
- RPError: JWT not active yet, now 1691734526, nbf 1691734597 HOT 3
- idempotencyKey parameter introduced in 4.36.0 breaks existing calls to accounting api HOT 10
- Syntax Error in Readme Documentation HOT 3
- Project API Types are not exported at the top (module) level. HOT 9
- Cannot compile: HOT 3
- Url is not saved on invoice create HOT 2
- error TS7016: Could not find a declaration file for module 'request'. HOT 4
- Tracking not exposed on Typescript invoice object HOT 2
- The request package used by Node 4.3.0 is depreciated HOT 6
- "Missing function" HOT 3
- `Cannot read properties of undefined (reading 'defaultPort')` when used with `nock` HOT 10
- The type of Contact of "xero-node" module is not matched with API docs. HOT 2
- Converting circular structure to JSON HOT 3
- Switch from `request` to `axios` is a breaking change? HOT 7
- "createInvoiceAttachmentByFileName" Create attachment but not correct content file HOT 23
- CORS ERROR HOT 4
- Xero Node.js SDK: Inconsistent State Key Handling on Reconnection HOT 2
- Can you please upgrade openid-client to the latest (currently 5.6.5) HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xero-node.