APPROVED to PACKING_IN_PROGRESS

Flow for registered Flipkart sellers to manage orders in Easy Shipment

The Label Generation API (also known as the Pack API) generates invoice and shipping labels for the shipment ids and marks shipments as packed. It takes the invoice details in the request as input. If the orderItemId requires a serial number or IMEI number (also known as serialized product), that input is also required when calling this API.

Request - v3 API

POST https://api.flipkart.net/sellers/v3/shipments/labels

Request Body Schema (v3)

const quantity = {
    type: 'integer($int32)',
    minimum: 1,
};

const TaxItem = {
    type: 'object',
    properties: {
        /**
         * The orderItemId of the primary shipment Item.
         * String
        */   
        orderItemId: { type: 'string' },
        /**
         * Purchase price of the item (only to be passed for refurbished products)
         * Numeric
        */  
        purchasePrice: { type: 'number($double)' },
        /**
         * Unique number that identifies the shipment.
         * Numeric
        */  
        taxRate: { type: 'number' },
        /**
         * Quantity of items to be shipped.
         * Numeric
        */  
        quantity: quantity,
    },
    required: ["orderItemId", "taxRate", "quantity"],
};

const taxItems = {
    type: 'array',
    uniqueItems: true,
    items: TaxItem,
};

const singleSerialNumber = {
    type: 'array',
    items: { type: 'string' },
};

const SerialNumbers = {
    type: 'array',
    items: singleSerialNumber,
};

const SerialNumber = {
    type: 'object',
    properties: {
        /**
         * orderItemId for which serial number is being input
         * String
        */   
        orderItemId: { type: 'string' },
        /**
         * serialNumbers for the given order item id
         * List<List<String>>
        */  
        serialNumbers: SerialNumbers,
    },
    required: ["orderItemId", "serialNumbers"],
};

const serialNumbers = {
    type: 'array',
    uniqueItems: true,
    items: SerialNumber,
};

const TaxDetails = {
    type: 'object',
    properties: {
        cgstRate: { type: 'number' },
        sgstRate: { type: 'number' },
        igstRate: { type: 'number' },
    },
};

const OrderItems = {
    type: 'object',
    properties: {
        orderItemId: { type: 'string' },
        invoiceAmount: { type: 'number' },
        taxRate: { type: 'number' },
        serialNumbers: { type: 'array', items: {type: 'array', items: 'string'} },
        taxDetails: TaxDetails,
    },
    required: ["orderItemId", "taxRate"],
};

const orderItems = {
    type: 'array',
    items: OrderItems,
};

const Invoice = {
    type: 'object',
    properties: {
        /**
         * Unique number that identifies the shipment.
         * String
        */   
        shipmentId: { type: 'string' },
        /**
         * String
        */  
        invoiceDate: { type: 'string($date)' },
        /**
         * If the seller has not opted for auto invoicing, then this field is mandatory.
         * String
        */  
        invoiceNumber: { type: 'string' },
        /**
         * String
        */  
        fssaiLicenseNo: { type: 'string' },
        orderItems: orderItems,
    },
    required: ["shipmentId", "invoiceDate", "invoiceNumber"],
};

const invoices = {
    type: 'array',
    minItems: 1,
    maxItems: 2147483647,
    items: Invoice,
};

const Dimensions = {
    type: 'object',
    properties: {
        /**
         * Length of the sub-shipment
         * Float
        */   
        length: { type: 'number' },
        /**
         * Breadth of the sub-shipment
         * Float
        */   
        breadth: { type: 'number' },
        /**
         * Height of the sub-shipment
         * Float
        */   
        height: { type: 'number' },
        /**
         * Weight of the sub-shipment
         * Float
        */   
        weight: { type: 'number' },
    },
    required: ["length", "breadth", "height", "weight"],
};

const SubShipments = {
    type: 'object',
    properties: {  
        subShipmentId: { type: 'string' },
        dimensions: Dimensions,
    },
    required: ["subShipmentId", "dimensions"],
};

const subShipments = {
    type: 'array',
    items: SubShipments,
};

