31 lines
1.1 KiB
TypeScript
31 lines
1.1 KiB
TypeScript
import { CourierAdapter } from "./base.js";
|
|
import { BalanceResponse, ParcelCreateRequest, ParcelResponse, SupportedCourier, TrackingResponse } from "../types.js";
|
|
export declare class PaperflyAdapter implements CourierAdapter {
|
|
courierName: SupportedCourier;
|
|
private apiKey;
|
|
private username;
|
|
private password;
|
|
private storeName;
|
|
private client;
|
|
private enabled;
|
|
constructor(apiKey: string, username: string, password: string, storeName: string, baseUrl: string);
|
|
isConfigured(): boolean;
|
|
createParcel(req: ParcelCreateRequest): Promise<ParcelResponse>;
|
|
trackParcel(trackingCode: string): Promise<TrackingResponse>;
|
|
/**
|
|
* Paperfly does not expose a live wallet balance API endpoint (T3).
|
|
*/
|
|
getBalance(): Promise<BalanceResponse>;
|
|
/**
|
|
* Authentic Upstream Paperfly Cancellation
|
|
* Endpoint: POST /api/v1/cancel-order
|
|
*/
|
|
cancelParcel(orderId: string, reason?: string): Promise<{
|
|
success: boolean;
|
|
courier: SupportedCourier;
|
|
consignment_id: string;
|
|
message: string;
|
|
raw_response?: any;
|
|
}>;
|
|
}
|