@phasesdk/api-client-for-economic
Version:
e-conomic REST API Library for Node.js is a powerful tool designed to simplify integration with the e-conomic platform for developers building Node.js applications. With this library, developers can effortlessly leverage the full functionality of the e-co
48 lines (47 loc) • 1.44 kB
TypeScript
import RestApi from "../../modules/RestApi";
import { AuthToken, EconomicResponse, Pagination } from "../../types/Economic.type";
import { HttpResponse } from "../../types/Http.type";
import { Account } from "./Accounts";
import { VatType } from "./VatTypes";
import { ContraAccountInfo } from "./Journals";
export type VatAccount = {
account: Pick<Account, "accountNumber" | "self">;
barred: boolean;
contraAccount: Pick<Account, "accountNumber" | "self">;
name: string;
ratePercentage: number;
self: string;
vatCode: string;
vatType: VatType;
};
export type VatAccountNumber = {
account: Account;
barred?: boolean;
contraAccount: ContraAccountInfo;
name: string;
ratePercentage?: number;
self: string;
vatCode?: string;
vatType: VatType;
};
export default class VatAccounts extends RestApi {
/**
* @constructor
*/
constructor(props: AuthToken);
/**
* fetch a collection of all vat accounts
*
* @see https://restdocs.e-conomic.com/#vat-accounts
* @returns {Promise<HttpResponse>}
*
*/
getVatAccounts(offset?: number, limit?: number): Promise<HttpResponse<EconomicResponse<VatAccount[], Pagination, any>>>;
/**
* Fetch a specific vat account
*
* @see https://restdocs.e-conomic.com/#get-vat-accounts-id
*
*/
getVatAccount(vatCode: string): Promise<HttpResponse<VatAccountNumber>>;
}