const PackRequest = {
	type: 'object',
    properties: { 
        /**
         * Unique number that identifies the shipment.
         * String
        */   
        shipmentId: { type: 'string' },  
        /**
         * Id which refers to seller’s dispatch location.
         * String
        */   
        locationId: { type: 'string' }, 
        /**
         * List of taxable items
         * List of tax items
        */   
        taxItems : taxItems, 
        /**
         * Serial number array for serialized products
         * List of serial numbers
         * Mandatory only if item is serialized
        */   
        serialNumbers: serialNumbers,
        /**
         * Invoice details for the shipment
         * List of invoice details
        */   
        invoices: invoices,
        /**
         * List of subShipments associated with the shipment
         * List of sub shipments
        */   
        subShipments: subShipments,
        /**
         * Boolean
        */   
        ignoreWarning: { type: 'boolean' },
    },
    required: ["shipmentId", "locationId", "taxItems", "invoices", "subShipments"],
};

const shipments = {
    type: 'array',
    minItems: 1,
    maxItems: 25,
    items: PackRequest,
};

const ShipmentPackRequest = {
    type: "object",
    properties: { 
        /**
         * List of shipment ids for pack
         * Array of Shipments
        */   
        shipments: shipments,          
    },
    required: ["shipments"],
}

Request Body Example (v3)

{
  "shipments": [
    {
      "shipmentId": "b43befb7-77f0-4aca-bc96-e3df83525ee0",
      "locationId": "LOCbba44916f16b474da588ed9b28768c43",
      "taxItems": [
        {
          "quantity": 1,
          "taxRate": 12,
          "orderItemId": "22584327084153200"
        }
      ],
      "invoices": [
        {
          "invoiceDate": "2022-08-28",
          "orderId": "OD225843270841532000"
        }
      ],
      "subShipments": [
        {
          "subShipmentId": "SS-1",
          "dimensions": {
            "breadth": 7,
            "length": 35,
            "weight": 0.35,
            "height": 7
          }
        }
      ],
      "ignoreWarning": true
    }
  ]
}

Response Body Schema (v3)

const Dimension = {
    type: "object",
    properties: {
        length: { type: "number" },
        breadth: { type: "number" },
        height: { type: "number"},
        weight: { type: "number" }
    },
}

const NotionalValue = {
    type: "object",
    properties: {
        amount: { type: "number", minimum: 0 },
        unit: { type: "string", enum: ['PERCENTAGE', 'INR'] },
    },
}

const Handling = {
    type: "object",
    properties: {
        fragile: { type: "boolean" },
    },
}

const Package = {
    type: "object",
    properties: {
        id: { type: "string" },
        name: { type: "string" },
        dimensions: Dimension,
        weight: { type: "number"},
        notional_value: NotionalValue,
        description: { type: "string"},
        handling: Handling,
    },
}

const SubShipment = {
    type: "object",
    properties: {
        subShipmentId: { type: "string" },
        packages: { type: "array", items: Package }
    },
}

const PriceComponent = {
    type: "object",
    properties: {
        sellingPrice: { type: "number" },
        totalPrice: { type: "number" },
        shippingCharge: { type: "number" },
        customerPrice: { type: "number"},
        flipkartDiscount: { type: "number" },
    },
}

const OrderItem = {
    type: "object",
    properties: {
        orderItemId: { type: "string" },
        orderId: { type: "string" },
        cancellationGroupId: { type: "string" },
        orderDate: { type: "string" },
        cancellationDate: { type: "string"},
        paymentType: { type: "string", enum: ['COD', 'PREPAID'] },
        status: { type: "string", enum: [ APPROVED, PACKING_IN_PROGRESS, FORM_FAILED, PACKED, READY_TO_DISPATCH, PICKUP_COMPLETE, CANCELLED, RETURN_REQUESTED, RETURNED, SHIPPED, DELIVERED, COMPLETED ] },
        cancellationReason: { type: "string"},
        cancellationSubReason: { type: "string"},
        courierReturn: { type: "boolean" },
        quantity: { type: "integer" },
        fsn: { type: "string"},
        sku: { type: "string"},
        listingId: { type: "string"},
        hsn: { type: "string"},
        title: { type: "string"},
        packageIds: { type: "array", items: "string" },
        priceComponents: PriceComponent,
        serviceProfile: { type: "string", enum: [ Flipkart_Fulfilment, Seller_Fulfilment, Smart_Fulfilment, FBF, NON_FBF, FBF_LITE ] },
        is_replacement: { type: "boolean"},
    },
}

