Skip to content

Shipments

After creating an order, you need to manifest it (assign a courier) and then retrieve shipment documents.

import {
BigshipClient,
isSuccessResponse,
} from '@agamya/bigship-sdk';

Use placeOrder to assign a courier and manifest the order.

await client.placeOrder({
MasterCustomOrderId: orderId,
courierId: 5, // Delhivery Surface
riskTypeId: '2', // Owner Risk
});

Retrieve full AWB, label, and status details for a manifested order.

const details = await client.getOrderDetail(orderId);
if (isSuccessResponse(details) && details.data) {
console.log('AWB:', details.data.getOrderDetails.AwbNumber);
console.log('Courier:', details.data.getOrderDetails.CourierName);
console.log('Status:', details.data.getOrderDetails.Status);
}

Retrieve labels, invoices, e-waybills, or manifests by document type.

// Get label (base64 Data URI or URL)
const label = await client.downloadDocument(orderId, 'label');
if (isSuccessResponse(label) && label.data) {
console.log('Label:', label.data.AttachmentData);
}
// Get manifest document
const manifest = await client.downloadDocument(orderId, 'manifest');
if (isSuccessResponse(manifest) && manifest.data) {
console.log('Manifest document available');
}
Value Description Return type
'invoice' Invoice document Object with AttachmentData
'label' Shipping label Object with AttachmentData
'ewaybill' E-waybill Object with AttachmentData
'manifest' Manifest document Object with AttachmentData
import { BigshipClient, ShipmentWorkflow } from '@agamya/bigship-sdk';
const result = await new ShipmentWorkflow(client)
.create(orderPayload) // Create order
.withCourier(5) // Select courier
.place() // Manifest
.finalize(); // Get AWB + label + manifest
console.log(result.orderId);