UNPKG

pancake-client-sdk

Version:
56 lines (55 loc) 1.52 kB
import { ShippingPartner, ShippingFeeRequest, ShippingFeeResponse, ShipmentCreationRequest, Shipment, ShipmentListParams } from '../types/shipping'; import { BaseResource } from './base'; export declare class ShippingResource extends BaseResource { /** * Get list of shipping partners */ listPartners(): Promise<{ data: ShippingPartner[]; }>; /** * Calculate shipping fee */ calculateFee(data: ShippingFeeRequest): Promise<ShippingFeeResponse>; /** * Create new shipment */ createShipment(data: ShipmentCreationRequest): Promise<Shipment>; /** * Get shipment by ID */ getShipmentById(shipmentId: string): Promise<Shipment>; /** * List shipments */ listShipments(params?: ShipmentListParams): Promise<{ data: Shipment[]; }>; /** * Cancel shipment */ cancelShipment(shipmentId: string, reason?: string): Promise<Shipment>; /** * Print shipping label */ getShippingLabel(shipmentId: string): Promise<{ url: string; }>; /** * Get delivery tracking info */ getTrackingInfo(shipmentId: string): Promise<{ status: string; tracking_code: string; tracking_url?: string; status_history: { status: string; time: string; description?: string; }[]; }>; /** * Update shipment COD amount */ updateCOD(shipmentId: string, codAmount: number): Promise<Shipment>; }