const Form = {
    type: "object",
    properties: {
        name: { type: "string" },
        link: { type: "string" },
        automated: { type: "boolean" },
    },
}

const Shipment = {
    type: "object",
    properties: {
        shipmentId: { type: "string" },
        dispatchByDate: { type: "string" },
        dispatchAfterDate: { type: "string" },
        updatedAt: { type: "string"},
        locationId: { type: "string"},
        hold: { type: "boolean"},
        mps: { type: "boolean"},
        packagingPolicy: { type: "string" },
        subShipments: { type: "array", items: SubShipment },
        orderItems: { type: "array", items: OrderItem },
        forms: { type: "array", items: Form },
        shipmentType: { type: "string" },
    },
}

const ShipmentStatusResponse = {
    type: "object",
    properties: {
        shipments: { type: "array", items: Shipment },
    },
    required: ["shipments"],
}

Success Response Example (v3)

// status: 200
{
  "shipments": [
    {
      "shipmentId": "df3d0605-06ef-4602-aacb-64f653e2e048",
      "status": "SUCCESS"
    }
  ]
}

Possible Error Response Codes (v3)

Error Codes Reason for Error
ITEM_ON_HOLD Error if shipment is on hold
INVALID_PACK_REQUEST If all the order items inside shipment are not in approved state
INCOMPLETE_SHIPMENT_DIMENSIONS Invalid dimensions given for particular sub shipment
SERVICEABILITY_NOT_ALLOWED Serviceability not allowed from seller location to buyer location
SELLER_TIN_NOT_FOUND Seller TIN number not found
INVALID_DISPATCH_AFTER_DATE Dispatch After Date is greater than current time of pack
PACK_OPERATION_NOT_AUTHORISED Seller not authorised for packing the shipment
INVALID_IMEI_NUMBER Invalid IMEI number given for any serialised products
WEIGHT_ANOMALY_ERROR Error in dimension details for given shipments
WEIGHT_ANOMALY_WARNING Warning in dimension details for given shipments

Request - Dashboard APIs

Validation Request

POST https://seller.flipkart.com/napi/lbhw/cartmanV2?isCartmanValidationEnabled=false&sellerId=${sellerId}

Validation Request params

Required isCartmanValidationEnabled & sellerId

Validation Body Schema

const Dimensions = {
    type: 'object',
    properties: {
        /**
         * Length of the sub-shipment
         * Float
        */   
        length: { type: 'number' },
        /**
         * Breadth of the sub-shipment
         * Float
        */   
        breadth: { type: 'number' },
        /**
         * Height of the sub-shipment
         * Float
        */   
        height: { type: 'number' },
        /**
         * Weight of the sub-shipment
         * Float
        */   
        weight: { type: 'number' },
    },
    required: ["length", "breadth", "height", "weight"],
};

const SubShipment = {
    type: "object",
    properties: {
        /**
         * 
         */
        external_sub_shipment_id: { type: "string" },
        dimensions: { type: "array", items: Dimensions }
    },
}

const PackRequest = {
	type: 'object',
    properties: { 
        /**
         * Unique number that identifies the shipment.
         * String
        */   
        external_shipment_id: { type: 'string' },  
        /**
         * List of subShipments associated with the shipment
         * List of sub shipments
        */   
        sub_shipments: subShipments,
        /**
         * Boolean
        */   
        ignoreWarning: { type: 'boolean' },
    },
    required: ["shipmentId", "locationId", "taxItems", "invoices", "subShipments"],
};

const shipments = {
    type: 'array',
    minItems: 1,
    maxItems: 25,
    items: PackRequest,
};

const ShipmentPackRequest = {
    type: "object",
    properties: { 
        /**
         * List of shipment ids for pack
         * Array of Shipments
        */   
        shipments: shipments,
         /**
         * Id which refers to seller’s identification.
         * String
        */   
        sellerId: { type: 'string' },        
    },
    required: ["shipments"],
}

