import { TiktokShopApp } from '../interfaces'; import TiktokNewEraService from './tiktok-new-era.service'; export default class TiktokFinanceService extends TiktokNewEraService { private readonly TIKTOK_FINANCE_PREFIX; private readonly finance202605; constructor({ app }: { app: TiktokShopApp; }); buildRequestUrl(suffix: string, version?: string): string; getStatements({ params }: { params: TiktokStatementListParams; }): Promise; getPayments({ params }: { params: TiktokPaymentListParams; }): Promise; getStatementTransactions({ params, statementId }: { params: TiktokStatementTransactionsListParams; statementId: string; }): Promise; getStatementDetail({ statement }: { statement: Pick; }): Promise; } /** * Interfaces definition */ export interface TiktokFinanceStatementResponse { next_page_token: string | null; statements: TiktokFinanceStatement[]; } export interface TiktokFinancePaymentResponse { next_page_token: string | null; payments: TiktokFinancePayment[]; } export interface TiktokFinanceStatementTransactionsResponse { next_page_token: string | null; id: string; create_time: number; status: string; currency: string; payable_amount: string; total_reserve_amount: string; total_settlement_amount: string; total_count: string; transactions: TiktokFinanceStatementTransaction[]; } export interface TiktokFinanceStatementTransaction { id: string; type: string; order_id: string; order_create_time: number; adjustment_id: string; adjustment_order_id: string; adjustment_amount: string; settlement_amount: string; revenue_amount: string; revenue_breakdown: { subtotal_before_discount_amount: string; refund_subtotal_before_discount_amount: string; seller_discount_amount: string; seller_discount_refund_amount: string; cod_service_fee_amount: string; refund_cod_service_fee_amount: string; }; shipping_cost_amount: string; shipping_cost_breakdown: { actual_shipping_fee_amount: string; shipping_fee_discount_amount: string; customer_paid_shipping_fee_amount: string; return_shipping_fee_amount: string; replacement_shipping_fee_amount: string; exchange_shipping_fee_amount: string; signature_confirmation_fee_amount: string; shipping_insurance_fee_amount: string; }; supplementary_component: { platform_shipping_fee_discount_amount: string; promo_shipping_incentive_amount: string; shipping_fee_subsidy_amount: string; seller_shipping_fee_discount_amount: string; customer_shipping_fee_offset_amount: string; fbm_shipping_cost_amount: string; fbt_shipping_cost_amount: string; fbt_fulfillment_fee_amount: string; }; return_shipping_label_fee_amount: string; fee_tax_amount: string; fee_tax_breakdown: { fee: { platform_commission_amount: string; referral_fee_amount: string; refund_administration_fee_amount: string; transaction_fee_amount: string; credit_card_handling_fee_amount: string; affiliate_commission_amount: string; affiliate_commission_amount_before_pit: string; affiliate_partner_commission_amount: string; affiliate_ads_commission_amount: string; sfp_service_fee_amount: string; live_specials_fee_amount: string; bonus_cashback_service_fee_amount: string; mall_service_fee_amount: string; voucher_xtra_service_fee_amount: string; flash_sales_service_fee_amount: string; cofunded_promotion_service_fee_amount: string; pre_order_service_fee_amount: string; tsp_commission_amount: string; dt_handling_fee_amount: string; epr_pob_service_fee_amount: string; seller_paylater_handling_fee_amount: string; }; tax: { vat_amount: string; import_vat_amount: string; customs_duty_amount: string; customs_clearance_amount: string; sst_amount: string; gst_amount: string; iva_amount: string; isr_amount: string; anti_dumping_duty_amount: string; local_vat_amount: string; pit_amount: string; }; supplementary_component: { customer_payment_amount: string; customer_refund_amount: string; platform_discount_amount: string; platform_discount_refund_amount: string; seller_cofunded_discount_amount: string; seller_cofunded_discount_refund_amount: string; platform_cofunded_discount_amount: string; platform_cofunded_discount_refund_amount: string; retail_delivery_fee_amount: string; retail_delivery_fee_payment_amount: string; retail_delivery_fee_refund_amount: string; sales_tax_amount: string; sales_tax_payment_amount: string; sales_tax_refund_amount: string; }; reserve_id: string; reserve_amount: string; associated_order_id: string; reserve_status: string; estimated_release_time: number; }; } export interface TiktokFinancePayment { create_time: number; id: string; status: string; amount: { value: string; currency: string; }; settlement_amount: { value: string; currency: string; }; payment_amount_before_exchange: { value: string; currency: string; }; exchange_rate: string; paid_time: number; bank_account: string; } export interface TiktokFinanceStatement { id: string; statement_time: number; settlement_amount: string; currency: string; revenue_amount: string; fee_amount: string; adjustment_amount: string; payment_status: string; payment_id: string; net_sales_amount: string; shipping_cost_amount: string; } export interface TiktokStatementListParams { page_token?: string; page_size: number; sort_field: 'statement_time'; sort_order?: 'ASC' | 'DESC'; statement_time_ge?: number; statement_time_lt?: number; payment_status?: 'PAID' | 'FAILED' | 'PROCESSING'; } export interface TiktokPaymentListParams { page_token?: string; page_size: number; sort_field: 'create_time'; sort_order?: 'ASC' | 'DESC'; create_time_ge?: number; create_time_lt?: number; } export interface TiktokStatementTransactionsListParams { page_token?: string; page_size: number; sort_field: 'order_create_time'; sort_order?: 'ASC' | 'DESC'; }