@softledger/node
v0.5.0
Published
SoftLedger General Ledger Accounting API
Readme
Softledger TypeScript SDK 0.5.0
Welcome to the Softledger SDK documentation. This guide will help you get started with integrating and using the Softledger SDK in your project.
Versions
- API version:
1.0.0 - SDK version:
0.5.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/nodeAuthentication
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({
clientId: 'CLIENT_ID',
clientSecret: 'CLIENT_SECRET',
});
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.
| 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.
| 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 |