Validation Response Sample

{
  "shipments": [
    {
      "disable_pack": false,
      "external_shipment_id": "2f14a546-626d-40eb-86d8-1dcb2f615174",
      "sub_shipments": [
        {
          "anomaly_type": "NO_ANOMALY",
          "disable_pack": false,
          "error_level": "",
          "external_sub_shipment_id": "SS-1",
          "message": "",
          "suggested_dimensions": null
        }
      ]
    }
  ]
}

Request

POST https://seller.flipkart.com/napi/shipments/packV2?isCartmanValidationEnabled=false&sellerId=${sellerId}

Request params

Required isCartmanValidationEnabled & sellerId

Request Body Schema

const Dimensions = {
    type: 'object',
    properties: {
        /*
          NOTE SUBSHIPMENT ID HERE
        */
        external_sub_shipment_id: { type: "string" },
        /**
         * Length of the sub-shipment
         * Float
        */   
        length: { type: 'number' },
        /**
         * Breadth of the sub-shipment
         * Float
        */   
        breadth: { type: 'number' },
        /**
         * Height of the sub-shipment
         * Float
        */   
        height: { type: 'number' },
        /**
         * Weight of the sub-shipment
         * Float
        */   
        weight: { type: 'number' },
    },
    required: ["length", "breadth", "height", "weight"],
};

const SubShipment = {
    type: "object",
    properties: {
        /**
         * 
         */
        external_sub_shipment_id: { type: "string" },
        dimensions: { type: "array", items: Dimensions }
    },
}

const PackRequest = {
	type: 'object',
    properties: { 
        /**
         * Unique number that identifies the shipment.
         * String
        */   
        id: { type: 'string' },
        /* SUBshipment ID in dimensions object*/
        dimensions: { type: "array", items: Dimensions },
        invoice: {
          type: 'object',
          properties: {
            items: {
              type: "array",
              items: {
                type: 'object',
                properties: {
                  order_item_id: { type: "string" },
                  quantity: { type: "number" }
                }
              }
            }
          }
        }
        serialized_items: {
          type: 'array',
          items: {
            type: 'object',
            properties: {
              order_item_id: { type: "string" },
              serial_numbers: {
                type: 'array',
                items: { type: 'string' }
              }
            }
          }
        }
        /**
         * Boolean
        */   
        ignoreWarning: { type: 'boolean' },
    },
    required: ["shipmentId", "locationId", "taxItems", "invoices"],
};

const shipments = {
    type: 'array',
    minItems: 1,
    maxItems: 25,
    items: PackRequest,
};

const ShipmentPackRequest = {
    type: "object",
    properties: { 
        /**
         * List of shipment ids for pack
         * Array of Shipments
        */   
        shipments: shipments,
         /**
         * Id which refers to seller’s identification.
         * String
        */   
        sellerId: { type: 'string' },         
    },
    required: ["shipments"],
}

Request Sample

{
  "sellerId": "ee68199d1b6a436c",
  "shipments": [
    {
      "dimensions": [
        {
          "breadth": 10,
          "external_sub_shipment_id": "SS-1",
          "height": 6,
          "length": 30,
          "weight": 0.35
        }
      ],
      "id": "2f14a546-626d-40eb-86d8-1dcb2f615174",
      "ignore_warning": false,
      "invoice": {
        "items": [
          {
            "order_item_id": "22583900894645300",
            "quantity": 1
          }
        ]
      },
      "serialized_items": [
        {
          "order_item_id": "22583900894645300",
          "serial_numbers": []
        }
      ]
    }
  ]
}

Response Sample

{
  "statuses": [
    {
      "external_shipment_id": "2f14a546-626d-40eb-86d8-1dcb2f615174",
      "shipment_id": "2f14a546-626d-40eb-86d8-1dcb2f615174",
      "status": "success"
    }
  ]
}

Behaviours

TaxRate

1. Missing TaxRate

When Requesting with missing taxRate

Request

