shopee-client
Version:
Shoppe Open API Client
99 lines (98 loc) • 5.21 kB
TypeScript
import BaseModule from "../BaseModule";
import GetLogisticResponse from "./response/GetLogisticResponse";
import UpdateLogisticResponse from "./response/UpdateLogisticResponse";
import getParameterInitResponse from "./response/getParameterInitResponse";
import GetAddressResponse from "./response/GetAddressResponse";
import GetBranchResponse from "./response/GetBranchResponse";
import GetLogisticInfoResponse from "./response/GetLogisticInfoResponse";
import InitRequest from "./request/InitRequest";
import InitResponse from "./response/InitResponse";
import GetAirwayBillRequest from "./request/GetAirwayBillRequest";
import GetAirwayBillResponse from "./response/GetAirwayBillResponse";
import GetOrderLogisticResponse from "./response/GetOrderLogisticResponse";
import GetLogisticMessageRequest from "./request/GetLogisticMessageRequest";
import GetLogisticMessageResponse from "./response/GetLogisticMessageResponse";
import GetForderWaybillRequest from "./request/GetForderWaybillRequest";
import GetForderWaybillResponse from "./response/GetForderWaybillResponse";
import SetAddressResponse from "./response/SetAddressResponse";
import SetAddressRequest from "./request/SetAddressRequest";
export default class LogisticModule extends BaseModule {
/**
* Use this call to get all supported logistic channels.
*/
getLogistic(): Promise<GetLogisticResponse>;
/**
* For integrated logistics channel, use this call to get pickup address for pickup mode order.
*/
getAddress(): Promise<GetAddressResponse>;
/**
* For integrated logistics channel, use this call to get pickup timeslot for pickup mode order.
* @param ordersn The order serial numbers.
* @param address_id The identify of address.
*/
getTimeSlot(ordersn: number, address_id: number): Promise<GetAddressResponse>;
/**
* For integrated logistics channel, use this call to get dropoff location for dropoff mode order.
* @param ordersn The order serial numbers.
*/
getBranch(ordersn: number): Promise<GetBranchResponse>;
/**
* Get all the logistics info of an order to Init.
* This API consolidates the output of GetParameterForInit, GetAddresss, GetTimeSlot and GetBranch based on each order so that developer can get all the required parameters ready in this API for Init.
* This API is an alternative of GetParameterForInit, GetAddresss, GetTimeSlot and GetBranch as a set.
* @param ordersn The order serial numbers.
*/
getLogisticInfo(ordersn: number): Promise<GetLogisticInfoResponse>;
/**
* Use this call to initiate logistics including arrange Pickup, Dropoff or shipment for non-integrated logistic channels.
* Should call shopee.logistics.GetLogisticInfo to fetch all required param first.
* It's recommended to initiate logistics one hour AFTER the orders were placed since there is one-hour window buyer can cancel any order without request to seller.
* @param request
*/
init(request: InitRequest): Promise<InitResponse>;
/**
* Use this API to get airway bill for orders.
* AirwayBill is only fetchable when the order status is under READY_TO_SHIP and RETRY_SHIP.
* @param request
*/
getAirwayBill(request: GetAirwayBillRequest): Promise<GetAirwayBillResponse>;
/**
* Use this call to get the logistics tracking information of an order.
* @param request
*/
getLogisticMessage(request: GetLogisticMessageRequest): Promise<GetLogisticMessageResponse>;
/**
* Use this API to get airwaybill for fulfillment orders.
* @param request
*/
getForderWaybill(request: GetForderWaybillRequest): Promise<GetForderWaybillResponse>;
/**
* Use this API to set default_address/pick_up_address/return_address of shop.
* @param request
*/
setAddress(request: SetAddressRequest): Promise<SetAddressResponse>;
/**
* Use this API to delete the address of shop by address_id.
* @param address_id The identity of address
*/
deleteAddress(address_id: number): Promise<SetAddressResponse>;
/**
* Use this call to fetch the logistics information of an order, these info can be used for airwaybill printing.
* Dedicated for crossborder SLS order airwaybill. May not be applicable for local channel airwaybill.
* @param ordersn The order serial numbers.
*/
getOrderLogistic(ordersn: number, forder_id?: string): Promise<GetOrderLogisticResponse>;
/**
* Configure shop level logistics
* @param logistic_id The identity of logistic channel
* @param enabled Whether to enable this logistic channel
* @param prefered Whether to make this logistic channel preferred. Indonestia logistics channel are not applicable.
* @param cod Whether to enable COD for this logistic channel. Only COD supported channels are applicable.
*/
updateShopLogistic(logistic_id: number, enabled?: boolean, prefered?: boolean, cod?: boolean): Promise<UpdateLogisticResponse>;
/**
* Use this call to get all required param for logistic initiation.
* @param ordersn The identity of order
*/
getParameterInit(ordersn: number): Promise<getParameterInitResponse>;
}