- batchCreateCompanyJournals - Batch Create Journals
- createCompanyJournal - Create Journal
- getCompany - Get Company
- getCompanyAccount - Get Account
- getCompanyJournal - Get Journal
- getCompanyTaxRate - Get Tax Rate
- listCompanies - List Companies
- listCompanyAccounts - List Accounts
- listCompanyJournals - List Journals
- listCompanyTaxRates - List Tax Rates
Batch Create Journals
import { StackOne } from "@stackone/stackone-client-ts";
const stackOne = new StackOne({
security: {
password: "",
username: "",
},
});
async function run() {
const result = await stackOne.accounting.batchCreateCompanyJournals({
accountingJournalBatchCreateRequestDto: {
items: [],
},
prefer: "heartbeat",
id: "<id>",
xAccountId: "<id>",
});
console.log(result);
}
run();The standalone function version of this method:
import { StackOneCore } from "@stackone/stackone-client-ts/core.js";
import { accountingBatchCreateCompanyJournals } from "@stackone/stackone-client-ts/funcs/accountingBatchCreateCompanyJournals.js";
// Use `StackOneCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const stackOne = new StackOneCore({
security: {
password: "",
username: "",
},
});
async function run() {
const res = await accountingBatchCreateCompanyJournals(stackOne, {
accountingJournalBatchCreateRequestDto: {
items: [],
},
prefer: "heartbeat",
id: "<id>",
xAccountId: "<id>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("accountingBatchCreateCompanyJournals failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.AccountingBatchCreateCompanyJournalsRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.AccountingBatchCreateCompanyJournalsResponse>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.BadRequestResponse | 400 | application/json |
| errors.UnauthorizedResponse | 401 | application/json |
| errors.ForbiddenResponse | 403 | application/json |
| errors.NotFoundResponse | 404 | application/json |
| errors.RequestTimedOutResponse | 408 | application/json |
| errors.ConflictResponse | 409 | application/json |
| errors.PreconditionFailedResponse | 412 | application/json |
| errors.UnprocessableEntityResponse | 422 | application/json |
| errors.TooManyRequestsResponse | 429 | application/json |
| errors.InternalServerErrorResponse | 500 | application/json |
| errors.NotImplementedResponse | 501 | application/json |
| errors.BadGatewayResponse | 502 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
Create Journal
import { StackOne } from "@stackone/stackone-client-ts";
import { AccountingJournalCreateRequestDtoValue } from "@stackone/stackone-client-ts/sdk/models/shared";
const stackOne = new StackOne({
security: {
password: "",
username: "",
},
});
async function run() {
const result = await stackOne.accounting.createCompanyJournal({
accountingJournalCreateRequestDto: {
currencyCode: {
sourceValue: "USD",
value: AccountingJournalCreateRequestDtoValue.Usd,
},
exchangeRate: 1,
lines: [
{
accountId: "acc_123456789",
amount: 10010,
description: "Payment for office supplies",
taxAmount: 10010,
taxRateId: "tax_123456789",
},
],
memo: "Monthly closing entries",
reference: "JRN-2024-001",
transactionDate: new Date("2024-03-20T10:00:00Z"),
},
prefer: "heartbeat",
id: "<id>",
xAccountId: "<id>",
});
console.log(result);
}
run();The standalone function version of this method:
import { StackOneCore } from "@stackone/stackone-client-ts/core.js";
import { accountingCreateCompanyJournal } from "@stackone/stackone-client-ts/funcs/accountingCreateCompanyJournal.js";
import { AccountingJournalCreateRequestDtoValue } from "@stackone/stackone-client-ts/sdk/models/shared";
// Use `StackOneCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const stackOne = new StackOneCore({
security: {
password: "",
username: "",
},
});
async function run() {
const res = await accountingCreateCompanyJournal(stackOne, {
accountingJournalCreateRequestDto: {
currencyCode: {
sourceValue: "USD",
value: AccountingJournalCreateRequestDtoValue.Usd,
},
exchangeRate: 1,
lines: [
{
accountId: "acc_123456789",
amount: 10010,
description: "Payment for office supplies",
taxAmount: 10010,
taxRateId: "tax_123456789",
},
],
memo: "Monthly closing entries",
reference: "JRN-2024-001",
transactionDate: new Date("2024-03-20T10:00:00Z"),
},
prefer: "heartbeat",
id: "<id>",
xAccountId: "<id>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("accountingCreateCompanyJournal failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.AccountingCreateCompanyJournalRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.AccountingCreateCompanyJournalResponse>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.BadRequestResponse | 400 | application/json |
| errors.UnauthorizedResponse | 401 | application/json |
| errors.ForbiddenResponse | 403 | application/json |
| errors.NotFoundResponse | 404 | application/json |
| errors.RequestTimedOutResponse | 408 | application/json |
| errors.ConflictResponse | 409 | application/json |
| errors.PreconditionFailedResponse | 412 | application/json |
| errors.UnprocessableEntityResponse | 422 | application/json |
| errors.TooManyRequestsResponse | 429 | application/json |
| errors.InternalServerErrorResponse | 500 | application/json |
| errors.NotImplementedResponse | 501 | application/json |
| errors.BadGatewayResponse | 502 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
Get Company
import { StackOne } from "@stackone/stackone-client-ts";
const stackOne = new StackOne({
security: {
password: "",
username: "",
},
});
async function run() {
const result = await stackOne.accounting.getCompany({
prefer: "heartbeat",
fields: "id,remote_id,name,base_currency,fiscal_year_start_month,fiscal_year_start_day,unified_custom_fields",
id: "<id>",
xAccountId: "<id>",
});
console.log(result);
}
run();The standalone function version of this method:
import { StackOneCore } from "@stackone/stackone-client-ts/core.js";
import { accountingGetCompany } from "@stackone/stackone-client-ts/funcs/accountingGetCompany.js";
// Use `StackOneCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const stackOne = new StackOneCore({
security: {
password: "",
username: "",
},
});
async function run() {
const res = await accountingGetCompany(stackOne, {
prefer: "heartbeat",
fields: "id,remote_id,name,base_currency,fiscal_year_start_month,fiscal_year_start_day,unified_custom_fields",
id: "<id>",
xAccountId: "<id>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("accountingGetCompany failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.AccountingGetCompanyRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.AccountingGetCompanyResponse>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.BadRequestResponse | 400 | application/json |
| errors.UnauthorizedResponse | 401 | application/json |
| errors.ForbiddenResponse | 403 | application/json |
| errors.NotFoundResponse | 404 | application/json |
| errors.RequestTimedOutResponse | 408 | application/json |
| errors.ConflictResponse | 409 | application/json |
| errors.PreconditionFailedResponse | 412 | application/json |
| errors.UnprocessableEntityResponse | 422 | application/json |
| errors.TooManyRequestsResponse | 429 | application/json |
| errors.InternalServerErrorResponse | 500 | application/json |
| errors.NotImplementedResponse | 501 | application/json |
| errors.BadGatewayResponse | 502 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
Get Account
import { StackOne } from "@stackone/stackone-client-ts";
const stackOne = new StackOne({
security: {
password: "",
username: "",
},
});
async function run() {
const result = await stackOne.accounting.getCompanyAccount({
prefer: "heartbeat",
fields: "id,remote_id,company_id,remote_company_id,code,name,type,active,unified_custom_fields",
id: "<id>",
subResourceId: "<id>",
xAccountId: "<id>",
});
console.log(result);
}
run();The standalone function version of this method:
import { StackOneCore } from "@stackone/stackone-client-ts/core.js";
import { accountingGetCompanyAccount } from "@stackone/stackone-client-ts/funcs/accountingGetCompanyAccount.js";
// Use `StackOneCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const stackOne = new StackOneCore({
security: {
password: "",
username: "",
},
});
async function run() {
const res = await accountingGetCompanyAccount(stackOne, {
prefer: "heartbeat",
fields: "id,remote_id,company_id,remote_company_id,code,name,type,active,unified_custom_fields",
id: "<id>",
subResourceId: "<id>",
xAccountId: "<id>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("accountingGetCompanyAccount failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.AccountingGetCompanyAccountRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.AccountingGetCompanyAccountResponse>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.BadRequestResponse | 400 | application/json |
| errors.UnauthorizedResponse | 401 | application/json |
| errors.ForbiddenResponse | 403 | application/json |
| errors.NotFoundResponse | 404 | application/json |
| errors.RequestTimedOutResponse | 408 | application/json |
| errors.ConflictResponse | 409 | application/json |
| errors.PreconditionFailedResponse | 412 | application/json |
| errors.UnprocessableEntityResponse | 422 | application/json |
| errors.TooManyRequestsResponse | 429 | application/json |
| errors.InternalServerErrorResponse | 500 | application/json |
| errors.NotImplementedResponse | 501 | application/json |
| errors.BadGatewayResponse | 502 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
Get Journal
import { StackOne } from "@stackone/stackone-client-ts";
const stackOne = new StackOne({
security: {
password: "",
username: "",
},
});
async function run() {
const result = await stackOne.accounting.getCompanyJournal({
prefer: "heartbeat",
fields: "id,remote_id,company_id,remote_company_id,reference,memo,transaction_date,status,lines,created_at,updated_at,posted_at,unified_custom_fields",
id: "<id>",
subResourceId: "<id>",
xAccountId: "<id>",
});
console.log(result);
}
run();The standalone function version of this method:
import { StackOneCore } from "@stackone/stackone-client-ts/core.js";
import { accountingGetCompanyJournal } from "@stackone/stackone-client-ts/funcs/accountingGetCompanyJournal.js";
// Use `StackOneCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const stackOne = new StackOneCore({
security: {
password: "",
username: "",
},
});
async function run() {
const res = await accountingGetCompanyJournal(stackOne, {
prefer: "heartbeat",
fields: "id,remote_id,company_id,remote_company_id,reference,memo,transaction_date,status,lines,created_at,updated_at,posted_at,unified_custom_fields",
id: "<id>",
subResourceId: "<id>",
xAccountId: "<id>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("accountingGetCompanyJournal failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.AccountingGetCompanyJournalRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.AccountingGetCompanyJournalResponse>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.BadRequestResponse | 400 | application/json |
| errors.UnauthorizedResponse | 401 | application/json |
| errors.ForbiddenResponse | 403 | application/json |
| errors.NotFoundResponse | 404 | application/json |
| errors.RequestTimedOutResponse | 408 | application/json |
| errors.ConflictResponse | 409 | application/json |
| errors.PreconditionFailedResponse | 412 | application/json |
| errors.UnprocessableEntityResponse | 422 | application/json |
| errors.TooManyRequestsResponse | 429 | application/json |
| errors.InternalServerErrorResponse | 500 | application/json |
| errors.NotImplementedResponse | 501 | application/json |
| errors.BadGatewayResponse | 502 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
Get Tax Rate
import { StackOne } from "@stackone/stackone-client-ts";
const stackOne = new StackOne({
security: {
password: "",
username: "",
},
});
async function run() {
const result = await stackOne.accounting.getCompanyTaxRate({
prefer: "heartbeat",
fields: "id,remote_id,company_id,remote_company_id,name,code,percentage,active,unified_custom_fields",
id: "<id>",
subResourceId: "<id>",
xAccountId: "<id>",
});
console.log(result);
}
run();The standalone function version of this method:
import { StackOneCore } from "@stackone/stackone-client-ts/core.js";
import { accountingGetCompanyTaxRate } from "@stackone/stackone-client-ts/funcs/accountingGetCompanyTaxRate.js";
// Use `StackOneCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const stackOne = new StackOneCore({
security: {
password: "",
username: "",
},
});
async function run() {
const res = await accountingGetCompanyTaxRate(stackOne, {
prefer: "heartbeat",
fields: "id,remote_id,company_id,remote_company_id,name,code,percentage,active,unified_custom_fields",
id: "<id>",
subResourceId: "<id>",
xAccountId: "<id>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("accountingGetCompanyTaxRate failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.AccountingGetCompanyTaxRateRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.AccountingGetCompanyTaxRateResponse>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.BadRequestResponse | 400 | application/json |
| errors.UnauthorizedResponse | 401 | application/json |
| errors.ForbiddenResponse | 403 | application/json |
| errors.NotFoundResponse | 404 | application/json |
| errors.RequestTimedOutResponse | 408 | application/json |
| errors.ConflictResponse | 409 | application/json |
| errors.PreconditionFailedResponse | 412 | application/json |
| errors.UnprocessableEntityResponse | 422 | application/json |
| errors.TooManyRequestsResponse | 429 | application/json |
| errors.InternalServerErrorResponse | 500 | application/json |
| errors.NotImplementedResponse | 501 | application/json |
| errors.BadGatewayResponse | 502 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
List Companies
import { StackOne } from "@stackone/stackone-client-ts";
const stackOne = new StackOne({
security: {
password: "",
username: "",
},
});
async function run() {
const result = await stackOne.accounting.listCompanies({
prefer: "heartbeat",
fields: "id,remote_id,name,base_currency,fiscal_year_start_month,fiscal_year_start_day,unified_custom_fields",
filter: {
updatedAfter: new Date("2020-01-01T00:00:00.000Z"),
},
xAccountId: "<id>",
});
for await (const page of result) {
console.log(page);
}
}
run();The standalone function version of this method:
import { StackOneCore } from "@stackone/stackone-client-ts/core.js";
import { accountingListCompanies } from "@stackone/stackone-client-ts/funcs/accountingListCompanies.js";
// Use `StackOneCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const stackOne = new StackOneCore({
security: {
password: "",
username: "",
},
});
async function run() {
const res = await accountingListCompanies(stackOne, {
prefer: "heartbeat",
fields: "id,remote_id,name,base_currency,fiscal_year_start_month,fiscal_year_start_day,unified_custom_fields",
filter: {
updatedAfter: new Date("2020-01-01T00:00:00.000Z"),
},
xAccountId: "<id>",
});
if (res.ok) {
const { value: result } = res;
for await (const page of result) {
console.log(page);
}
} else {
console.log("accountingListCompanies failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.AccountingListCompaniesRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.AccountingListCompaniesResponse>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.BadRequestResponse | 400 | application/json |
| errors.UnauthorizedResponse | 401 | application/json |
| errors.ForbiddenResponse | 403 | application/json |
| errors.NotFoundResponse | 404 | application/json |
| errors.RequestTimedOutResponse | 408 | application/json |
| errors.ConflictResponse | 409 | application/json |
| errors.PreconditionFailedResponse | 412 | application/json |
| errors.UnprocessableEntityResponse | 422 | application/json |
| errors.TooManyRequestsResponse | 429 | application/json |
| errors.InternalServerErrorResponse | 500 | application/json |
| errors.NotImplementedResponse | 501 | application/json |
| errors.BadGatewayResponse | 502 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
List Accounts
import { StackOne } from "@stackone/stackone-client-ts";
const stackOne = new StackOne({
security: {
password: "",
username: "",
},
});
async function run() {
const result = await stackOne.accounting.listCompanyAccounts({
prefer: "heartbeat",
fields: "id,remote_id,company_id,remote_company_id,code,name,type,active,unified_custom_fields",
filter: null,
id: "<id>",
xAccountId: "<id>",
});
for await (const page of result) {
console.log(page);
}
}
run();The standalone function version of this method:
import { StackOneCore } from "@stackone/stackone-client-ts/core.js";
import { accountingListCompanyAccounts } from "@stackone/stackone-client-ts/funcs/accountingListCompanyAccounts.js";
// Use `StackOneCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const stackOne = new StackOneCore({
security: {
password: "",
username: "",
},
});
async function run() {
const res = await accountingListCompanyAccounts(stackOne, {
prefer: "heartbeat",
fields: "id,remote_id,company_id,remote_company_id,code,name,type,active,unified_custom_fields",
filter: null,
id: "<id>",
xAccountId: "<id>",
});
if (res.ok) {
const { value: result } = res;
for await (const page of result) {
console.log(page);
}
} else {
console.log("accountingListCompanyAccounts failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.AccountingListCompanyAccountsRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.AccountingListCompanyAccountsResponse>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.BadRequestResponse | 400 | application/json |
| errors.UnauthorizedResponse | 401 | application/json |
| errors.ForbiddenResponse | 403 | application/json |
| errors.NotFoundResponse | 404 | application/json |
| errors.RequestTimedOutResponse | 408 | application/json |
| errors.ConflictResponse | 409 | application/json |
| errors.PreconditionFailedResponse | 412 | application/json |
| errors.UnprocessableEntityResponse | 422 | application/json |
| errors.TooManyRequestsResponse | 429 | application/json |
| errors.InternalServerErrorResponse | 500 | application/json |
| errors.NotImplementedResponse | 501 | application/json |
| errors.BadGatewayResponse | 502 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
List Journals
import { StackOne } from "@stackone/stackone-client-ts";
const stackOne = new StackOne({
security: {
password: "",
username: "",
},
});
async function run() {
const result = await stackOne.accounting.listCompanyJournals({
prefer: "heartbeat",
fields: "id,remote_id,company_id,remote_company_id,reference,memo,transaction_date,status,lines,created_at,updated_at,posted_at,unified_custom_fields",
filter: null,
id: "<id>",
xAccountId: "<id>",
});
for await (const page of result) {
console.log(page);
}
}
run();The standalone function version of this method:
import { StackOneCore } from "@stackone/stackone-client-ts/core.js";
import { accountingListCompanyJournals } from "@stackone/stackone-client-ts/funcs/accountingListCompanyJournals.js";
// Use `StackOneCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const stackOne = new StackOneCore({
security: {
password: "",
username: "",
},
});
async function run() {
const res = await accountingListCompanyJournals(stackOne, {
prefer: "heartbeat",
fields: "id,remote_id,company_id,remote_company_id,reference,memo,transaction_date,status,lines,created_at,updated_at,posted_at,unified_custom_fields",
filter: null,
id: "<id>",
xAccountId: "<id>",
});
if (res.ok) {
const { value: result } = res;
for await (const page of result) {
console.log(page);
}
} else {
console.log("accountingListCompanyJournals failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.AccountingListCompanyJournalsRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.AccountingListCompanyJournalsResponse>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.BadRequestResponse | 400 | application/json |
| errors.UnauthorizedResponse | 401 | application/json |
| errors.ForbiddenResponse | 403 | application/json |
| errors.NotFoundResponse | 404 | application/json |
| errors.RequestTimedOutResponse | 408 | application/json |
| errors.ConflictResponse | 409 | application/json |
| errors.PreconditionFailedResponse | 412 | application/json |
| errors.UnprocessableEntityResponse | 422 | application/json |
| errors.TooManyRequestsResponse | 429 | application/json |
| errors.InternalServerErrorResponse | 500 | application/json |
| errors.NotImplementedResponse | 501 | application/json |
| errors.BadGatewayResponse | 502 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
List Tax Rates
import { StackOne } from "@stackone/stackone-client-ts";
const stackOne = new StackOne({
security: {
password: "",
username: "",
},
});
async function run() {
const result = await stackOne.accounting.listCompanyTaxRates({
prefer: "heartbeat",
fields: "id,remote_id,company_id,remote_company_id,name,code,percentage,active,unified_custom_fields",
filter: {
updatedAfter: new Date("2020-01-01T00:00:00.000Z"),
},
id: "<id>",
xAccountId: "<id>",
});
for await (const page of result) {
console.log(page);
}
}
run();The standalone function version of this method:
import { StackOneCore } from "@stackone/stackone-client-ts/core.js";
import { accountingListCompanyTaxRates } from "@stackone/stackone-client-ts/funcs/accountingListCompanyTaxRates.js";
// Use `StackOneCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const stackOne = new StackOneCore({
security: {
password: "",
username: "",
},
});
async function run() {
const res = await accountingListCompanyTaxRates(stackOne, {
prefer: "heartbeat",
fields: "id,remote_id,company_id,remote_company_id,name,code,percentage,active,unified_custom_fields",
filter: {
updatedAfter: new Date("2020-01-01T00:00:00.000Z"),
},
id: "<id>",
xAccountId: "<id>",
});
if (res.ok) {
const { value: result } = res;
for await (const page of result) {
console.log(page);
}
} else {
console.log("accountingListCompanyTaxRates failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.AccountingListCompanyTaxRatesRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.AccountingListCompanyTaxRatesResponse>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.BadRequestResponse | 400 | application/json |
| errors.UnauthorizedResponse | 401 | application/json |
| errors.ForbiddenResponse | 403 | application/json |
| errors.NotFoundResponse | 404 | application/json |
| errors.RequestTimedOutResponse | 408 | application/json |
| errors.ConflictResponse | 409 | application/json |
| errors.PreconditionFailedResponse | 412 | application/json |
| errors.UnprocessableEntityResponse | 422 | application/json |
| errors.TooManyRequestsResponse | 429 | application/json |
| errors.InternalServerErrorResponse | 500 | application/json |
| errors.NotImplementedResponse | 501 | application/json |
| errors.BadGatewayResponse | 502 | application/json |
| errors.SDKError | 4XX, 5XX | */* |