import { GhnAbstract } from '../ghn.abstract'; import type { CalculateExpectedDeliveryTime, CalculateExpectedDeliveryTimeResponse, CancelOrder, PickShift, PickShiftResponse, PreviewOrder, PreviewOrderResponse, CreateOrder, CreateOrderResponse, OrderInfo, OrderInfoResponse } from './types'; /** * Đối tượng Order chứa các phương thức để tương tác với API Order * * Có thể sử dụng thông qua đối tượng `Ghn` hoặc khởi tạo trực tiếp từ đối tượng `Order` * * @en * Order instance contains methods to interact with Order API * * Can be used through `Ghn` instance or directly initialize from `Order` instance * * @example * ```ts * import { Order } from 'giaohangnhanh/order'; * * const ghnOrder = new Order({ * token: 'YOUR_GHN_TOKEN', // Change to your token * shopId: 123456, // Change to your shopId * host: 'https://dev-online-gateway.ghn.vn', * testMode: true, // Enable test mode to override host * }); * ``` * * */ export declare class Order extends GhnAbstract { /** * Tính thời gian dự kiến giao hàng * * @en Calculate the expected delivery time * * @param {CalculateExpectedDeliveryTime} payload * @returns {Promise} * @see https://api.ghn.vn/home/docs/detail?id=52 */ calculateExpectedDeliveryTime({ apiPath, ...payload }: CalculateExpectedDeliveryTime): Promise; /** * Lấy danh sách ca lấy hàng * * @en Get Pick shift in order * * @returns {Promise} * @see https://api.ghn.vn/home/docs/detail?id=114 */ pickShift({ apiPath, }: PickShift): Promise; /** * Xem trước thông tin đơn hàng * * @en Helps preview order information without creating an order * * @param {PreviewOrder} payload * @returns {Promise} * @see https://api.ghn.vn/home/docs/detail?id=81 */ previewOrder({ apiPath, ...payload }: PreviewOrder): Promise; /** * Tự động gửi thông tin đơn hàng như trọng lượng, địa chỉ, số điện thoại và nhiều hơn nữa đến hệ thống GHN. * GHN sẽ xử lý thông tin này và bắt đầu việc vận chuyển * * @en Automatic send order information such as weight, address, phone number and many more to GHN system. * GHN will process these information and start the shipment * * @param {CreateOrder} payload * @returns {Promise} * @see https://api.ghn.vn/home/docs/detail?id=81 */ createOrder({ apiPath, ...payload }: CreateOrder): Promise; /** * Lấy thông tin chi tiết đơn hàng * * @en Help you get all information of a order. You can know current status or the reason which make the shipment failed * * @param param0 * @returns * @see https://api.ghn.vn/home/docs/detail?id=66 */ orderInfo({ order_code, apiPath, }: OrderInfo): Promise; /** * Hủy đơn hàng * * @en Cancel order * * @param {string[]} orderCodes * @returns * @see https://api.ghn.vn/home/docs/detail?id=73 */ cancelOrder({ orderCodes, apiPath, }: CancelOrder): Promise; /** * Lấy url theo dõi đơn hàng * @en Get tracking url of an order * @param {string} orderCode Order code of order to get tracking url * @returns {Promise} Tracking url */ getTrackingUrl(orderCode: string): Promise; }