@apihawk/billia-sdk
Version:
The ApiHawk Billia SDK
121 lines • 3.5 kB
TypeScript
import { IPaymentMethod } from '../types';
import { ICatalogProduct, ICurrencyInformation, IPrice, ITranslations } from './billia-sdk.types';
import { ICustomerProductDiscount } from './billia-sdk-customer-product.types';
export declare type IOrderPaymentStatus = 'yes' | 'no' | 'partially' | 'unknown';
export declare type IOrderType = 'new' | 'renew' | 'transfer' | 'edit' | 'mixed' | 'unknown' | 'cancel' | 'fund' | 'upgrade' | 'fee';
export declare type IOrderLineStatus = 'pending' | 'processing' | 'canceled' | 'activated';
export declare type IOrderStatus = IOrderLineStatus | 'mixed' | 'unknown';
export interface IOrdersListFetchOptions {
paymentMethods?: boolean;
}
export interface IOrderDetailsResponse {
purchase_id: number;
trash: number;
purchase_token: string;
date: string;
user_id: number;
reseller: string;
customer_profile_id: number;
payment_method_id: number;
_language: ITranslations;
order: IOrderLineItem[];
total_amount: IOrderTotalAmount;
_populated: boolean;
}
export interface IOrderDetails extends IOrderDetailsResponse {
paid: IOrderPaymentStatus;
type: IOrderType;
status: IOrderStatus;
metadata?: string;
discounts?: ICustomerProductDiscount[];
discount_code?: string;
overview?: string;
currency?: string;
payment_method?: IPaymentMethod;
notes: IOrderNote[];
}
export interface IOrderTotalAmount {
total: number;
tax?: {
amount: number;
percent: number;
};
_currency: ICurrencyInformation;
}
export interface IOrderLineItemSimple {
order_id: number;
parent_id: string;
trash: number;
descriptor: string;
user_id: number;
reseller: string;
customer_profile_id: number;
purchase_id: number;
product_id: number;
module: string;
parent_product_id: string;
product_type: string;
quantity: number;
quantity_type: string;
customer_product_id: string;
date: string;
amount: number;
tax_percentage: number;
discount_code: string;
status: IOrderLineStatus;
amount_paid: string;
paid: boolean;
date_paid: string;
metadata: string;
order_type: string;
affiliate_id: string;
}
export interface IOrderLineItem extends IOrderLineItemSimple {
price: IPrice;
_language: ITranslations;
product: ICatalogProduct | [];
discounts?: ICustomerProductDiscount[];
}
export interface IOrderLineItemDetailed extends IOrderLineItem {
options?: IProductOptionWrapper[];
bundle_items?: ICatalogProduct[];
}
export interface IOrderNote {
note_id: number;
route: string;
identifier: number;
create_date: string;
update_date: string;
note: string;
visible_for_resource_owner: 1 | 0;
history_note_id: number;
user_id: number;
}
interface IProductOptionWrapper {
option: IProductOption;
value: string;
}
interface IProductOption {
option_id: number;
trash: number;
name: string;
namespace: string;
option_key: string;
default: string;
instruction: string;
required: number;
post_configuration: string;
provider: string;
option_type: string;
option_type_value: string;
product_identifier: number;
validator: string;
autopopulate: number;
calc_strategy_on_zero_price: string;
behavior: string;
price: IPrice;
visibility: string[];
_language: ITranslations;
}
export {};
//# sourceMappingURL=billia-sdk-orders.types.d.ts.map