chargebee-typescript
Version:
A library in typescript for integrating with Chargebee.
940 lines (939 loc) • 30.4 kB
TypeScript
import { ListResult } from '../list_result';
import { RequestWrapper } from "../request_wrapper";
import { Model } from "./model";
import { filter } from "../filter";
export declare class Customer extends Model {
id: string;
first_name?: string;
last_name?: string;
email?: string;
phone?: string;
company?: string;
vat_number?: string;
auto_collection: string;
offline_payment_method?: string;
net_term_days: number;
vat_number_validated_time?: number;
vat_number_status?: string;
allow_direct_debit: boolean;
is_location_valid?: boolean;
created_at: number;
created_from_ip?: string;
exemption_details?: any;
taxability?: string;
entity_code?: string;
exempt_number?: string;
resource_version?: number;
updated_at?: number;
locale?: string;
billing_date?: number;
billing_month?: number;
billing_date_mode?: string;
billing_day_of_week?: string;
billing_day_of_week_mode?: string;
pii_cleared?: string;
auto_close_invoices?: boolean;
channel?: string;
active_id?: string;
card_status?: string;
fraud_flag?: string;
primary_payment_source_id?: string;
backup_payment_source_id?: string;
billing_address?: BillingAddress;
referral_urls?: Array<ReferralUrl>;
contacts?: Array<Contact>;
payment_method?: PaymentMethod;
invoice_notes?: string;
business_entity_id?: string;
preferred_currency_code?: string;
promotional_credits: number;
unbilled_charges: number;
refundable_credits: number;
excess_payments: number;
balances?: Array<Balance>;
entity_identifiers?: Array<EntityIdentifier>;
tax_providers_fields?: Array<TaxProvidersField>;
is_einvoice_enabled?: boolean;
einvoicing_method?: string;
meta_data?: any;
deleted: boolean;
registered_for_gst?: boolean;
consolidated_invoicing?: boolean;
customer_type?: string;
business_customer_without_vat_number?: boolean;
client_profile_id?: string;
relationship?: Relationship;
use_default_hierarchy_settings?: boolean;
parent_account_access?: ParentAccountAccess;
child_account_access?: ChildAccountAccess;
vat_number_prefix?: string;
entity_identifier_scheme?: string;
entity_identifier_standard?: string;
static create(params?: _customer.create_params): RequestWrapper;
static list(params?: _customer.customer_list_params): RequestWrapper<ListResult>;
static retrieve(customer_id: string, params?: any): RequestWrapper;
static update(customer_id: string, params?: _customer.update_params): RequestWrapper;
static update_payment_method(customer_id: string, params?: _customer.update_payment_method_params): RequestWrapper;
static update_billing_info(customer_id: string, params?: _customer.update_billing_info_params): RequestWrapper;
static contacts_for_customer(customer_id: string, params?: any): RequestWrapper<ListResult>;
static assign_payment_role(customer_id: string, params?: _customer.assign_payment_role_params): RequestWrapper;
static add_contact(customer_id: string, params?: _customer.add_contact_params): RequestWrapper;
static update_contact(customer_id: string, params?: _customer.update_contact_params): RequestWrapper;
static delete_contact(customer_id: string, params?: _customer.delete_contact_params): RequestWrapper;
static add_promotional_credits(customer_id: string, params?: _customer.add_promotional_credits_params): RequestWrapper;
static deduct_promotional_credits(customer_id: string, params?: _customer.deduct_promotional_credits_params): RequestWrapper;
static set_promotional_credits(customer_id: string, params?: _customer.set_promotional_credits_params): RequestWrapper;
static record_excess_payment(customer_id: string, params?: _customer.record_excess_payment_params): RequestWrapper;
static collect_payment(customer_id: string, params?: _customer.collect_payment_params): RequestWrapper;
static delete(customer_id: string, params?: _customer.delete_params): RequestWrapper;
static move(params?: _customer.move_params): RequestWrapper;
static change_billing_date(customer_id: string, params?: _customer.change_billing_date_params): RequestWrapper;
static merge(params?: _customer.merge_params): RequestWrapper;
static clear_personal_data(customer_id: string, params?: any): RequestWrapper;
static relationships(customer_id: string, params?: _customer.relationships_params): RequestWrapper;
static delete_relationship(customer_id: string, params?: any): RequestWrapper;
static hierarchy(customer_id: string, params?: _customer.hierarchy_params): RequestWrapper;
static update_hierarchy_settings(customer_id: string, params?: _customer.update_hierarchy_settings_params): RequestWrapper;
}
export declare class BillingAddress extends Model {
first_name?: string;
last_name?: string;
email?: string;
company?: string;
phone?: string;
line1?: string;
line2?: string;
line3?: string;
city?: string;
state_code?: string;
state?: string;
country?: string;
zip?: string;
validation_status?: string;
}
export declare class ReferralUrl extends Model {
external_customer_id?: string;
referral_sharing_url: string;
created_at: number;
updated_at: number;
referral_campaign_id: string;
referral_account_id: string;
referral_external_campaign_id?: string;
referral_system: string;
}
export declare class Contact extends Model {
id: string;
first_name?: string;
last_name?: string;
email: string;
phone?: string;
label?: string;
enabled: boolean;
send_account_email: boolean;
send_billing_email: boolean;
}
export declare class PaymentMethod extends Model {
type: string;
gateway: string;
gateway_account_id?: string;
status: string;
reference_id: string;
}
export declare class Balance extends Model {
promotional_credits: number;
excess_payments: number;
refundable_credits: number;
unbilled_charges: number;
currency_code: string;
balance_currency_code: string;
}
export declare class EntityIdentifier extends Model {
id: string;
value?: string;
scheme: string;
standard?: string;
}
export declare class TaxProvidersField extends Model {
provider_name: string;
field_id: string;
field_value: string;
}
export declare class Relationship extends Model {
parent_id?: string;
payment_owner_id: string;
invoice_owner_id: string;
}
export declare class ParentAccountAccess extends Model {
portal_edit_child_subscriptions?: string;
portal_download_child_invoices?: string;
send_subscription_emails: boolean;
send_invoice_emails: boolean;
send_payment_emails: boolean;
}
export declare class ChildAccountAccess extends Model {
portal_edit_subscriptions?: string;
portal_download_invoices?: string;
send_subscription_emails: boolean;
send_invoice_emails: boolean;
send_payment_emails: boolean;
}
export declare namespace _customer {
interface create_params {
id?: string;
first_name?: string;
last_name?: string;
email?: string;
preferred_currency_code?: string;
phone?: string;
company?: string;
auto_collection?: string;
net_term_days?: number;
allow_direct_debit?: boolean;
vat_number?: string;
vat_number_prefix?: string;
entity_identifier_scheme?: string;
entity_identifier_standard?: string;
registered_for_gst?: boolean;
is_einvoice_enabled?: boolean;
einvoicing_method?: string;
taxability?: string;
exemption_details?: any;
customer_type?: string;
client_profile_id?: string;
taxjar_exemption_category?: string;
business_customer_without_vat_number?: boolean;
locale?: string;
entity_code?: string;
exempt_number?: string;
meta_data?: any;
offline_payment_method?: string;
auto_close_invoices?: boolean;
consolidated_invoicing?: boolean;
token_id?: string;
business_entity_id?: string;
/**
* @deprecated Please refer API docs to use other attributes
*/
created_from_ip?: string;
invoice_notes?: string;
card?: card_create_params;
bank_account?: bank_account_create_params;
payment_method?: payment_method_create_params;
payment_intent?: payment_intent_create_params;
billing_address?: billing_address_create_params;
entity_identifiers?: Array<entity_identifiers_create_params>;
tax_providers_fields?: Array<tax_providers_fields_create_params>;
}
interface customer_list_params {
limit?: number;
offset?: string;
relationship?: relationship_customer_list_params;
include_deleted?: boolean;
id?: filter._string;
first_name?: filter._string;
last_name?: filter._string;
email?: filter._string;
company?: filter._string;
phone?: filter._string;
auto_collection?: filter._enum;
taxability?: filter._enum;
created_at?: filter._timestamp;
updated_at?: filter._timestamp;
offline_payment_method?: filter._enum;
auto_close_invoices?: filter._boolean;
channel?: filter._enum;
business_entity_id?: filter._string;
"sort_by[asc]"?: string;
"sort_by[desc]"?: string;
}
interface update_params {
first_name?: string;
last_name?: string;
email?: string;
preferred_currency_code?: string;
phone?: string;
company?: string;
auto_collection?: string;
allow_direct_debit?: boolean;
net_term_days?: number;
taxability?: string;
exemption_details?: any;
customer_type?: string;
client_profile_id?: string;
taxjar_exemption_category?: string;
locale?: string;
entity_code?: string;
exempt_number?: string;
offline_payment_method?: string;
invoice_notes?: string;
auto_close_invoices?: boolean;
meta_data?: any;
fraud_flag?: string;
consolidated_invoicing?: boolean;
tax_providers_fields?: Array<tax_providers_fields_update_params>;
}
interface update_payment_method_params {
payment_method?: payment_method_update_payment_method_params;
}
interface update_billing_info_params {
vat_number?: string;
vat_number_prefix?: string;
entity_identifier_scheme?: string;
entity_identifier_standard?: string;
registered_for_gst?: boolean;
business_customer_without_vat_number?: boolean;
is_einvoice_enabled?: boolean;
einvoicing_method?: string;
billing_address?: billing_address_update_billing_info_params;
entity_identifiers?: Array<entity_identifiers_update_billing_info_params>;
tax_providers_fields?: Array<tax_providers_fields_update_billing_info_params>;
}
interface assign_payment_role_params {
payment_source_id: string;
role: string;
}
interface add_contact_params {
contact?: contact_add_contact_params;
}
interface update_contact_params {
contact?: contact_update_contact_params;
}
interface delete_contact_params {
contact?: contact_delete_contact_params;
}
interface add_promotional_credits_params {
amount: number;
currency_code?: string;
description: string;
credit_type?: string;
reference?: string;
}
interface deduct_promotional_credits_params {
amount: number;
currency_code?: string;
description: string;
credit_type?: string;
reference?: string;
}
interface set_promotional_credits_params {
amount: number;
currency_code?: string;
description: string;
credit_type?: string;
reference?: string;
}
interface record_excess_payment_params {
comment?: string;
transaction?: transaction_record_excess_payment_params;
}
interface collect_payment_params {
amount?: number;
payment_source_id?: string;
token_id?: string;
replace_primary_payment_source?: boolean;
retain_payment_source?: boolean;
payment_initiator?: string;
payment_method?: payment_method_collect_payment_params;
card?: card_collect_payment_params;
payment_intent?: payment_intent_collect_payment_params;
invoice_allocations?: Array<invoice_allocations_collect_payment_params>;
}
interface delete_params {
delete_payment_method?: boolean;
}
interface move_params {
id_at_from_site: string;
from_site: string;
}
interface change_billing_date_params {
billing_date?: number;
billing_month?: number;
billing_date_mode?: string;
billing_day_of_week?: string;
billing_day_of_week_mode?: string;
}
interface merge_params {
from_customer_id: string;
to_customer_id: string;
}
interface relationships_params {
parent_id?: string;
payment_owner_id?: string;
invoice_owner_id?: string;
use_default_hierarchy_settings?: boolean;
parent_account_access?: parent_account_access_relationships_params;
child_account_access?: child_account_access_relationships_params;
}
interface hierarchy_params {
hierarchy_operation_type: string;
}
interface update_hierarchy_settings_params {
use_default_hierarchy_settings?: boolean;
parent_account_access?: parent_account_access_update_hierarchy_settings_params;
child_account_access?: child_account_access_update_hierarchy_settings_params;
}
interface card_create_params {
/**
* @deprecated Please refer API docs to use other attributes
*/
gateway?: string;
}
interface card_create_params {
gateway_account_id?: string;
}
interface card_create_params {
/**
* @deprecated Please refer API docs to use other attributes
*/
tmp_token?: string;
}
interface card_create_params {
first_name?: string;
}
interface card_create_params {
last_name?: string;
}
interface card_create_params {
number?: string;
}
interface card_create_params {
expiry_month?: number;
}
interface card_create_params {
expiry_year?: number;
}
interface card_create_params {
cvv?: string;
}
interface card_create_params {
preferred_scheme?: string;
}
interface card_create_params {
billing_addr1?: string;
}
interface card_create_params {
billing_addr2?: string;
}
interface card_create_params {
billing_city?: string;
}
interface card_create_params {
billing_state_code?: string;
}
interface card_create_params {
billing_state?: string;
}
interface card_create_params {
billing_zip?: string;
}
interface card_create_params {
billing_country?: string;
}
interface card_create_params {
/**
* @deprecated Please refer API docs to use other attributes
*/
ip_address?: string;
}
interface card_create_params {
additional_information?: any;
}
interface bank_account_create_params {
gateway_account_id?: string;
}
interface bank_account_create_params {
iban?: string;
}
interface bank_account_create_params {
first_name?: string;
}
interface bank_account_create_params {
last_name?: string;
}
interface bank_account_create_params {
company?: string;
}
interface bank_account_create_params {
email?: string;
}
interface bank_account_create_params {
phone?: string;
}
interface bank_account_create_params {
bank_name?: string;
}
interface bank_account_create_params {
account_number?: string;
}
interface bank_account_create_params {
routing_number?: string;
}
interface bank_account_create_params {
bank_code?: string;
}
interface bank_account_create_params {
account_type?: string;
}
interface bank_account_create_params {
account_holder_type?: string;
}
interface bank_account_create_params {
echeck_type?: string;
}
interface bank_account_create_params {
issuing_country?: string;
}
interface bank_account_create_params {
swedish_identity_number?: string;
}
interface bank_account_create_params {
billing_address?: any;
}
interface payment_method_create_params {
type?: string;
}
interface payment_method_create_params {
/**
* @deprecated Please refer API docs to use other attributes
*/
gateway?: string;
}
interface payment_method_create_params {
gateway_account_id?: string;
}
interface payment_method_create_params {
reference_id?: string;
}
interface payment_method_create_params {
tmp_token?: string;
}
interface payment_method_create_params {
issuing_country?: string;
}
interface payment_method_create_params {
additional_information?: any;
}
interface payment_intent_create_params {
id?: string;
}
interface payment_intent_create_params {
gateway_account_id?: string;
}
interface payment_intent_create_params {
gw_token?: string;
}
interface payment_intent_create_params {
payment_method_type?: string;
}
interface payment_intent_create_params {
reference_id?: string;
}
interface payment_intent_create_params {
/**
* @deprecated Please refer API docs to use other attributes
*/
gw_payment_method_id?: string;
}
interface payment_intent_create_params {
additional_information?: any;
}
interface billing_address_create_params {
first_name?: string;
}
interface billing_address_create_params {
last_name?: string;
}
interface billing_address_create_params {
email?: string;
}
interface billing_address_create_params {
company?: string;
}
interface billing_address_create_params {
phone?: string;
}
interface billing_address_create_params {
line1?: string;
}
interface billing_address_create_params {
line2?: string;
}
interface billing_address_create_params {
line3?: string;
}
interface billing_address_create_params {
city?: string;
}
interface billing_address_create_params {
state_code?: string;
}
interface billing_address_create_params {
state?: string;
}
interface billing_address_create_params {
zip?: string;
}
interface billing_address_create_params {
country?: string;
}
interface billing_address_create_params {
validation_status?: string;
}
interface entity_identifiers_create_params {
id?: string;
}
interface entity_identifiers_create_params {
scheme?: string;
}
interface entity_identifiers_create_params {
value?: string;
}
interface entity_identifiers_create_params {
standard?: string;
}
interface tax_providers_fields_create_params {
provider_name?: string;
}
interface tax_providers_fields_create_params {
field_id?: string;
}
interface tax_providers_fields_create_params {
field_value?: string;
}
interface relationship_customer_list_params {
parent_id?: filter._string;
}
interface relationship_customer_list_params {
payment_owner_id?: filter._string;
}
interface relationship_customer_list_params {
invoice_owner_id?: filter._string;
}
interface tax_providers_fields_update_params {
provider_name?: string;
}
interface tax_providers_fields_update_params {
field_id?: string;
}
interface tax_providers_fields_update_params {
field_value?: string;
}
interface payment_method_update_payment_method_params {
type: string;
}
interface payment_method_update_payment_method_params {
/**
* @deprecated Please refer API docs to use other attributes
*/
gateway?: string;
}
interface payment_method_update_payment_method_params {
gateway_account_id?: string;
}
interface payment_method_update_payment_method_params {
reference_id?: string;
}
interface payment_method_update_payment_method_params {
tmp_token?: string;
}
interface payment_method_update_payment_method_params {
issuing_country?: string;
}
interface payment_method_update_payment_method_params {
additional_information?: any;
}
interface billing_address_update_billing_info_params {
first_name?: string;
}
interface billing_address_update_billing_info_params {
last_name?: string;
}
interface billing_address_update_billing_info_params {
email?: string;
}
interface billing_address_update_billing_info_params {
company?: string;
}
interface billing_address_update_billing_info_params {
phone?: string;
}
interface billing_address_update_billing_info_params {
line1?: string;
}
interface billing_address_update_billing_info_params {
line2?: string;
}
interface billing_address_update_billing_info_params {
line3?: string;
}
interface billing_address_update_billing_info_params {
city?: string;
}
interface billing_address_update_billing_info_params {
state_code?: string;
}
interface billing_address_update_billing_info_params {
state?: string;
}
interface billing_address_update_billing_info_params {
zip?: string;
}
interface billing_address_update_billing_info_params {
country?: string;
}
interface billing_address_update_billing_info_params {
validation_status?: string;
}
interface entity_identifiers_update_billing_info_params {
id?: string;
}
interface entity_identifiers_update_billing_info_params {
scheme?: string;
}
interface entity_identifiers_update_billing_info_params {
value?: string;
}
interface entity_identifiers_update_billing_info_params {
operation?: string;
}
interface entity_identifiers_update_billing_info_params {
standard?: string;
}
interface tax_providers_fields_update_billing_info_params {
provider_name?: string;
}
interface tax_providers_fields_update_billing_info_params {
field_id?: string;
}
interface tax_providers_fields_update_billing_info_params {
field_value?: string;
}
interface contact_add_contact_params {
id?: string;
}
interface contact_add_contact_params {
first_name?: string;
}
interface contact_add_contact_params {
last_name?: string;
}
interface contact_add_contact_params {
email: string;
}
interface contact_add_contact_params {
phone?: string;
}
interface contact_add_contact_params {
label?: string;
}
interface contact_add_contact_params {
enabled?: boolean;
}
interface contact_add_contact_params {
send_billing_email?: boolean;
}
interface contact_add_contact_params {
send_account_email?: boolean;
}
interface contact_update_contact_params {
id: string;
}
interface contact_update_contact_params {
first_name?: string;
}
interface contact_update_contact_params {
last_name?: string;
}
interface contact_update_contact_params {
email?: string;
}
interface contact_update_contact_params {
phone?: string;
}
interface contact_update_contact_params {
label?: string;
}
interface contact_update_contact_params {
enabled?: boolean;
}
interface contact_update_contact_params {
send_billing_email?: boolean;
}
interface contact_update_contact_params {
send_account_email?: boolean;
}
interface contact_delete_contact_params {
id: string;
}
interface transaction_record_excess_payment_params {
amount: number;
}
interface transaction_record_excess_payment_params {
currency_code?: string;
}
interface transaction_record_excess_payment_params {
date: number;
}
interface transaction_record_excess_payment_params {
payment_method: string;
}
interface transaction_record_excess_payment_params {
reference_number?: string;
}
interface transaction_record_excess_payment_params {
custom_payment_method_id?: string;
}
interface payment_method_collect_payment_params {
type?: string;
}
interface payment_method_collect_payment_params {
gateway_account_id?: string;
}
interface payment_method_collect_payment_params {
reference_id?: string;
}
interface payment_method_collect_payment_params {
tmp_token?: string;
}
interface payment_method_collect_payment_params {
additional_information?: any;
}
interface card_collect_payment_params {
gateway_account_id?: string;
}
interface card_collect_payment_params {
first_name?: string;
}
interface card_collect_payment_params {
last_name?: string;
}
interface card_collect_payment_params {
number?: string;
}
interface card_collect_payment_params {
expiry_month?: number;
}
interface card_collect_payment_params {
expiry_year?: number;
}
interface card_collect_payment_params {
cvv?: string;
}
interface card_collect_payment_params {
preferred_scheme?: string;
}
interface card_collect_payment_params {
billing_addr1?: string;
}
interface card_collect_payment_params {
billing_addr2?: string;
}
interface card_collect_payment_params {
billing_city?: string;
}
interface card_collect_payment_params {
billing_state_code?: string;
}
interface card_collect_payment_params {
billing_state?: string;
}
interface card_collect_payment_params {
billing_zip?: string;
}
interface card_collect_payment_params {
billing_country?: string;
}
interface card_collect_payment_params {
additional_information?: any;
}
interface payment_intent_collect_payment_params {
id?: string;
}
interface payment_intent_collect_payment_params {
gateway_account_id?: string;
}
interface payment_intent_collect_payment_params {
gw_token?: string;
}
interface payment_intent_collect_payment_params {
payment_method_type?: string;
}
interface payment_intent_collect_payment_params {
/**
* @deprecated Please refer API docs to use other attributes
*/
gw_payment_method_id?: string;
}
interface payment_intent_collect_payment_params {
reference_id?: string;
}
interface payment_intent_collect_payment_params {
additional_information?: any;
}
interface invoice_allocations_collect_payment_params {
invoice_id: string;
}
interface invoice_allocations_collect_payment_params {
allocation_amount?: number;
}
interface parent_account_access_relationships_params {
portal_edit_child_subscriptions?: string;
}
interface parent_account_access_relationships_params {
portal_download_child_invoices?: string;
}
interface parent_account_access_relationships_params {
send_subscription_emails?: boolean;
}
interface parent_account_access_relationships_params {
send_payment_emails?: boolean;
}
interface parent_account_access_relationships_params {
send_invoice_emails?: boolean;
}
interface child_account_access_relationships_params {
portal_edit_subscriptions?: string;
}
interface child_account_access_relationships_params {
portal_download_invoices?: string;
}
interface child_account_access_relationships_params {
send_subscription_emails?: boolean;
}
interface child_account_access_relationships_params {
send_payment_emails?: boolean;
}
interface child_account_access_relationships_params {
send_invoice_emails?: boolean;
}
interface parent_account_access_update_hierarchy_settings_params {
portal_edit_child_subscriptions?: string;
}
interface parent_account_access_update_hierarchy_settings_params {
portal_download_child_invoices?: string;
}
interface parent_account_access_update_hierarchy_settings_params {
send_subscription_emails?: boolean;
}
interface parent_account_access_update_hierarchy_settings_params {
send_payment_emails?: boolean;
}
interface parent_account_access_update_hierarchy_settings_params {
send_invoice_emails?: boolean;
}
interface child_account_access_update_hierarchy_settings_params {
portal_edit_subscriptions?: string;
}
interface child_account_access_update_hierarchy_settings_params {
portal_download_invoices?: string;
}
interface child_account_access_update_hierarchy_settings_params {
send_subscription_emails?: boolean;
}
interface child_account_access_update_hierarchy_settings_params {
send_payment_emails?: boolean;
}
interface child_account_access_update_hierarchy_settings_params {
send_invoice_emails?: boolean;
}
}