@uguratakan/corporatetools-client
v1.0.0
Published
TypeScript client library for Corporate Tools API
Maintainers
Readme
@uguratakan/corporatetools-client
TypeScript client library for Corporate Tools API. Standalone version that works without NestJS dependencies.
Installation
npm install @uguratakan/corporatetools-client
# or
yarn add @uguratakan/corporatetools-client
# or
pnpm add @uguratakan/corporatetools-clientQuick Start
import { CorporateToolsClient } from '@uguratakan/corporatetools-client';
const client = new CorporateToolsClient({
apiUrl: 'https://api.corporatetools.com',
accessKey: 'your-access-key',
secretKey: 'your-secret-key',
websiteUrl: 'https://your-website.com' // Your Provider for example www.registeredagentsinc.com
});
// Use the client
const companies = await client.listCompanies();
const account = await client.getAccount();Configuration
interface CorporateToolsConfig {
apiUrl: string; // Required: Corporate Tools API URL
accessKey: string; // Required: Your access key
secretKey: string; // Required: Your secret key
websiteUrl: string; // Required: Your Provider for example www.registeredagentsinc.com
timeout?: number; // Optional: Request timeout in ms (default: 30000)
logger?: { // Optional: Custom logger
log: (message: string) => void;
error: (message: string) => void;
debug: (message: string) => void;
};
}API Methods
Account
getAccount()- Get account informationgetAccountDashpanel()- Get account dashboard data
Companies
listCompanies(params?)- List companiesgetCompany(id)- Get company by IDcreateCompany(company, options?)- Create a companyupdateCompanies(payload)- Update companies
Documents
listDocuments(params?)- List documentsgetDocument(id)- Get document by IDgetDocumentPageAsPng(id, pageNumber, dpi?)- Get document page as PNGgetDocumentPageUrl(id, pageNumber, dpi?)- Get document page URLbulkDownloadDocuments(ids)- Bulk download documentsdownloadDocumentPdf(id)- Download document as PDFunlockDocument(id, paymentToken)- Unlock document
Invoices
listInvoices(params)- List invoicesgetInvoice(id)- Get invoice by IDpayInvoices(paymentToken, invoiceIds)- Pay invoices
Services
listServices(params)- List servicescreateServices(payload)- Create servicesrequestServiceCancel(id)- Request service cancellationgetServiceInfo<T>(id)- Get service infoupdateServiceInfo(id, info)- Update service info
Payment Methods
getPaymentMethods()- List payment methodscreatePaymentMethod(payload)- Create payment methodupdatePaymentMethod(id, payload)- Update payment methoddeletePaymentMethod(id)- Delete payment method
Shopping Cart
addToShoppingCart(params)- Add item to cartgetShoppingCart(params?)- Get shopping cartcheckoutShoppingCart(params)- Checkout cartdeleteShoppingCartItem(itemIds)- Delete cart items
Order Items
listOrderItemsRequiringAttention(companyId?)- List order items requiring attentionupdateOrderItemRequiringAttention(payload)- Update order item
Resources
listResources(params?)- List resourcesgetResource(id)- Get resource by IDgetResourcePageAsPng(id, pageNumber, dpi?)- Get resource page as PNGdownloadResourcePdf(id)- Download resource as PDF
Filing Products & Methods
listFilingProducts(params?)- List filing productslistRegisteredAgentProducts()- List registered agent productslistFilingMethods(options)- List filing methodsgetFilingMethodShemas(companyId, filingMethodId)- Get filing method schemasgetFilingProductOfferings({companyId, jurisdiction})- Get filing product offerings
Signed Forms
getSignedForms(params)- Get signed forms
Simple Products
listSimpleProducts()- List simple products
Websites
getWebsite()- Get website information
Compliance Events
listComplianceEvents(params)- List compliance events
Callbacks
listCallbacks()- List callbackscreateCallback(url)- Create callbackdeleteCallback(id)- Delete callback
TypeScript Support
Full TypeScript support with comprehensive type definitions included. All types are exported from the package.
Examples
List Companies
const companies = await client.listCompanies({
limit: 10,
offset: 0,
});Create Company
const company = await client.createCompany({
name: 'My Company LLC',
entity_type: 'Limited Liability Company',
jurisdictions: [CTJurisdiction.Delaware],
});Get Documents
const documents = await client.listDocuments({
company_id: 'company-id',
status: 'unread',
});Custom Logger
const client = new CorporateToolsClient({
apiUrl: 'https://api.corporatetools.com',
accessKey: 'your-access-key',
secretKey: 'your-secret-key',
logger: {
log: (msg) => console.log(`[INFO] ${msg}`),
error: (msg) => console.error(`[ERROR] ${msg}`),
debug: (msg) => console.debug(`[DEBUG] ${msg}`),
},
});License
MIT
