UNPKG

facturapi

Version:

Librería oficial de Facturapi. Crea CFDIs timbrados y enviados al SAT, XML y PDF

55 lines (54 loc) 1.86 kB
import { Customer, GenericResponse, SearchResult, TaxInfoValidation } from '../types'; import { WrapperClient } from '../wrapper'; export default class Customers { client: WrapperClient; constructor(client: WrapperClient); /** * Creates a new customer in your organization * @param data Customer data * @param params Query params * @returns Customer object */ create(data: Record<string, any>, params?: Record<string, any> | null): Promise<Customer>; /** * Gets a paginated list of customers that belong to your organization * @param params Search parameters * @returns List of customers */ list(params: Record<string, any>): Promise<SearchResult<Customer>>; /** * Gets a single customer object * @param id Customer Id * @returns Customer object */ retrieve(id: string): Promise<Customer>; /** * Updates a customer * @param id Customer Id * @param data Customer data to update * @param params Query params * @returns Updated customer */ update(id: string, data: Record<string, any>, params?: Record<string, any> | null): Promise<Customer>; /** * Permanently removes a customer from your organization. * @param id Customer Id * @returns Deleted customer */ del(id: string): Promise<Customer>; /** * Validate customer with SAT validation. * @param id Customer Id * @returns Validation result */ validateTaxInfo(id: string): Promise<TaxInfoValidation>; /** * Send the customer an email with a link to edit their information. * @param id Customer Id * @param options Email options * @param options.email Email address to send the link to */ sendEditLinkByEmail(id: string, options: { email: string; }): Promise<GenericResponse>; }