@softledger/node
TypeScript icon, indicating that this package has built-in type declarations

0.3.0 • Public • Published

Softledger TypeScript SDK 0.2.0

Welcome to the Softledger SDK documentation. This guide will help you get started with integrating and using the Softledger SDK in your project.

This SDK was generated by liblab

Versions

  • API version: 1.0.0
  • SDK version: 0.2.0

About the API

SoftLedger General Ledger Accounting API

Table of Contents

Setup & Configuration

Supported Language Versions

This SDK is compatible with the following versions: TypeScript >= 4.8.4

Installation

To get started with the SDK, we recommend installing using npm:

npm install @softledger/node

Authentication

Access Token Authentication

The Softledger API uses an Access Token for authentication.

This token must be provided to authenticate your requests to the API.

Setting the Access Token

When you initialize the SDK, you can set the access token as follows:

const sdk = new Softledger({ token: 'YOUR_TOKEN' });

If you need to set or update the access token after initializing the SDK, you can use:

const sdk = new Softledger();
sdk.token = 'YOUR_TOKEN';

OAuth Authentication

The Softledger API uses OAuth for authentication.

You need to provide the OAuth parameters when initializing the SDK.

const sdk = new Softledger({ clientId: 'CLIENT_ID', clientSecret: 'CLIENT_SECRET' });

If you need to set or update the OAuth parameters after the SDK initialization, you can use:

const sdk = new Softledger();
sdk.clientId = 'CLIENT_ID';
sdk.clientSecret = 'CLIENT_SECRET';

Setting a Custom Timeout

You can set a custom timeout for the SDK's HTTP requests as follows:

const softledger = new Softledger({ timeout: 10000 });

Sample Usage

Below is a comprehensive example demonstrating how to authenticate and call a simple endpoint:

import { AddressFilter, FilterOptions, Softledger } from '@softledger/node';

(async () => {
  const softledger = new Softledger({
    token: 'YOUR_TOKEN',
  });

  const equals = 'fugiat ';

  const not = 'sint in eu tem';

  const gt = 'culpa pariatu';

  const gte = 'nisi ea D';

  const lt = 'conseq';

  const lte = 'non q';

  const filterOptionsIn = 'irure anim al';

  const filterOptions: FilterOptions = {
    equals: equals,
    contains: 'contains',
    not: not,
    gt: gt,
    gte: gte,
    lt: lt,
    lte: lte,
    in: [filterOptionsIn],
    isNull: true,
  };

  const addressFilter: AddressFilter = {
    _id: filterOptions,
    label: filterOptions,
    line1: filterOptions,
    line2: filterOptions,
    city: filterOptions,
    state: filterOptions,
    zip: filterOptions,
    country: filterOptions,
    isDefault: filterOptions,
    isVerified: filterOptions,
    createdAt: filterOptions,
    updatedAt: filterOptions,
    CustomerId: filterOptions,
    VendorId: filterOptions,
  };
  const addressesSearchFilterType = 'all';
  const addressesSearchOrder = '_id:ASC';

  const { data } = await softledger.addresses.addressesSearch({
    filter: addressFilter,
    filterType: addressesSearchFilterType,
    cursor: 'cursor',
    limit: 25,
    order: addressesSearchOrder,
  });

  console.log(data);
})();

Services

The SDK provides various services to interact with the API.

Below is a list of all available services with links to their detailed documentation:
Name
AuthenticationService
StatusService
AddressesService
ApiKeysService
AuditLogsService
BanksService
BatchPaymentsService
BillsService
BudgetsService
CashReceiptsService
CoinsService
ConsolidationRatesService
ContactsService
CostCentersService
CryptoTransactionsService
CurrenciesService
CustomDimensionsService
CustomersService
CustomFieldsService
EmailsService
ReportsService
FxRemeasureService
StockAdjustmentsService
InvoicesService
ItemsService
JobsService
JournalsService
LedgerAccountsService
LocationsService
PartNumbersService
PaymentsService
PeriodsService
PreferencesService
ProductsService
PurchaseOrdersService
RecurringJobsService
ReportLayoutsService
RolesService
SalesOrdersService
SettingsService
ShipmentReceiptsService
StatementsService
StockCountsService
SystemJobsService
TaxCodesService
TemplatesService
TimezonesService
TransactionsService
TransfersService
UsersService
VendorCreditsService
VendorPricesService
VendorsService
WalletsService
WarehousesService
WarehouseItemsService
WebhooksService
YearsService

Models

