import TiktokNewEraService from './tiktok-new-era.service'; import { TiktokShopApp } from '../interfaces'; export default class TiktokOrderService extends TiktokNewEraService { private readonly TIKTOK_ORDER_PREFIX; constructor({ app }: { app: TiktokShopApp; }); buildRequestUrl(suffix: string, version?: string): string; /** * Get order detail * @param orderIds: Max length is 50 */ getOrderDetail(orderIds: string[]): Promise; getOrderList({ params, body }: { params: TiktokOrderListParams; body?: TiktokOrderListBody; }): Promise>; } /** * Interfaces definition */ export interface TiktokOrderDetailResponse { orders: TiktokOrderDetail[]; } export interface TiktokOrderListResponse { next_page_token: string | null; total_count: number; orders: TiktokOrderDetail[]; } export interface TiktokOrderDetail { id: string; cancellation_initiator: string; shipping_provider: string; shipping_provider_id: string; user_id: string; status: string; rts_time: number; payment: { currency: string; sub_total: string; shipping_fee: string; seller_discount: string; platform_discount: string; total_amount: string; original_total_product_price: string; original_shipping_fee: string; shipping_fee_seller_discount: string; shipping_fee_platform_discount: string; shipping_fee_cofunded_discount: string; tax: string; small_order_fee: string; shipping_fee_tax: string; product_tax: string; retail_delivery_fee: string; buyer_service_fee: string; handling_fee: string; shipping_insurance_fee: string; item_insurance_fee: string; }; recipient_address: { full_address: string; phone_number: string; name: string; first_name: string; last_name: string; first_name_local_script: string; last_name_local_script: string; region_code: string; postal_code: string; address_line2: string; address_line3: string; address_line4: string; district_info: { address_level_name: string; address_name: string; address_level: string; }[]; delivery_preferences: { drop_off_location: string; }; address_detail: string; address_line1: string; }; buyer_message: string; create_time: number; tracking_number: string; cancel_reason: string; rts_sla_time: number; paid_time: number; fulfillment_type: string; seller_note: string; tts_sla_time: number; cancel_order_sla_time: number; update_time: number; packages: { id: string; }[]; delivery_type: string; is_sample_order: boolean; warehouse_id: string; split_or_combine_tag: string; has_updated_recipient_address: boolean; cpf: string; delivery_option_id: string; delivery_sla_time: number; payment_method_name: string; shipping_due_time: number; line_items: { id: string; sku_id: string; combined_listing_skus: { sku_id: string; sku_count: number; product_id: string; seller_sku: string; }[]; product_id: string; product_name: string; sku_name: string; sku_image: string; original_price: string; sale_price: string; platform_discount: string; display_status: string; cancel_user: string; sku_type: string; seller_sku: string; shipping_provider_id: string; seller_discount: string; currency: string; package_id: string; rts_time: number; item_tax: { tax_type: string; tax_amount: string; tax_rate: string; }[]; package_status: string; shipping_provider_name: string; is_gift: boolean; cancel_reason: string; small_order_fee: string; retail_delivery_fee: string; tracking_number: string; buyer_service_fee: string; handling_duration_days: string; is_dangerous_good: boolean; }[]; shipping_type: string; buyer_email: string; delivery_time: number; need_upload_invoice: string; is_cod: boolean; request_cancel_time: number; delivery_option_required_delivery_time: number; delivery_option_name: string; is_buyer_request_cancel: boolean; delivery_due_time: number; collection_time: number; is_on_hold_order: boolean; cancel_time: number; is_replacement_order: boolean; replaced_order_id: string; collection_due_time: number; pick_up_cut_off_time: number; fast_dispatch_sla_time: number; commerce_platform: string; order_type: string; release_date: number; handling_duration: { days: string; type: string; }; auto_combine_group_id: string; cpf_name: string; is_exchange_order: boolean; exchange_source_order_id: string; } export interface TiktokOrderListParams { page_token?: string; page_size: number; sort_field?: 'create_time' | 'update_time'; sort_order?: 'ASC' | 'DESC'; } export interface TiktokOrderListBody { order_status?: string; create_time_ge?: number; create_time_lt?: number; update_time_ge?: number; update_time_lt?: number; shipping_type?: 'TIKTOK' | 'SELLER'; buyer_user_id?: string; is_buyer_request_cancel?: boolean; warehouse_ids?: string[]; }