UNPKG

sdk-node-apis-efi

Version:

Module for integration with Efi Bank API

1,713 lines 92.8 kB
export class CobrancasMethods extends ExtratosMethods { /** * **POST /v1/charge/one-step** * * Criação de transação em One Step (Um passo) * * Para capturar uma falha utilize o `catch`, os campos disponíveis no objeto serão `code`, `error` e `error_description`. * * Obs: Para Pessoa Jurídica não serão obrigatórios o nome e CPF, apenas os demais dados do cliente contidos em juridical_person * * Obs: Caso utilize o campo configurations interest, se optar por utilizar apenas o valor, o tipo será considerado como "daily" * * @param { {} } params * @param { { * items: Array<{ * name: string, * value: number, * amount: number, * marketplace?: { * mode?: string, * repasses: Array<{ * payee_code: string, * percentage?: number, * fixed?: number * }> * } * }>, * shippings?: Array<{ * name: string, * value: number, * payee_code?: string * }>, * metadata?: { * custom_id?: string, * notification_url?: string * }, * payment: { * banking_billet?: { * customer: { * name?: string, * cpf?: string, * email?: string, * phone_number?: string, * birth?: string, * address?: { * street: string, * number: string, * neighborhood: string, * zipcode: string, * city: string, * complement?: string, * state: string * }, * juridical_person?: { * corporate_name: string, * cnpj: string * } * }, * expire_at: string, * discount?: { * type: 'percentage' | 'currency', * value: number * }, * conditional_discount?: { * type: 'percentage' | 'currency', * value: number, * until_date: string * }, * configurations?: { * days_to_write_off?: number, * fine?: number, * interest?: { * value: number, * type: 'monthly' | 'daily' * } | number * }, * message?: string * }, * credit_card?: { * customer: { * name: string, * cpf: string, * email: string, * phone_number?: string, * birth?: string, * address?: { * street: string, * number: string, * neighborhood: string, * zipcode: string, * city: string, * complement?: string, * state: string * }, * juridical_person?: { * corporate_name: string, * cnpj: string * } * }, * installments: number, * discount?: { * type: 'percentage' | 'currency', * value: number * }, * billing_address?: { * street: string, * number: string, * neighborhood: string, * zipcode: string, * city: string, * complement?: string, * state: string * }, * payment_token: string, * message?: string * } * } * } } body * * @returns {Promise<{ * code: number, * data: { * charge_id: number, * total: number, * status: string, * barcode?: string, * pix?: { * qrcode: string, * qrcode_image: string * } * link?: string, * billet_link?: string, * pdf?: { * charge: string * }, * expire_at?: string, * installments?: number, * installment_value?: number, * refusal?: { * reason: string, * retry: boolean * } * payment: string, * } * }>} */ createOneStepCharge(params: {}, body: { items: Array<{ name: string; value: number; amount: number; marketplace?: { mode?: string; repasses: Array<{ payee_code: string; percentage?: number; fixed?: number; }>; }; }>; shippings?: Array<{ name: string; value: number; payee_code?: string; }>; metadata?: { custom_id?: string; notification_url?: string; }; payment: { banking_billet?: { customer: { name?: string; cpf?: string; email?: string; phone_number?: string; birth?: string; address?: { street: string; number: string; neighborhood: string; zipcode: string; city: string; complement?: string; state: string; }; juridical_person?: { corporate_name: string; cnpj: string; }; }; expire_at: string; discount?: { type: 'percentage' | 'currency'; value: number; }; conditional_discount?: { type: 'percentage' | 'currency'; value: number; until_date: string; }; configurations?: { days_to_write_off?: number; fine?: number; interest?: { value: number; type: 'monthly' | 'daily'; } | number; }; message?: string; }; credit_card?: { customer: { name: string; cpf: string; email: string; phone_number?: string; birth?: string; address?: { street: string; number: string; neighborhood: string; zipcode: string; city: string; complement?: string; state: string; }; juridical_person?: { corporate_name: string; cnpj: string; }; }; installments: number; discount?: { type: 'percentage' | 'currency'; value: number; }; billing_address?: { street: string; number: string; neighborhood: string; zipcode: string; city: string; complement?: string; state: string; }; payment_token: string; message?: string; }; }; }): Promise<{ code: number; data: { charge_id: number; total: number; status: string; barcode?: string; pix?: { qrcode: string; qrcode_image: string; }; link?: string; billet_link?: string; pdf?: { charge: string; }; expire_at?: string; installments?: number; installment_value?: number; refusal?: { reason: string; retry: boolean; }; payment: string; }; }>; /** * **POST /v1/charge** * * Criar transação * * Para capturar uma falha utilize o `catch`, os campos disponíveis no objeto serão `code`, `error` e `error_description`. * * @param { {} } params * @param { { * items: Array<{ * name: string, * value: number, * amount: number, * marketplace?: { * payee_code: string, * percentage?: number * } * }>, * shippings?: Array<{ * name: string, * value: number, * payee_code?: string * }>, * metadata?: { * custom_id?: string, * notification_url?: string * } * } } body * * @returns {Promise<{ * code: number, * data: { * charge_id: number, * total: number, * status: string, * custom_id: string | null, * created_at: string, * } * }>} */ createCharge(params: {}, body: { items: Array<{ name: string; value: number; amount: number; marketplace?: { payee_code: string; percentage?: number; }; }>; shippings?: Array<{ name: string; value: number; payee_code?: string; }>; metadata?: { custom_id?: string; notification_url?: string; }; }): Promise<{ code: number; data: { charge_id: number; total: number; status: string; custom_id: string | null; created_at: string; }; }>; /** * **POST /v1/charge/:id/pay** * * Associar à forma de pagamento * * Para capturar uma falha utilize o `catch`, os campos disponíveis no objeto serão `code`, `error` e `error_description`. * * Obs: Para Pessoa Jurídica não serão obrigatórios o nome e CPF, apenas os demais dados do cliente contidos em juridical_person * * Obs: Caso utilize o campo configurations interest, se optar por utilizar apenas o valor, o tipo será considerado como "daily" * * @param { { id: number } } params * @param { { * payment: { * banking_billet?: { * customer: { * name?: string, * cpf?: string, * email: string, * phone_number?: string, * birth?: string, * address: { * street: string, * number: string, * neighborhood: string, * zipcode: string, * city: string, * complement?: string, * state: string * }, * juridical_person?: { * corporate_name: string, * cnpj: string * } * }, * expire_at: string, * discount?: { * type: 'percentage' | 'currency', * value: number * }, * conditional_discount?: { * type: 'percentage' | 'currency', * value: number, * until_date: string * }, * configurations?: { * days_to_write_off?: number, * fine?: number, * interest?: { * value: number, * type: 'monthly' | 'daily' * } | number * }, * message?: string * }, * credit_card?: { * customer: { * name?: string, * cpf?: string, * email: string, * phone_number?: string, * birth?: string, * address: { * street: string, * number: string, * neighborhood: string, * zipcode: string, * city: string, * complement?: string, * state: string * }, * juridical_person?: { * corporate_name: string, * cnpj: string * } * }, * installments: number, * discount?: { * type: 'percentage' | 'currency', * value: number * }, * billing_address: { * street: string, * number: string, * neighborhood: string, * zipcode: string, * city: string, * complement?: string, * state: string * }, * payment_token: string, * message?: string * } * } * } } body * * @returns {Promise<{ * code: number, * data: { * charge_id: number, * total: number, * status: string, * reason?: string | null, * payment: string * barcode: string, * pix?: { * qrcode: string, * qrcode_image: string * }, * link?: string, * pdf?: { * charge: string * }, * expire_at?: string, * configurations?: { * days_to_write_off: number, * interest_type?: 'monthly'| 'daily', * interest?: number, * fine?: number * } * installments?: number, * installment_value?: number * } * }>} */ definePayMethod(params: { id: number; }, body: { payment: { banking_billet?: { customer: { name?: string; cpf?: string; email: string; phone_number?: string; birth?: string; address: { street: string; number: string; neighborhood: string; zipcode: string; city: string; complement?: string; state: string; }; juridical_person?: { corporate_name: string; cnpj: string; }; }; expire_at: string; discount?: { type: 'percentage' | 'currency'; value: number; }; conditional_discount?: { type: 'percentage' | 'currency'; value: number; until_date: string; }; configurations?: { days_to_write_off?: number; fine?: number; interest?: { value: number; type: 'monthly' | 'daily'; } | number; }; message?: string; }; credit_card?: { customer: { name?: string; cpf?: string; email: string; phone_number?: string; birth?: string; address: { street: string; number: string; neighborhood: string; zipcode: string; city: string; complement?: string; state: string; }; juridical_person?: { corporate_name: string; cnpj: string; }; }; installments: number; discount?: { type: 'percentage' | 'currency'; value: number; }; billing_address: { street: string; number: string; neighborhood: string; zipcode: string; city: string; complement?: string; state: string; }; payment_token: string; message?: string; }; }; }): Promise<{ code: number; data: { charge_id: number; total: number; status: string; reason?: string | null; payment: string; barcode: string; pix?: { qrcode: string; qrcode_image: string; }; link?: string; pdf?: { charge: string; }; expire_at?: string; configurations?: { days_to_write_off: number; interest_type?: 'monthly' | 'daily'; interest?: number; fine?: number; }; installments?: number; installment_value?: number; }; }>; /** * **GET /v1/charge/:id** * * Retornar informações de transação existente * * Para capturar uma falha utilize o `catch`, os campos disponíveis no objeto serão `code`, `error` e `error_description`. * * @param { { id: number } } params * * @returns {Promise<{ * code: number, * data: { * charge_id: number, * total: number, * status: string, * reason?: string, * custom_id: string | null, * created_at: string, * notification_url: string | null, * items: Array<{ * name: string, * value: number, * amount: number * }>, * shippings?: Array<{ * name: string, * value: number, * payee_code: string * }>, * history: Array<{ * message: string, * created_at: string * }>, * customer?: { * name: string | null, * cpf: string | null, * birth?: string, * email?: string, * phone_number?: string, * address?: { * street: string, * number: string, * complement: string | null, * neighborhood: string, * city: string, * state: string, * zipcode: string * } * }, * payment?: { * method: string, * created_at: string, * message: string | null, * banking_billet?: { * barcode: string, * pix?: { * qrcode: string, * qrcode_image: string * }, * link: string, * pdf: { * charge: string * }, * expire_at: string * }, * credit_card?: { * mask: string, * installments: number, * installment_value: number, * address: { * street: string, * number: string, * complement: string | null, * neighborhood: string, * city: string, * state: string, * zipcode: string * } * }, * carnet?: { * parcel: number, * barcode: string, * pix?: { * qrcode: string, * qrcode_image: string * }, * url: string, * parcel_link: string, * pdf: { * charge: string * }, * expire_at: string, * configurations?: { * days_to_write_off?: number, * interest_type?: 'monthly' | 'daily', * interest?: number, * fine?: number * } * } * }, * link?: { * billet_discount: number | null, * card_discount: number | null, * conditional_discount_value: number | null, * conditional_discount_type: string | null, * conditional_discount_date: string | null, * message: string | null, * expire_at: string, * request_delivery_address: boolean, * payment_method: string, * payment_url: string * } * } * }>} */ detailCharge(params: { id: number; }): Promise<{ code: number; data: { charge_id: number; total: number; status: string; reason?: string; custom_id: string | null; created_at: string; notification_url: string | null; items: Array<{ name: string; value: number; amount: number; }>; shippings?: Array<{ name: string; value: number; payee_code: string; }>; history: Array<{ message: string; created_at: string; }>; customer?: { name: string | null; cpf: string | null; birth?: string; email?: string; phone_number?: string; address?: { street: string; number: string; complement: string | null; neighborhood: string; city: string; state: string; zipcode: string; }; }; payment?: { method: string; created_at: string; message: string | null; banking_billet?: { barcode: string; pix?: { qrcode: string; qrcode_image: string; }; link: string; pdf: { charge: string; }; expire_at: string; }; credit_card?: { mask: string; installments: number; installment_value: number; address: { street: string; number: string; complement: string | null; neighborhood: string; city: string; state: string; zipcode: string; }; }; carnet?: { parcel: number; barcode: string; pix?: { qrcode: string; qrcode_image: string; }; url: string; parcel_link: string; pdf: { charge: string; }; expire_at: string; configurations?: { days_to_write_off?: number; interest_type?: 'monthly' | 'daily'; interest?: number; fine?: number; }; }; }; link?: { billet_discount: number | null; card_discount: number | null; conditional_discount_value: number | null; conditional_discount_type: string | null; conditional_discount_date: string | null; message: string | null; expire_at: string; request_delivery_address: boolean; payment_method: string; payment_url: string; }; }; }>; /** * **GET /v1/charges** * * Retornar lista de cobranças * * Este endpoint possui filtros para afunilar os resultados da busca, tais como CPF/CNPJ e status. * Dentre todos os filtros disponíveis, os filtros charge_type, begin_date e end_date são obrigatórios e representam o tipo da transação e o intervalo de datas em que as cobranças consultadas devem estar compreendidas. * * @param {{ * begin_date: string, * end_date: string, * charge_type: 'billet' | 'card' | 'carnet' | 'subscription', * status?: 'new' | 'waiting' | 'link' | 'paid' | 'unpaid' | 'canceled' | 'identified' | 'settled' * date_of?: 'creation' | 'payment' | 'expired', * customer_document?: string, * custom_id?: string, * value?: number, * limit?: number, * page?: number, * offset?: number * }} params * * @returns {Promise<{ * code: number, * data: Array<{ * id: number, * total: number, * status: string, * custom_id: string | null, * created_at: string, * customer: { * phone_number: string | null, * cnpj?: string, * cpf?: string * name?: string * corporate_name?: string * }, * payment?: { * payment_method: string, * paid_at: string | null, * pix?: { * qrcode: string, * qrcode_image: string * } * banking_billet?: { * barcode: string, * link: string, * expire_at: string * pdf: { * charge: string * } * }, * carnet?: { * parcel: number, * barcode: string, * expire_at: string, * link: string, * configurations: { * days_to_write_off: number, * interest_type?: 'monthly' | 'daily', * interest: number, * fine: number * } * pdf: { * charge: string * }, * } * }, * link?: { * billet_discount: number | null, * card_discount: number | null, * conditional_discount_value: number | null, * conditional_discount_type: 'percentage' | 'currency' | null, * conditional_discount_date: string | null, * message: string | null, * expire_at: string, * request_delivery_address: boolean, * payment_method: 'banking_billet' | 'credit_card' | 'all', * payment_url: string * } * }> * >} */ listCharges(params: { begin_date: string; end_date: string; charge_type: 'billet' | 'card' | 'carnet' | 'subscription'; status?: 'new' | 'waiting' | 'link' | 'paid' | 'unpaid' | 'canceled' | 'identified' | 'settled'; date_of?: 'creation' | 'payment' | 'expired'; customer_document?: string; custom_id?: string; value?: number; limit?: number; page?: number; offset?: number; }): Promise<{ code: number; data: Array<{ id: number; total: number; status: string; custom_id: string | null; created_at: string; customer: { phone_number: string | null; cnpj?: string; cpf?: string; name?: string; corporate_name?: string; }; payment?: { payment_method: string; paid_at: string | null; pix?: { qrcode: string; qrcode_image: string; }; banking_billet?: { barcode: string; link: string; expire_at: string; pdf: { charge: string; }; }; carnet?: { parcel: number; barcode: string; expire_at: string; link: string; configurations: { days_to_write_off: number; interest_type?: 'monthly' | 'daily'; interest: number; fine: number; }; pdf: { charge: string; }; }; }; link?: { billet_discount: number | null; card_discount: number | null; conditional_discount_value: number | null; conditional_discount_type: 'percentage' | 'currency' | null; conditional_discount_date: string | null; message: string | null; expire_at: string; request_delivery_address: boolean; payment_method: 'banking_billet' | 'credit_card' | 'all'; payment_url: string; }; }>; }>; /** * **PUT /v1/charge/:id/metadata** * * Incluir "notification_url" e "custom_id" em uma transação existente * * - O atributo `resend` diz se será realizado o reenvio da notificação após a alteração ser aplicada. * * Para capturar uma falha utilize o `catch`, os campos disponíveis no objeto serão `code`, `error` e `error_description`. * * @param { { id: number } } params * @param { { * notification_url?: string, * custom_id?: string, * resend?: boolean * } } body * * @returns {Promise<{ * code: number, * }>} */ updateChargeMetadata(params: { id: number; }, body: { notification_url?: string; custom_id?: string; resend?: boolean; }): Promise<{ code: number; }>; /** * **PUT /v1/charge/:id/billet** * * Altera a data de vencimento de uma transação existente. * * Para capturar uma falha utilize o `catch`, os campos disponíveis no objeto serão `code`, `error` e `error_description`. * * Obs: A nova data de vencimento deve ser pelo menos maior que a data atual. * * @param { { id: number } } params * @param { { expire_at: string }} body * * @returns {Promise<{ * code: number, * }>} */ updateBillet(params: { id: number; }, body: { expire_at: string; }): Promise<{ code: number; }>; /** * **PUT /v1/charge/:id/cancel** * * Cancela uma transação existente * * Para capturar uma falha utilize o `catch`, os campos disponíveis no objeto serão `code`, `error` e `error_description`. * * @param { { id: number } } params * * @returns {Promise<{ * code: number, * }>} */ cancelCharge(params: { id: number; }): Promise<{ code: number; }>; /** * **POST /v1/charge/:id/billet/resend** * * Reenvio do boleto bancário para o email desejado * * Para capturar uma falha utilize o `catch`, os campos disponíveis no objeto serão `code`, `error` e `error_description`. * * @param { { id: number } } params * @param { { email: string }} body * * @returns {Promise<{ * code: number, * }>} */ sendBilletEmail(params: { id: number; }, body: { email: string; }): Promise<{ code: number; }>; /** * **POST /v1/charge/:id/history** * * Acrescentar descrição ao histórico de uma transação * * Para capturar uma falha utilize o `catch`, os campos disponíveis no objeto serão `code`, `error` e `error_description`. * * @param { { id: number } } params * @param { { description: string }} body * * @returns {Promise<{ * code: number, * }>} */ createChargeHistory(params: { id: number; }, body: { description: string; }): Promise<{ code: number; }>; /** * **POST /v1/charge/:id/balance-sheet** * * Define que a transação será do tipo boleto balancete. * * Para capturar uma falha utilize o `catch`, os campos disponíveis no objeto serão `code`, `error` e `error_description`. * * @param { { id: number } } params * @param { { * title: string, * body: Array<{ * header: string, * tables: Array<{ * rows: Array<Array<{ * align: string, * color: string, * style: string, * text: string, * colspan: number * }>> * }> * }> * } } body * * @returns {Promise<{ * code: number, * }>} */ defineBalanceSheetBillet(params: { id: number; }, body: { title: string; body: Array<{ header: string; tables: Array<{ rows: Array<Array<{ align: string; color: string; style: string; text: string; colspan: number; }>>; }>; }>; }): Promise<{ code: number; }>; /** * **PUT /v1/charge/:id/settle** * * Marcar como pago (baixa manual) uma determinada transação * * Para capturar uma falha utilize o `catch`, os campos disponíveis no objeto serão `code`, `error` e `error_description`. * * @param { { id: number } } params * * @returns {Promise<{ * code: number, * }>} */ settleCharge(params: { id: number; }): Promise<{ code: number; }>; /** * **POST /v1/charge/:id/retry** * * Retentativa de pagamento via cartão de crédito * * Para capturar uma falha utilize o `catch`, os campos disponíveis no objeto serão `code`, `error` e `error_description`. * * Obs: Para Pessoa Jurídica não serão obrigatórios o nome e CPF, apenas os demais dados do cliente contidos em juridical_person * * @param { { id: number } } params * @param { { * payment: { * credit_card: { * customer: { * name?: string, * cpf?: string, * email: string, * birth: string, * phone_number?: string, * juridical_person?: { * corporate_name: string, * cnpj: string * } * }, * billing_address: { * street: string, * number: string, * neighborhood: string, * zipcode: string, * city: string, * complement: string, * state: string * }, * payment_token: string * } * } * } } body * * @returns {Promise<{ * code: number, * data: { * installments: number, * installment_value: number, * charge_id: number, * status: string, * total: number, * payment: string * } * }>} */ cardPaymentRetry(params: { id: number; }, body: { payment: { credit_card: { customer: { name?: string; cpf?: string; email: string; birth: string; phone_number?: string; juridical_person?: { corporate_name: string; cnpj: string; }; }; billing_address: { street: string; number: string; neighborhood: string; zipcode: string; city: string; complement: string; state: string; }; payment_token: string; }; }; }): Promise<{ code: number; data: { installments: number; installment_value: number; charge_id: number; status: string; total: number; payment: string; }; }>; /** * **POST /v1/charge/card/:id/refund** * * Estorno de pagamento via cartão de crédito * * Para capturar uma falha utilize o `catch`, os campos disponíveis no objeto serão `code`, `error` e `error_description`. * * @param { { id: number } } params * @param { { amount?: number } } body * * @returns {Promise<{ * code: number, * message: string, * }>} */ refundCard(params: { id: number; }, body: { amount?: number; }): Promise<{ code: number; message: string; }>; /** * **GET /v1/installments** * * Listar parcelas de acordo com a bandeira do cartão * * Para capturar uma falha utilize o `catch`, os campos disponíveis no objeto serão `code`, `error` e `error_description`. * * @param { { * total: number, * brand: 'visa' | 'mastercard' | 'amex' | 'elo' | 'hipercard' * } } params * * @returns {Promise<{ * code: number, * data: { * rate: number, * name: string, * installments: Array<{ * installment: number, * has_interest: boolean, * value: number, * currency: string, * interest_percentage: number * }> * } * }>} */ getInstallments(params: { total: number; brand: 'visa' | 'mastercard' | 'amex' | 'elo' | 'hipercard'; }): Promise<{ code: number; data: { rate: number; name: string; installments: Array<{ installment: number; has_interest: boolean; value: number; currency: string; interest_percentage: number; }>; }; }>; /** * **POST /v1/carnet** * * Cria um novo carnê. * * Para capturar uma falha utilize o `catch`, os campos disponíveis no objeto serão `code`, `error` e `error_description`. * * Obs: Para Pessoa Jurídica não serão obrigatórios o nome e CPF, apenas os demais dados do cliente contidos em juridical_person * * @param { {} } params * @param { { * items: Array<{ * name: string, * value: number, * amount: number * }>, * customer: { * name?: string, * cpf?: string, * email?: string, * phone_number?: string, * birth?: string, * address?: { * street: string, * number: string, * neighborhood: string, * zipcode: string, * city: string, * complement?: string, * state: string * }, * juridical_person?: { * corporate_name: string, * cnpj: string * } * }, * expire_at: string, * repeats: number, * split_items?: boolean, * metadata?: { * custom_id?: string, * notification_url?: string * }, * configurations?: { * fine?: number, * interest?: { * value: number, * type: 'monthly' | 'daily' * } | number * }, * message?: string, * discount?: { * type: 'percentage' | 'currency', * value: number * }, * conditional_discount?: { * type: 'percentage' | 'currency', * value: number, * until_date: string * } * } } body * * @returns {Promise<{ * code: number, * data: { * carnet_id: number, * status: string, * cover: string, * link: string, * carnet_link: string, * pdf: { * carnet: string, * cover: string * }, * charges: Array<{ * charge_id: number, * parcel: string, * status: string, * value: number, * expire_at: string, * url: string, * parcel_link: string, * pdf: { * charge: string * }, * barcode: string, * pix?: { * qrcode: string, * qrcode_image: string * } * }> * } * }>} */ createCarnet(params: {}, body: { items: Array<{ name: string; value: number; amount: number; }>; customer: { name?: string; cpf?: string; email?: string; phone_number?: string; birth?: string; address?: { street: string; number: string; neighborhood: string; zipcode: string; city: string; complement?: string; state: string; }; juridical_person?: { corporate_name: string; cnpj: string; }; }; expire_at: string; repeats: number; split_items?: boolean; metadata?: { custom_id?: string; notification_url?: string; }; configurations?: { fine?: number; interest?: { value: number; type: 'monthly' | 'daily'; } | number; }; message?: string; discount?: { type: 'percentage' | 'currency'; value: number; }; conditional_discount?: { type: 'percentage' | 'currency'; value: number; until_date: string; }; }): Promise<{ code: number; data: { carnet_id: number; status: string; cover: string; link: string; carnet_link: string; pdf: { carnet: string; cover: string; }; charges: Array<{ charge_id: number; parcel: string; status: string; value: number; expire_at: string; url: string; parcel_link: string; pdf: { charge: string; }; barcode: string; pix?: { qrcode: string; qrcode_image: string; }; }>; }; }>; /** * **GET /v1/carnet/:id** * * Obtém os detalhes de um carnê específico. * * Para capturar uma falha utilize o `catch`, os campos disponíveis no objeto serão `code`, `error` e `error_description`. * * @param { { id: number } } params * * @returns {Promise<{ * code: number, * data: { * carnet_id: number, * status: string, * repeats: number, * cover: string, * link: string, * pdf: { * carnet: string, * cover: string * }, * value: number, * custom_id: string | null, * notification_url: string | null, * split_items: boolean, * charges: Array<{ * charge_id: number, * status: string, * url: string, * pdf: { * charge: string * }, * barcode: string, * pix: { * qrcode: string, * qrcode_image: string * }, * parcel: number, * expire_at: string, * configurations?: { * days_to_write_off?: number, * interest_type?: 'monthly' | 'daily', * interest?: number, * fine?: number * } * }>, * created_at: string, * history: Array<{ * message: string, * created_at: string * }> * } * }>} */ detailCarnet(params: { id: number; }): Promise<{ code: number; data: { carnet_id: number; status: string; repeats: number; cover: string; link: string; pdf: { carnet: string; cover: string; }; value: number; custom_id: string | null; notification_url: string | null; split_items: boolean; charges: Array<{ charge_id: number; status: string; url: string; pdf: { charge: string; }; barcode: string; pix: { qrcode: string; qrcode_image: string; }; parcel: number; expire_at: string; configurations?: { days_to_write_off?: number; interest_type?: 'monthly' | 'daily'; interest?: number; fine?: number; }; }>; created_at: string; history: Array<{ message: string; created_at: string; }>; }; }>; /** * **PUT /v1/carnet/:id/metadata** * * Incluir "notification_url" e "custom_id" em um carnê existente * * - O atributo `resend` diz se será realizado o reenvio da notificação após a alteração ser aplicada. * * Para capturar uma falha utilize o `catch`, os campos disponíveis no objeto serão `code`, `error` e `error_description`. * * @param { { id: number } } params * @param { { * notification_url?: string, * custom_id?: string, * resend?: boolean * } } body * * @returns {Promise<{ * code: number, * }>} */ updateCarnetMetadata(params: { id: number; }, body: { notification_url?: string; custom_id?: string; resend?: boolean; }): Promise<{ code: number; }>; /** * **PUT /v1/carnet/:id/parcel/:parcel** * * Alterar vencimento de parcela específica do carnê * * Para capturar uma falha utilize o `catch`, os campos disponíveis no objeto serão `code`, `error` e `error_description`. * * @param { { * id: number, * parcel: number, * } } params * @param {{ * expire_at: string * }} body * * @returns {Promise<{ * code: number, * }>} */ updateCarnetParcel(params: { id: number; parcel: number; }, body: { expire_at: string; }): Promise<{ code: number; }>; /** * **PUT /v1/carnet/:id/parcels** * * Alterar vencimento de parcelas de um carnê * * Para capturar uma falha utilize o `catch`, os campos disponíveis no objeto serão `code`, `error` e `error_description`. * * @param { { id: number } } params * @param {{ * expire_at: string * }} body * * @returns {Promise<{ * code: number, * }>} */ updateCarnetParcels(params: { id: number; }, body: { expire_at: string; }): Promise<{ code: number; }>; /** * **PUT /v1/carnet/:id/cancel** * * Cancelar um carnê * * Para capturar uma falha utilize o `catch`, os campos disponíveis no objeto serão `code`, `error` e `error_description`. * * @param { { id: number } } params * * @returns {Promise<{ * code: number, * }>} */ cancelCarnet(params: { id: number; }): Promise<{ code: number; }>; /** * **PUT /v1/carnet/:id/parcel/:parcel/cancel** * * Cancelar parcela específica de carnê * * Para capturar uma falha utilize o `catch`, os campos disponíveis no objeto serão `code`, `error` e `error_description`. * * @param { { * id: number, * parcel: number * } } params * * @returns {Promise<{ * code: number, * }>} */ cancelCarnetParcel(params: { id: number; parcel: number; }): Promise<{ code: number; }>; /** * **POST /v1/carnet/:id/resend** * * Reenvio do carnê para o email desejado * * Para capturar uma falha utilize o `catch`, os campos disponíveis no objeto serão `code`, `error` e `error_description`. * * @param { { id: number } } params * @param { { email: string } } body * * @returns {Promise<{ * code: number, * }>} */ sendCarnetEmail(params: { id: number; }, body: { email: string; }): Promise<{ code: number; }>; /** * **POST /v1/carnet/:id/parcel/:parcel/resend** * * Reenvio de uma parcela específica de carnê por e-mail * * Para capturar uma