UNPKG

chargebee-typescript

Version:

A library in typescript for integrating with Chargebee.

575 lines (574 loc) 22 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.LineItemAddress = exports.TaxOrigin = exports.SiteDetailsAtCreation = exports.Einvoice = exports.BillingAddress = exports.StatementDescriptor = exports.ShippingAddress = exports.Note = exports.LinkedOrder = exports.IssuedCreditNote = exports.AdjustmentCreditNote = exports.AppliedCredit = exports.DunningAttempt = exports.LinkedPayment = exports.LineItemTier = exports.LineItemCredit = exports.LineItemTax = exports.Tax = exports.LineItemDiscount = exports.Discount = exports.LineItem = exports.Invoice = void 0; const request_wrapper_1 = require("../request_wrapper"); const model_1 = require("./model"); const chargebee_1 = require("../chargebee"); class Invoice extends model_1.Model { // OPERATIONS //----------- static create(params) { return new request_wrapper_1.RequestWrapper([params], { 'methodName': 'create', 'httpMethod': 'POST', 'urlPrefix': '/invoices', 'urlSuffix': null, 'hasIdInUrl': false, 'isListReq': false, 'subDomain': null, 'isOperationNeedsJsonInput': false, 'jsonKeys': { "additional_information": 1, "billing_address": 1, } }, chargebee_1.ChargeBee._env); } static create_for_charge_items_and_charges(params) { return new request_wrapper_1.RequestWrapper([params], { 'methodName': 'create_for_charge_items_and_charges', 'httpMethod': 'POST', 'urlPrefix': '/invoices', 'urlSuffix': '/create_for_charge_items_and_charges', 'hasIdInUrl': false, 'isListReq': false, 'subDomain': null, 'isOperationNeedsJsonInput': false, 'jsonKeys': { "additional_information": 1, "billing_address": 1, } }, chargebee_1.ChargeBee._env); } static charge(params) { return new request_wrapper_1.RequestWrapper([params], { 'methodName': 'charge', 'httpMethod': 'POST', 'urlPrefix': '/invoices', 'urlSuffix': '/charge', 'hasIdInUrl': false, 'isListReq': false, 'subDomain': null, 'isOperationNeedsJsonInput': false, 'jsonKeys': {} }, chargebee_1.ChargeBee._env); } static charge_addon(params) { return new request_wrapper_1.RequestWrapper([params], { 'methodName': 'charge_addon', 'httpMethod': 'POST', 'urlPrefix': '/invoices', 'urlSuffix': '/charge_addon', 'hasIdInUrl': false, 'isListReq': false, 'subDomain': null, 'isOperationNeedsJsonInput': false, 'jsonKeys': {} }, chargebee_1.ChargeBee._env); } static create_for_charge_item(params) { return new request_wrapper_1.RequestWrapper([params], { 'methodName': 'create_for_charge_item', 'httpMethod': 'POST', 'urlPrefix': '/invoices', 'urlSuffix': '/create_for_charge_item', 'hasIdInUrl': false, 'isListReq': false, 'subDomain': null, 'isOperationNeedsJsonInput': false, 'jsonKeys': {} }, chargebee_1.ChargeBee._env); } static stop_dunning(invoice_id, params) { return new request_wrapper_1.RequestWrapper([invoice_id, params], { 'methodName': 'stop_dunning', 'httpMethod': 'POST', 'urlPrefix': '/invoices', 'urlSuffix': '/stop_dunning', 'hasIdInUrl': true, 'isListReq': false, 'subDomain': null, 'isOperationNeedsJsonInput': false, 'jsonKeys': {} }, chargebee_1.ChargeBee._env); } static import_invoice(params) { return new request_wrapper_1.RequestWrapper([params], { 'methodName': 'import_invoice', 'httpMethod': 'POST', 'urlPrefix': '/invoices', 'urlSuffix': '/import_invoice', 'hasIdInUrl': false, 'isListReq': false, 'subDomain': null, 'isOperationNeedsJsonInput': false, 'jsonKeys': {} }, chargebee_1.ChargeBee._env); } static apply_payments(invoice_id, params) { return new request_wrapper_1.RequestWrapper([invoice_id, params], { 'methodName': 'apply_payments', 'httpMethod': 'POST', 'urlPrefix': '/invoices', 'urlSuffix': '/apply_payments', 'hasIdInUrl': true, 'isListReq': false, 'subDomain': null, 'isOperationNeedsJsonInput': false, 'jsonKeys': {} }, chargebee_1.ChargeBee._env); } static sync_usages(invoice_id, params) { return new request_wrapper_1.RequestWrapper([invoice_id, params], { 'methodName': 'sync_usages', 'httpMethod': 'POST', 'urlPrefix': '/invoices', 'urlSuffix': '/sync_usages', 'hasIdInUrl': true, 'isListReq': false, 'subDomain': null, 'isOperationNeedsJsonInput': false, 'jsonKeys': {} }, chargebee_1.ChargeBee._env); } static delete_line_items(invoice_id, params) { return new request_wrapper_1.RequestWrapper([invoice_id, params], { 'methodName': 'delete_line_items', 'httpMethod': 'POST', 'urlPrefix': '/invoices', 'urlSuffix': '/delete_line_items', 'hasIdInUrl': true, 'isListReq': false, 'subDomain': null, 'isOperationNeedsJsonInput': false, 'jsonKeys': {} }, chargebee_1.ChargeBee._env); } static apply_credits(invoice_id, params) { return new request_wrapper_1.RequestWrapper([invoice_id, params], { 'methodName': 'apply_credits', 'httpMethod': 'POST', 'urlPrefix': '/invoices', 'urlSuffix': '/apply_credits', 'hasIdInUrl': true, 'isListReq': false, 'subDomain': null, 'isOperationNeedsJsonInput': false, 'jsonKeys': {} }, chargebee_1.ChargeBee._env); } static list(params) { return new request_wrapper_1.RequestWrapper([params], { 'methodName': 'list', 'httpMethod': 'GET', 'urlPrefix': '/invoices', 'urlSuffix': null, 'hasIdInUrl': false, 'isListReq': true, 'subDomain': null, 'isOperationNeedsJsonInput': false, 'jsonKeys': {} }, chargebee_1.ChargeBee._env); } static invoices_for_customer(customer_id, params) { return new request_wrapper_1.RequestWrapper([customer_id, params], { 'methodName': 'invoices_for_customer', 'httpMethod': 'GET', 'urlPrefix': '/customers', 'urlSuffix': '/invoices', 'hasIdInUrl': true, 'isListReq': true, 'subDomain': null, 'isOperationNeedsJsonInput': false, 'jsonKeys': {} }, chargebee_1.ChargeBee._env); } static invoices_for_subscription(subscription_id, params) { return new request_wrapper_1.RequestWrapper([subscription_id, params], { 'methodName': 'invoices_for_subscription', 'httpMethod': 'GET', 'urlPrefix': '/subscriptions', 'urlSuffix': '/invoices', 'hasIdInUrl': true, 'isListReq': true, 'subDomain': null, 'isOperationNeedsJsonInput': false, 'jsonKeys': {} }, chargebee_1.ChargeBee._env); } static retrieve(invoice_id, params) { return new request_wrapper_1.RequestWrapper([invoice_id, params], { 'methodName': 'retrieve', 'httpMethod': 'GET', 'urlPrefix': '/invoices', 'urlSuffix': null, 'hasIdInUrl': true, 'isListReq': false, 'subDomain': null, 'isOperationNeedsJsonInput': false, 'jsonKeys': {} }, chargebee_1.ChargeBee._env); } static pdf(invoice_id, params) { return new request_wrapper_1.RequestWrapper([invoice_id, params], { 'methodName': 'pdf', 'httpMethod': 'POST', 'urlPrefix': '/invoices', 'urlSuffix': '/pdf', 'hasIdInUrl': true, 'isListReq': false, 'subDomain': null, 'isOperationNeedsJsonInput': false, 'jsonKeys': {} }, chargebee_1.ChargeBee._env); } static download_einvoice(invoice_id, params) { return new request_wrapper_1.RequestWrapper([invoice_id, params], { 'methodName': 'download_einvoice', 'httpMethod': 'GET', 'urlPrefix': '/invoices', 'urlSuffix': '/download_einvoice', 'hasIdInUrl': true, 'isListReq': false, 'subDomain': null, 'isOperationNeedsJsonInput': false, 'jsonKeys': {} }, chargebee_1.ChargeBee._env); } static list_payment_reference_numbers(params) { return new request_wrapper_1.RequestWrapper([params], { 'methodName': 'list_payment_reference_numbers', 'httpMethod': 'GET', 'urlPrefix': '/invoices', 'urlSuffix': '/payment_reference_numbers', 'hasIdInUrl': false, 'isListReq': true, 'subDomain': null, 'isOperationNeedsJsonInput': false, 'jsonKeys': {} }, chargebee_1.ChargeBee._env); } static add_charge(invoice_id, params) { return new request_wrapper_1.RequestWrapper([invoice_id, params], { 'methodName': 'add_charge', 'httpMethod': 'POST', 'urlPrefix': '/invoices', 'urlSuffix': '/add_charge', 'hasIdInUrl': true, 'isListReq': false, 'subDomain': null, 'isOperationNeedsJsonInput': false, 'jsonKeys': {} }, chargebee_1.ChargeBee._env); } static add_addon_charge(invoice_id, params) { return new request_wrapper_1.RequestWrapper([invoice_id, params], { 'methodName': 'add_addon_charge', 'httpMethod': 'POST', 'urlPrefix': '/invoices', 'urlSuffix': '/add_addon_charge', 'hasIdInUrl': true, 'isListReq': false, 'subDomain': null, 'isOperationNeedsJsonInput': false, 'jsonKeys': {} }, chargebee_1.ChargeBee._env); } static add_charge_item(invoice_id, params) { return new request_wrapper_1.RequestWrapper([invoice_id, params], { 'methodName': 'add_charge_item', 'httpMethod': 'POST', 'urlPrefix': '/invoices', 'urlSuffix': '/add_charge_item', 'hasIdInUrl': true, 'isListReq': false, 'subDomain': null, 'isOperationNeedsJsonInput': false, 'jsonKeys': {} }, chargebee_1.ChargeBee._env); } static close(invoice_id, params) { return new request_wrapper_1.RequestWrapper([invoice_id, params], { 'methodName': 'close', 'httpMethod': 'POST', 'urlPrefix': '/invoices', 'urlSuffix': '/close', 'hasIdInUrl': true, 'isListReq': false, 'subDomain': null, 'isOperationNeedsJsonInput': false, 'jsonKeys': {} }, chargebee_1.ChargeBee._env); } static collect_payment(invoice_id, params) { return new request_wrapper_1.RequestWrapper([invoice_id, params], { 'methodName': 'collect_payment', 'httpMethod': 'POST', 'urlPrefix': '/invoices', 'urlSuffix': '/collect_payment', 'hasIdInUrl': true, 'isListReq': false, 'subDomain': null, 'isOperationNeedsJsonInput': false, 'jsonKeys': {} }, chargebee_1.ChargeBee._env); } static record_payment(invoice_id, params) { return new request_wrapper_1.RequestWrapper([invoice_id, params], { 'methodName': 'record_payment', 'httpMethod': 'POST', 'urlPrefix': '/invoices', 'urlSuffix': '/record_payment', 'hasIdInUrl': true, 'isListReq': false, 'subDomain': null, 'isOperationNeedsJsonInput': false, 'jsonKeys': {} }, chargebee_1.ChargeBee._env); } static record_tax_withheld(invoice_id, params) { return new request_wrapper_1.RequestWrapper([invoice_id, params], { 'methodName': 'record_tax_withheld', 'httpMethod': 'POST', 'urlPrefix': '/invoices', 'urlSuffix': '/record_tax_withheld', 'hasIdInUrl': true, 'isListReq': false, 'subDomain': null, 'isOperationNeedsJsonInput': false, 'jsonKeys': {} }, chargebee_1.ChargeBee._env); } static remove_tax_withheld(invoice_id, params) { return new request_wrapper_1.RequestWrapper([invoice_id, params], { 'methodName': 'remove_tax_withheld', 'httpMethod': 'POST', 'urlPrefix': '/invoices', 'urlSuffix': '/remove_tax_withheld', 'hasIdInUrl': true, 'isListReq': false, 'subDomain': null, 'isOperationNeedsJsonInput': false, 'jsonKeys': {} }, chargebee_1.ChargeBee._env); } static refund(invoice_id, params) { return new request_wrapper_1.RequestWrapper([invoice_id, params], { 'methodName': 'refund', 'httpMethod': 'POST', 'urlPrefix': '/invoices', 'urlSuffix': '/refund', 'hasIdInUrl': true, 'isListReq': false, 'subDomain': null, 'isOperationNeedsJsonInput': false, 'jsonKeys': {} }, chargebee_1.ChargeBee._env); } static record_refund(invoice_id, params) { return new request_wrapper_1.RequestWrapper([invoice_id, params], { 'methodName': 'record_refund', 'httpMethod': 'POST', 'urlPrefix': '/invoices', 'urlSuffix': '/record_refund', 'hasIdInUrl': true, 'isListReq': false, 'subDomain': null, 'isOperationNeedsJsonInput': false, 'jsonKeys': {} }, chargebee_1.ChargeBee._env); } static remove_payment(invoice_id, params) { return new request_wrapper_1.RequestWrapper([invoice_id, params], { 'methodName': 'remove_payment', 'httpMethod': 'POST', 'urlPrefix': '/invoices', 'urlSuffix': '/remove_payment', 'hasIdInUrl': true, 'isListReq': false, 'subDomain': null, 'isOperationNeedsJsonInput': false, 'jsonKeys': {} }, chargebee_1.ChargeBee._env); } static remove_credit_note(invoice_id, params) { return new request_wrapper_1.RequestWrapper([invoice_id, params], { 'methodName': 'remove_credit_note', 'httpMethod': 'POST', 'urlPrefix': '/invoices', 'urlSuffix': '/remove_credit_note', 'hasIdInUrl': true, 'isListReq': false, 'subDomain': null, 'isOperationNeedsJsonInput': false, 'jsonKeys': {} }, chargebee_1.ChargeBee._env); } static void_invoice(invoice_id, params) { return new request_wrapper_1.RequestWrapper([invoice_id, params], { 'methodName': 'void_invoice', 'httpMethod': 'POST', 'urlPrefix': '/invoices', 'urlSuffix': '/void', 'hasIdInUrl': true, 'isListReq': false, 'subDomain': null, 'isOperationNeedsJsonInput': false, 'jsonKeys': {} }, chargebee_1.ChargeBee._env); } static write_off(invoice_id, params) { return new request_wrapper_1.RequestWrapper([invoice_id, params], { 'methodName': 'write_off', 'httpMethod': 'POST', 'urlPrefix': '/invoices', 'urlSuffix': '/write_off', 'hasIdInUrl': true, 'isListReq': false, 'subDomain': null, 'isOperationNeedsJsonInput': false, 'jsonKeys': {} }, chargebee_1.ChargeBee._env); } static delete(invoice_id, params) { return new request_wrapper_1.RequestWrapper([invoice_id, params], { 'methodName': 'delete', 'httpMethod': 'POST', 'urlPrefix': '/invoices', 'urlSuffix': '/delete', 'hasIdInUrl': true, 'isListReq': false, 'subDomain': null, 'isOperationNeedsJsonInput': false, 'jsonKeys': {} }, chargebee_1.ChargeBee._env); } static update_details(invoice_id, params) { return new request_wrapper_1.RequestWrapper([invoice_id, params], { 'methodName': 'update_details', 'httpMethod': 'POST', 'urlPrefix': '/invoices', 'urlSuffix': '/update_details', 'hasIdInUrl': true, 'isListReq': false, 'subDomain': null, 'isOperationNeedsJsonInput': false, 'jsonKeys': {} }, chargebee_1.ChargeBee._env); } static apply_payment_schedule_scheme(invoice_id, params) { return new request_wrapper_1.RequestWrapper([invoice_id, params], { 'methodName': 'apply_payment_schedule_scheme', 'httpMethod': 'POST', 'urlPrefix': '/invoices', 'urlSuffix': '/apply_payment_schedule_scheme', 'hasIdInUrl': true, 'isListReq': false, 'subDomain': null, 'isOperationNeedsJsonInput': false, 'jsonKeys': {} }, chargebee_1.ChargeBee._env); } static payment_schedules(invoice_id, params) { return new request_wrapper_1.RequestWrapper([invoice_id, params], { 'methodName': 'payment_schedules', 'httpMethod': 'GET', 'urlPrefix': '/invoices', 'urlSuffix': '/payment_schedules', 'hasIdInUrl': true, 'isListReq': false, 'subDomain': null, 'isOperationNeedsJsonInput': false, 'jsonKeys': {} }, chargebee_1.ChargeBee._env); } static resend_einvoice(invoice_id, params) { return new request_wrapper_1.RequestWrapper([invoice_id, params], { 'methodName': 'resend_einvoice', 'httpMethod': 'POST', 'urlPrefix': '/invoices', 'urlSuffix': '/resend_einvoice', 'hasIdInUrl': true, 'isListReq': false, 'subDomain': null, 'isOperationNeedsJsonInput': false, 'jsonKeys': {} }, chargebee_1.ChargeBee._env); } static send_einvoice(invoice_id, params) { return new request_wrapper_1.RequestWrapper([invoice_id, params], { 'methodName': 'send_einvoice', 'httpMethod': 'POST', 'urlPrefix': '/invoices', 'urlSuffix': '/send_einvoice', 'hasIdInUrl': true, 'isListReq': false, 'subDomain': null, 'isOperationNeedsJsonInput': false, 'jsonKeys': {} }, chargebee_1.ChargeBee._env); } } // ~Invoice exports.Invoice = Invoice; class LineItem extends model_1.Model { } // ~LineItem exports.LineItem = LineItem; class Discount extends model_1.Model { } // ~Discount exports.Discount = Discount; class LineItemDiscount extends model_1.Model { } // ~LineItemDiscount exports.LineItemDiscount = LineItemDiscount; class Tax extends model_1.Model { } // ~Tax exports.Tax = Tax; class LineItemTax extends model_1.Model { } // ~LineItemTax exports.LineItemTax = LineItemTax; class LineItemCredit extends model_1.Model { } // ~LineItemCredit exports.LineItemCredit = LineItemCredit; class LineItemTier extends model_1.Model { } // ~LineItemTier exports.LineItemTier = LineItemTier; class LinkedPayment extends model_1.Model { } // ~LinkedPayment exports.LinkedPayment = LinkedPayment; class DunningAttempt extends model_1.Model { } // ~DunningAttempt exports.DunningAttempt = DunningAttempt; class AppliedCredit extends model_1.Model { } // ~AppliedCredit exports.AppliedCredit = AppliedCredit; class AdjustmentCreditNote extends model_1.Model { } // ~AdjustmentCreditNote exports.AdjustmentCreditNote = AdjustmentCreditNote; class IssuedCreditNote extends model_1.Model { } // ~IssuedCreditNote exports.IssuedCreditNote = IssuedCreditNote; class LinkedOrder extends model_1.Model { } // ~LinkedOrder exports.LinkedOrder = LinkedOrder; class Note extends model_1.Model { } // ~Note exports.Note = Note; class ShippingAddress extends model_1.Model { } // ~ShippingAddress exports.ShippingAddress = ShippingAddress; class StatementDescriptor extends model_1.Model { } // ~StatementDescriptor exports.StatementDescriptor = StatementDescriptor; class BillingAddress extends model_1.Model { } // ~BillingAddress exports.BillingAddress = BillingAddress; class Einvoice extends model_1.Model { } // ~Einvoice exports.Einvoice = Einvoice; class SiteDetailsAtCreation extends model_1.Model { } // ~SiteDetailsAtCreation exports.SiteDetailsAtCreation = SiteDetailsAtCreation; class TaxOrigin extends model_1.Model { } // ~TaxOrigin exports.TaxOrigin = TaxOrigin; class LineItemAddress extends model_1.Model { } // ~LineItemAddress exports.LineItemAddress = LineItemAddress;