The SDK includes several models that represent the data structures used in API requests and responses. These models help in organizing and managing the data efficiently.

Below is a list of all available models with links to their detailed documentation:
Name Description
RequestTokenRequest
RequestTokenOkResponse
StatusGetOneType
StatusGetOneOkResponse
AddressFilter
FilterOptions
AddressesSearchFilterType
AddressesSearchOrder Field to sort by
AddressesSearchOkResponse
AddressesCreateRequest
AddressesCreateCreatedResponse
CountResponse
AddressesUpdateRequest
AddressesUpdateOkResponse
AddressesOneOkResponse
ApiKeysGetAllOkResponse
ApiKeysCreateRequest
ApiKeysCreateCreatedResponse
ApiKeysGetPermissionsOkResponse
ApiKeysUpdatePermissionsRequest
AuditLogsSearchFilter
FilterOptions
AuditLogsSearchOkResponse
BankFilter
FilterOptions
AddressesSearchFilterType
BankOrder Field to sort by
BanksSearchOkResponse
BankAccountsCreateRequest
BankAccountsCreateCreatedResponse
BankTransactionFilter
BankTransactionOrder Field to sort by
BanksGetAccountTransactionsOkResponse
BanksLinkAccountRequest
BatchPaymentFilter
FilterOptions
AddressesSearchFilterType
BatchPaymentsSearchOrder Field to sort by
BatchPaymentsSearchOkResponse
BatchPaymentsCreateRequest
BatchPaymentsCreateCreatedResponse
BillFilter
BillOrder Field to sort by
BatchPaymentsBillsType
BatchPaymentsBillsOkResponse
BatchPaymentsBillsCountType
CountResponse
BatchPaymentsOneOkResponse
PaymentsFilter
BatchPaymentsPaymentsOrder Field to sort by
BatchPaymentsPaymentsOkResponse
BatchPaymentsPaymentsCountType
BatchPaymentsVoidRequest
BillFilter
AddressesSearchFilterType
BillOrder Field to sort by
BillsSearchType
BillsSearchOkResponse
BillSearchItem
BillsCreateRequest
BillsCreateCreatedResponse
BillLineFilter
FilterOptions
BillLineOrder Field to sort by
BillLinesSearchType
BillLinesSearchOkResponse
UnpaidBillsSearchType
UnpaidBillsSearchOkResponse
BillsCountType
CountResponse
BillLinesCountType
BillsCreateLineRequest Can only add a line to an unapproved bill Handling of LedgerAccountId: | ItemId set | LedgerAccountId Set | Result | |:------------:|:-----------------------:|:--------:| | Yes | Yes | Use LedgerAccountId | | Yes | No | Use Item.BillAccountId | | No | Yes | Use LedgerAccountId | | No | No | Error is thrown | ** If LedgerAccountId is set, it will override the LedgerAccount.number ** Tax Logic: | TaxCodeId set | TaxAmount set | Result | Tax LedgerAccount | |:------------:|:--------------:|:-------:|:------:| | Yes | Yes | Use TaxAmount, even if set to 0 | TaxCode.LedgerAccountId | | Yes | No | taxAmount = (amount _ quantity) _ (TaxCode.rate / 100) | TaxCode.LedgerAccountId | | No | Yes | Use TaxAmount | Settings.defaultSalesTaxId | | No | No | No Tax Set | No Tax Line Added |
BillsCreateLineCreatedResponse
BillsOneOkResponse
BillsUpdateRequest
BillsUpdateOkResponse
BillsUpdateLineRequest Can only update line on an unapproved bill If LedgerAccountId is not changed, it will remain regardless of changing the Item. If LedgerAccountId is set to null, the Item.BillAccount will be set if exists. TaxAmount will not be changed if not passed, even if new TaxCode is passed.
BillsUpdateLineOkResponse
PaymentList
BillsVoidRequest
BudgetSearchFilter
FilterOptions
AddressesSearchFilterType
BudgetSearchOrder Field to sort by
BudgetSearchOkResponse
BudgetSearchItem
BudgetsCreateRequest
BudgetsCreateCreatedResponse
BudgetsOneOkResponse
BudgetsUpdateRequest
BudgetsUpdateOkResponse
CashReceiptFilter
FilterOptions
AddressesSearchFilterType
CashReceiptsSearchOrder Field to sort by
CashReceiptsSearchOkResponse
CashReceiptsCreateRequest
CashReceiptsCreateCreatedResponse
CountResponse
CashReceiptsGetOneOkResponse
CashReceiptsUpdateRequest
CashReceiptsUpdateOkResponse
PaymentsFilter
PaymentsOrder Field to sort by
CashReceiptsGetPaymentsType
PaymentList
CoinFilter
FilterOptions
AddressesSearchFilterType
CoinOrder Field to sort by
CoinsSearchOkResponse
CoinsCreateRequest
CoinsCreateCreatedResponse
CoinCryptoTransactionFilter
CoinsCryptoTransactionsCountOkResponse
CoinsCryptoTransactionsOkResponse
CoinsIdSummaryFilter
CoinsIdSummaryOrder Field to sort by
CoinsIdSummaryOkResponse
CoinsOneOkResponse
CoinsUpdateRequest
CoinsUpdateOkResponse
CoinsGetKnownCoinOkResponse
CoinsGetKnownCoinsOkResponse
CoinsSummaryFilter
CoinsSummaryOrder Field to sort by
CoinsSummaryOkResponse
ConsolidationRatesSearchFilter
FilterOptions
AddressesSearchFilterType
ConsolidationRatesSearchOrder Field to sort by
ConsolidationRatesSearchOkResponse
ConsolidationRatesUpsertRequest
ConsolidationRatesUpsertOkResponse
ConsolidationRatesOneOkResponse
ConsolidationRatesPopulateRequest
ConsolidationRatesResetOkResponse
ContactFilter
FilterOptions
AddressesSearchFilterType
ContactsSearchOrder Field to sort by
ContactsSearchOkResponse
ContactsCreateRequest
ContactsCreateCreatedResponse
CountResponse
ContactsOneOkResponse
ContactsUpdateRequest
ContactsUpdateOkResponse
CostCenterFilter
FilterOptions
AddressesSearchFilterType
CostCentersSearchStatus
CostCentersSearchOrder Field to sort by
CostCentersSearchOkResponse
CostCentersCreateRequest
CostCentersCreateCreatedResponse
CountResponse
CostCentersOneOkResponse
CostCentersUpdateRequest
CostCentersUpdateOkResponse
CryptoTransactionsGetCostBasisOkResponse
CryptoTransactionsGetCostLayersType s: Sent Cost Layers, f: Fee Cost Layers
CryptoTransactionsGetCostLayersOkResponse
CryptoTransactionFilter
FilterOptions
AddressesSearchFilterType
CryptoTransactionsCountOkResponse
CryptoTransactionsSearchOrder Field to sort by
CryptoTransactionsSearchOkResponse
CryptoTransactionsCreateRequest
CryptoTransactionsCreateCreatedResponse
CryptoTransactionsOneOkResponse
CryptoTransactionsUpdateRequest
CryptoTransactionsUpdateOkResponse
CryptoTransactionsMergeRequest
CryptoTransactionsMergeCreatedResponse
CurrenciesSearchOkResponse
CurrenciesCreateRequest
CurrenciesCreateCreatedResponse
CurrencyForexRatesOkResponse
CurrenciesGetOneOkResponse
CurrenciesUpdateRequest
CurrenciesUpdateOkResponse
CustomDimensionFilter
FilterOptions
AddressesSearchFilterType
CostCentersSearchStatus
CustomSearchOrder Field to sort by
CustomSearchOkResponse
CustomCreateRequest
CustomCreateCreatedResponse
CountResponse
CustomOneOkResponse
CustomUpdateRequest
CustomUpdateOkResponse
CustomerFilter
FilterOptions
AddressesSearchFilterType
CostCentersSearchStatus
CustomersSearchOrder Field to sort by
CustomersSearchOkResponse
CustomersCreateRequest
CustomersCreateCreatedResponse
CountResponse
CustomersOneOkResponse
CustomersUpdateRequest
CustomersUpdateOkResponse
InvoiceFilter
InvoiceOrder Field to sort by
CustomersGetInvoicesType
CustomersGetInvoicesOkResponse
InvoiceList
CustomersGetInvoicesCountType
PaymentList
CustomFieldsSearchOkResponse
CustomFieldsUpsertType
CustomFieldsUpsertRequest
CustomFieldsUpsertOkResponse
ObjectType
EmailsGetAllOkResponse
EmailsGetOneOkResponse
FinancialsGetBalanceSheetType

Package Sidebar

Install

npm i @softledger/node

Weekly Downloads

15

Version

0.3.0

License

MIT

Unpacked Size

13.2 MB

Total Files

6

Last publish

Collaborators

  • gostrega