{
  "shipments": [
    {
      "shipmentId": "82cc5a1a-6c06-45f2-b0ff-0f2ac3a2ad73",
      "locationId": "LOCbba44916f16b474da588ed9b28768c43",
      "taxItems": [
        {
          "quantity": 1,
          "orderItemId": "22591706075238300"
        }
      ],
      "invoices": [
        {
          "invoiceDate": "2022-09-06",
           "orderId": "OD225917060752383000"
        }
      ],
      "subShipments": [
        {
          "subShipmentId": "SS-1",
          "dimensions": {
            "breadth": 6,
            "length": 35,
            "weight": 0.3,
            "height": 6
          }
        }
      ],
      "ignoreWarning": true
    }
  ]
}

Response

{
  "errors": [
    "shipments[0].taxItems[].taxRate may not be null"
  ]
}

2. Incorrect but applicable tax_rate

When Requesting with incorrect but applicable taxRate (Ex - 18 instead of 12)

Request

{
  "shipments": [
    {
      "shipmentId": "82cc5a1a-6c06-45f2-b0ff-0f2ac3a2ad73",
      "locationId": "LOCbba44916f16b474da588ed9b28768c43",
      "taxItems": [
        {
          "quantity": 1,
          "taxRate": 18,
          "orderItemId": "22591706075238300"
        }
      ],
      "invoices": [
        {
          "invoiceDate": "2022-09-06",
          "orderId": "OD225917060752383000"
        }
      ],
      "subShipments": [
        {
          "subShipmentId": "SS-1",
          "dimensions": {
            "breadth": 6,
            "length": 35,
            "weight": 0.3,
            "height": 6
          }
        }
      ],
      "ignoreWarning": true
    }
  ]
}

Response

{
  "shipments": [
    {
      "shipmentId": "82cc5a1a-6c06-45f2-b0ff-0f2ac3a2ad73",
      "status": "SUCCESS"
    }
  ]
}

3. Random Value

When Requesting with any random value of taxRate (Ex - 11)

Request

{
  "shipments": [
    {
      "shipmentId": "82cc5a1a-6c06-45f2-b0ff-0f2ac3a2ad73",
      "locationId": "LOCbba44916f16b474da588ed9b28768c43",
      "taxItems": [
        {
          "quantity": 1,
          "taxRate": 11,
          "orderItemId": "22591706075238300"
        }
      ],
      "invoices": [
        {
          "invoiceDate": "2022-09-06",
          "orderId": "OD225917060752383000"
        }
      ],
      "subShipments": [
        {
          "subShipmentId": "SS-1",
          "dimensions": {
            "breadth": 6,
            "length": 35,
            "weight": 0.3,
            "height": 6
          }
        }
      ],
      "ignoreWarning": true
    }
  ]
}

Response

{
  "shipments": [
    {
      "shipmentId": "82cc5a1a-6c06-45f2-b0ff-0f2ac3a2ad73",
      "status": "SUCCESS"
    }
  ]
}

Note:

taxRate field is Mandatory for generatingLabels call but it doesnt have any Validations. Any random value / wrong value would not give any errors. Also, it doesnt affect in the generated Invoice as well. Generated Invoince prints and considers the same taxRate which was provided during the Listing of Product.

orderId

1. Missing orderId

When Requesting with missing orderId

Request

{
  "shipments": [
    {
      "shipmentId": "82cc5a1a-6c06-45f2-b0ff-0f2ac3a2ad73",
      "locationId": "LOCbba44916f16b474da588ed9b28768c43",
      "taxItems": [
        {
          "quantity": 1,
          "orderItemId": "22591706075238300"
        }
      ],
      "invoices": [
        {
          "invoiceDate": "2022-09-06",
        }
      ],
      "subShipments": [
        {
          "subShipmentId": "SS-1",
          "dimensions": {
            "breadth": 6,
            "length": 35,
            "weight": 0.3,
            "height": 6
          }
        }
      ],
      "ignoreWarning": true
    }
  ]
}

Response

{
  "errors": [
    "shipments[0].invoices[0].orderId may not be empty"
  ]
}
Edit this page on GitHub
Updated at Tue, Sep 6, 2022
Was this page helpful?