npm package: @softledger/node
Description: SoftLedger General Ledger Accounting API
Latest version: 0.5.0

# 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.

[![This SDK was generated by liblab](https://public-liblab-readme-assets.s3.us-east-1.amazonaws.com/built-by-liblab-icon.svg)](https://liblab.com/?utm_source=readme)

## Versions

- API version: `1.0.0`
- SDK version: `0.5.0`

## About the API

SoftLedger General Ledger Accounting API

## Table of Contents

- [Setup & Configuration](#setup--configuration)
  - [Supported Language Versions](#supported-language-versions)
  - [Installation](#installation)
- [Authentication](#authentication)
  - [OAuth Authentication](#oauth-authentication)
- [Setting a Custom Timeout](#setting-a-custom-timeout)
- [Sample Usage](#sample-usage)
- [Services](#services)
- [Models](#models)
- [License](#license)

# 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`:

```bash
npm install @softledger/node
```

## Authentication

### OAuth Authentication

The Softledger API uses OAuth for authentication.

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

```ts
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:

```ts
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:

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

# Sample Usage

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

```ts
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.

<details> 
<summary>Below is a list of all available services with links to their detailed documentation:</summary>

| Name                                                                             |
| :------------------------------------------------------------------------------- |
| [AuthenticationService](documentation/services/AuthenticationService.md)         |
| [StatusService](documentation/services/StatusService.md)                         |
| [AddressesService](documentation/services/AddressesService.md)                   |
| [ApiKeysService](documentation/services/ApiKeysService.md)                       |
| [AuditLogsService](documentation/services/AuditLogsService.md)                   |
| [BanksService](documentation/services/BanksService.md)                           |
| [BatchPaymentsService](documentation/services/BatchPaymentsService.md)           |
| [BillsService](documentation/services/BillsService.md)                           |
| [BudgetsService](documentation/services/BudgetsService.md)                       |
| [CashReceiptsService](documentation/services/CashReceiptsService.md)             |
| [CoinsService](documentation/services/CoinsService.md)                           |
| [ConsolidationRatesService](documentation/services/ConsolidationRatesService.md) |
| [ContactsService](documentation/services/ContactsService.md)                     |
| [CostCentersService](documentation/services/CostCentersService.md)               |
| [CryptoTransactionsService](documentation/services/CryptoTransactionsService.md) |
| [CurrenciesService](documentation/services/CurrenciesService.md)                 |
| [CustomDimensionsService](documentation/services/CustomDimensionsService.md)     |
| [CustomersService](documentation/services/CustomersService.md)                   |
| [CustomFieldsService](documentation/services/CustomFieldsService.md)             |
| [EmailsService](documentation/services/EmailsService.md)                         |
| [ReportsService](documentation/services/ReportsService.md)                       |
| [FxRemeasureService](documentation/services/FxRemeasureService.md)               |
| [StockAdjustmentsService](documentation/services/StockAdjustmentsService.md)     |
| [InvoicesService](documentation/services/InvoicesService.md)                     |
| [ItemsService](documentation/services/ItemsService.md)                           |
| [JobsService](documentation/services/JobsService.md)                             |
| [JournalsService](documentation/services/JournalsService.md)                     |
| [LedgerAccountsService](documentation/services/LedgerAccountsService.md)         |
| [LocationsService](documentation/services/LocationsService.md)                   |
| [PartNumbersService](documentation/services/PartNumbersService.md)               |
| [PaymentsService](documentation/services/PaymentsService.md)                     |
| [PeriodsService](documentation/services/PeriodsService.md)                       |
| [PreferencesService](documentation/services/PreferencesService.md)               |
| [ProductsService](documentation/services/ProductsService.md)                     |
| [PurchaseOrdersService](documentation/services/PurchaseOrdersService.md)         |
| [RecurringJobsService](documentation/services/RecurringJobsService.md)           |
| [ReportLayoutsService](documentation/services/ReportLayoutsService.md)           |
| [RolesService](documentation/services/RolesService.md)                           |
| [SalesOrdersService](documentation/services/SalesOrdersService.md)               |
| [SettingsService](documentation/services/SettingsService.md)                     |
| [ShipmentReceiptsService](documentation/services/ShipmentReceiptsService.md)     |
| [StatementsService](documentation/services/StatementsService.md)                 |
| [StockCountsService](documentation/services/StockCountsService.md)               |
| [SystemJobsService](documentation/services/SystemJobsService.md)                 |
| [TaxCodesService](documentation/services/TaxCodesService.md)                     |
| [TemplatesService](documentation/services/TemplatesService.md)                   |
| [TimezonesService](documentation/services/TimezonesService.md)                   |
| [TransactionsService](documentation/services/TransactionsService.md)             |
| [TransfersService](documentation/services/TransfersService.md)                   |
| [UsersService](documentation/services/UsersService.md)                           |
| [VendorCreditsService](documentation/services/VendorCreditsService.md)           |
| [VendorPricesService](documentation/services/VendorPricesService.md)             |
| [VendorsService](documentation/services/VendorsService.md)                       |
| [WalletsService](documentation/services/WalletsService.md)                       |
| [WarehousesService](documentation/services/WarehousesService.md)                 |
| [WarehouseItemsService](documentation/services/WarehouseItemsService.md)         |
| [WebhooksService](documentation/services/WebhooksService.md)                     |
| [YearsService](documentation/services/YearsService.md)                           |

</details>

## 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.

<details> 
<summary>Below is a list of all available models with links to their detailed documentation:</summary>

| Name                                                                                                                           | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| :----------------------------------------------------------------------------------------------------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [RequestTokenRequest](documentation/models/RequestTokenRequest.md)                                                             |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| [RequestTokenOkResponse](documentation/models/RequestTokenOkResponse.md)                                                       |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| [StatusGetOneType](documentation/models/StatusGetOneType.md)                                                                   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| [StatusGetOneOkResponse](documentation/models/StatusGetOneOkResponse.md)                                                       |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| [AddressFilter](documentation/models/AddressFilter.md)                                                                         |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| [FilterOptions](documentation/models/FilterOptions.md)                                                                         |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| [AddressesSearchFilterType](documentation/models/AddressesSearchFilterType.md)                                                 |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| [AddressesSearchOrder](documentation/models/AddressesSearchOrder.md)                                                           | Field to sort by                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| [AddressesSearchOkResponse](documentation/models/AddressesSearchOkResponse.md)                                                 |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| [AddressesCreateRequest](documentation/models/AddressesCreateRequest.md)                                                       |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| [AddressesCreateCreatedResponse](documentation/models/AddressesCreateCreatedResponse.md)                                       |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| [CountResponse](documentation/models/CountResponse.md)                                                                         |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| [AddressesUpdateRequest](documentation/models/AddressesUpdateRequest.md)                                                       |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| [AddressesUpdateOkResponse](documentation/models/AddressesUpdateOkResponse.md)                                                 |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| [AddressesOneOkResponse](documentation/models/AddressesOneOkResponse.md)                                                       |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| [ApiKeysGetAllOkResponse](documentation/models/ApiKeysGetAllOkResponse.md)                                                     |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| [ApiKeysCreateRequest](documentation/models/ApiKeysCreateRequest.md)                                                           |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| [ApiKeysCreateCreatedResponse](documentation/models/ApiKeysCreateCreatedResponse.md)                                           |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| [ApiKeysGetPermissionsOkResponse](documentation/models/ApiKeysGetPermissionsOkResponse.md)                                     |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| [ApiKeysUpdatePermissionsRequest](documentation/models/ApiKeysUpdatePermissionsRequest.md)                                     |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| [AuditLogsSearchFilter](documentation/models/AuditLogsSearchFilter.md)                                                         |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| [FilterOptions](documentation/models/FilterOptions.md)                                                                         |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| [AuditLogsSearchOkResponse](documentation/models/AuditLogsSearchOkResponse.md)                                                 |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| [BankFilter](documentation/models/BankFilter.md)                                                                               |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| [FilterOptions](documentation/models/FilterOptions.md)                                                                         |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| [AddressesSearchFilterType](documentation/models/AddressesSearchFilterType.md)                                                 |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| [BankOrder](documentation/models/BankOrder.md)                                                                                 | Field to sort by                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| [BanksSearchOkResponse](documentation/models/BanksSearchOkResponse.md)                                                         |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| [BankAccountsCreateRequest](documentation/models/BankAccountsCreateRequest.md)                                                 |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| [BankAccountsCreateCreatedResponse](documentation/models/BankAccountsCreateCreatedResponse.md)                                 |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| [BankTransactionFilter](documentation/models/BankTransactionFilter.md)                                                         |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| [BankTransactionOrder](documentation/models/BankTransactionOrder.md)                                                           | Field to sort by                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| [BanksGetAccountTransactionsOkResponse](documentation/models/BanksGetAccountTransactionsOkResponse.md)                         |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| [BanksLinkAccountRequest](documentation/models/BanksLinkAccountRequest.md)                                                     |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| [BatchPaymentFilter](documentation/models/BatchPaymentFilter.md)                                                               |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| [FilterOptions](documentation/models/FilterOptions.md)                                                                         |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| [AddressesSearchFilterType](documentation/models/AddressesSearchFilterType.md)                                                 |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| [BatchPaymentsSearchOrder](documentation/models/BatchPaymentsSearchOrder.md)                                                   | Field to sort by                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| [BatchPaymentsSearchOkResponse](documentation/models/BatchPaymentsSearchOkResponse.md)                                         |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| [BatchPaymentsCreateRequest](documentation/models/BatchPaymentsCreateRequest.md)                                               |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| [BatchPaymentsCreateCreatedResponse](documentation/models/BatchPaymentsCreateCreatedResponse.md)                               |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| [BillFilter](documentation/models/BillFilter.md)                                                                               |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| [BillOrder](documentation/models/BillOrder.md)                                                                                 | Field to sort by                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| [BatchPaymentsBillsType](documentation/models/BatchPaymentsBillsType.md)                                                       |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| [BatchPaymentsBillsOkResponse](documentation/models/BatchPaymentsBillsOkResponse.md)                                           |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| [BatchPaymentsBillsCountType](documentation/models/BatchPaymentsBillsCountType.md)                                             |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| [CountResponse](documentation/models/CountResponse.md)                                                                         |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| [BatchPaymentsOneOkResponse](documentation/models/BatchPaymentsOneOkResponse.md)                                               |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| [PaymentsFilter](documentation/models/PaymentsFilter.md)                                                                       |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| [BatchPaymentsPaymentsOrder](documentation/models/BatchPaymentsPaymentsOrder.md)                                               | Field to sort by                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| [BatchPaymentsPaymentsOkResponse](documentation/models/BatchPaymentsPaymentsOkResponse.md)                                     |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| [BatchPaymentsPaymentsCountType](documentation/models/BatchPaymentsPaymentsCountType.md)                                       |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| [BatchPaymentsVoidRequest](documentation/models/BatchPaymentsVoidRequest.md)                                                   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| [BillFilter](documentation/models/BillFilter.md)                                                                               |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| [AddressesSearchFilterType](documentation/models/AddressesSearchFilterType.md)                                                 |