/
Flipkart Order Fulfillment Sequence Diagram

Flipkart Order Fulfillment Sequence Diagram

Steps

Step 1. FlipkartFulfillmentListener will receive data from EshopBoxFulfillmentService in which data needs to be processed only if eventSubType is “created

Shipment Created Event Data as given below.

{ "resource": "shipment", "eventType": "PUT", "eventSubType": "created", "accountSlug": "kapaskraft", "actor": "SYSTEM", "version": "v1", "request_data": [], "response_data": { "customerOrderNumber": "KK100244", "vendorOrderNumber": "11920832654052201", "externalShipmentID": "KK100244-388-41", "externalWarehouseID": "Kapas Kraft Apparels Limited 1006", "externalChannelID": "TATA CLIQ VELOCY KAPAS KRAFT", "integrationType": "4", "defaultWarehouseCode": "2022", "orderDate": "2020-07-28 08:10:53", "portal_id": 12, "paymentType": "ONLINE", "order_id": 1971482, "channel_id": 388, "warehouse_id": 77, "account_id": 167, "region": "", "invoiceNumber": "INV-20/2110138", "boxType": "UNKNOWN", "isPriorityShipment": "0", "isGift": "0", "invoice_url": "", "invoiceDate": "2020-07-29 00:00:00", "label_url": "https://pyck-res-bucket.s3.amazonaws.com:443/DELHIVERY/2020-07-29/2098310542415.pdf", "labels": "", "shippingInfo": [], "boxAdditionalRecommendation": [], "dimension_length": "1", "dimension_width": "1", "dimension_height": "1", "weight": "431", "trackingID": "2098310542415", "packageID": "", "barcode": "", "courierName": "Delhivery", "created_at": "2020-07-28 13:44:23", "updated_at": "2020-07-29 10:42:33", "status": "dispatched", "remarks": "", "customerName": "John Doe", "customerContactNumber": "9998889998", "email": "johndoe@gmail.com", "channelSlug": "kapasKraft", "status_updated_at": "2020-07-29 11:26:50", "status_log": { "dispatched": "2020-07-29 11:26:50", "packed": "2020-07-29 10:42:38", "created": "2020-07-28 13:44:23" }, "orderExternalCreatedAt": "2020-07-28 13:44:18", "shippingAddress": { "customerName": "John Doe", "addressLine1": "Kapas Kraft Apparels Limited", "addressLine2": "Banglore", "city": "bengluru", "state": "Karnataka", "postalCode": "560005", "countryCode": "IN", "countryName": "India", "contactPhone": "9998889998", "email": "johndoe@gmail.com" }, "id": 1958732, "isCOD": "0", "track_payload": [], "packed_date": "2020-07-29 10:42:38", "items": [ { "lineItemSequenceNumber": 57, "orderItemID": "BLCK103443-3781063", "itemID": "5df8c063737b791c70e35974", "sku": "BBAPLBB140117_40", "asin": "", "productName": "Men Black T-Shirt", "quantity": 1, "customerPrice": 499, "lineItemTotal": 499, "invoiceTotal": 499, "discount": 0, "taxRate": 0, "taxAmount": 0, "giftMessage": "", "giftLabelContent": "", "lineItemOrderStatus": "", "orderItemIDs": [ "KK100244-5926961" ], "productImageUrl": "https://s3-eu-west-1.amazonaws.com/imagebucketeshopbox/Uzip/219045371-1-40/1.JPG", "productAdditionalInfo": { "size": "M", "color": "NA" }, "expectedDeliveryDate": "2020-07-30", "shippingCharges": 0, "productUrl": "https://kapaskraft.auperator.co/product/edit-product/BBAPLMC144105_44" }, { "lineItemSequenceNumber": 58, "orderItemID": "BLCK103443-3781067", "itemID": "5ebe805b34623261ac57dab8", "sku": "BBAPLBB140117_40", "asin": "", "productName": "Men Black T-Shirt", "quantity": 1, "customerPrice": 499, "lineItemTotal": 499, "invoiceTotal": 499, "discount": 0, "taxRate": 0, "taxAmount": 0, "giftMessage": "", "giftLabelContent": "", "lineItemOrderStatus": "", "orderItemIDs": [ "KK100244-5926962" ], "productImageUrl": "https://s3-eu-west-1.amazonaws.com/imagebucketeshopbox/Uzip/219045371-1-40/1.JPG", "productAdditionalInfo": { "size": "XL", "color": "NA" }, "expectedDeliveryDate": "2020-07-30", "shippingCharges": 0, "productUrl": "https://kapaskraft.auperator.co/product/edit-product/BBAPLMC144105_44" } ] }, "previous_data": [], "resource_type": "shipment.update", "account_slug": "kapaskraft", "custom": [] }

Step 2. Now use externalChannelId given in the data sent by EshopboxFulfillmentService to fetch connectionId that will be used to retrieve accessToken

Database: eshopbox_client_portal_dev

Tables Used: tax_code_slabs and product_variation

Now fetch taxRate using sku given in shipmentCreated Event against each Item

(SELECT tax_code_slabs.taxRate FROM tax_code_slabs LEFT JOIN product_variation ON product_variation.tax_code_id = tax_code_slabs.tax_code_id WHERE product_variation.product_number = :sku).setParameter("sku", sku);

Database: integration_engine_staging

Tables Used: ie_appinstall_connection

Use below SQL Query to fetch accessToken using retrieved connectionId either from Cache Memory or from Database (only if not available in Cache Memory)

(SELECT ie_appinstall_connection.accessToken FROM ie_appinstall_connection WHERE connectionId= :connectionId).setParameter("connectionId",connectionId);

Once the accessToken is generated, store it in Cache Memory in the specified format given below

{ "connectionAccessToken_{{connectionId}}":"{{ACCESS TOKEN}}" }

Step 3. Now transform the data received from EshopBoxFulfillmentService into the format which is accepted by Flipkart as given below

{ "shipments": [ { "subShipments": [ { "dimensions": { "breadth": 0, "length": 0, "weight": 0, "height": 0 }, "subShipmentId": "string" } ], "taxItems": [ { "taxRate": 0, "orderItemId": "string", "quantity": 0 } ], "invoices": [ { "orderId": "string", "invoiceNumber": "string", "invoiceDate": "2020-11-10" } ], "serialNumbers": [ { "serialNumbers": [ [ "string" ] ], "orderItemId": "string" } ], "locationId": "string", "shipmentId": "string" } ] }

EshopboxFulfillmentService Keys

FlipkartFulfillmentService Keys

EshopboxFulfillmentService Keys

FlipkartFulfillmentService Keys

resource

 

eventType

 

eventSubType

 

accountSlug

 

actor

 

version

 

request_data[].

 

response_data.customerOrderNumber

shipments[].invoices[].orderId

response_data.vendorOrderNumber

 

response_data.customerOrderNumber

shipments[].shipmentId

response_data.externalWarehouseID

shipments[].locationId

response_data.externalChannelID

 

response_data.integrationType

 

response_data.defaultWarehouseCode

 

response_data.orderDate

 

response_data.portal_id

 

response_data.paymentType

 

response_data.order_id

 

response_data.channel_id

 

response_data.warehouse_id

shipments[].locationId

response_data.account_id

 

response_data.region

 

response_data.invoiceNumber

shipments[].invoices[].invoiceNumber (NOT APPLICABLE)

response_data.boxType

 

response_data.isPriorityShipment

 

response_data.isGift

 

response_data.invoice_url

 

response_data.invoiceDate

shipments[].invoices[].invoiceDate

response_data.label_url

 

response_data.labels

 

response_data.shippingInfo

 

response_data.boxAdditionalRecommendation

 

response_data.dimension_length

shipments[].subShipments[].dimensions.length

response_data.dimension_width

shipments[].subShipments[].dimensions.breadth

response_data.dimension_height

shipments[].subShipments[].dimensions.height

response_data.weight

shipments[].subShipments[].dimensions.weight

response_data.trackingID

 

response_data.packageID

 

response_data.barcode

 

response_data.courierName

 

response_data.created_at

shipments[].invoices[].invoiceDate (NOT APPLICABLE)

response_data.updated_at

shipments[].invoices[].invoiceDate (NOT APPLICABLE)

response_data.status

 

response_data.remarks

 

response_data.customerName

 

response_data.customerContactNumber

 

response_data.email

 

response_data.channelSlug

 

response_data.status_updated_at

 

response_data.status_log.dispatched

 

response_data.status_log.packed

 

response_data.status_log.created

 

response_data.orderExternalCreatedAt

 

response_data.shippingAddress.customerName

 

response_data.shippingAddress.addressLine1

 

response_data.shippingAddress.addressLine2

 

response_data.shippingAddress.city

 

response_data.shippingAddress.state

 

response_data.shippingAddress.postalCode

 

response_data.shippingAddress.countryCode

 

response_data.shippingAddress.countryName

 

response_data.shippingAddress.contactPhone

 

response_data.shippingAddress.email

 

response_data.id

 

response_data.isCOD

 

response_data.track_payload

 

response_data.packed_date

 

response_data.items[].lineItemSequenceNumber

shipments[].serialNumbers[].serialNumbers[] (NOT APPLICABLE)

response_data.items[].orderItemID

shipments[].taxItems[].orderItemId

response_data.items[].itemID

shipments[].invoices[].orderId

response_data.items[].sku

 

response_data.items[].asin

 

response_data.items[].productName

 

response_data.items[].quantity

shipments[].taxItems[].quantity

response_data.items[].customerPrice

 

response_data.items[].lineItemTotal

 

response_data.items[].invoiceTotal

 

response_data.items[].discount

 

response_data.items[].taxRate

shipments[].taxItems[].taxRate

response_data.items[].taxAmount

 

response_data.items[].giftMessage

 

response_data.items[].giftLabelContent

 

response_data.items[].lineItemOrderStatus

 

response_data.items[].orderItemIDs[]

shipments[].taxItems[].orderItemId

response_data.items[].productImageUrl

 

response_data.items[].productAdditionalInfo.size

shipments[].subShipments[].dimensions.breadth,

shipments[].subShipments[].dimensions.length,

shipments[].subShipments[].dimensions.weight,

shipments[].subShipments[].dimensions.height

response_data.items[].productAdditionalInfo.color

 

response_data.items[].expectedDeliveryDate

 

response_data.items[].shippingCharges

 

response_data.items[].productUrl

 

previous_data[].

 

resource_type

 

account_slug

 

custom[].

 

Step 4. Now push the transformed data which is in the format required by FlipkartFulfillmentService along with accessToken which will be used for authentication purpose

POST API URL

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

Request Body

{ "shipments": [ { "subShipments": [ { "dimensions": { "breadth": {{response_data.dimension_width}}, "length": {{response_data.dimension_length}}, "weight": {{response_data.weight}}, "height": {{response_data.dimension_height}} }, "subShipmentId": "SS-1"//keep it static until resolved //not given in Shipment Created Event } ], "taxItems": [ { "taxRate": {{response_data.items[].taxRate}}, "orderItemId": "{{response_data.items[].orderItemID}}", "quantity": {{response_data.items[].quantity}} } ], "invoices": [ { "orderId": "{{response_data.customerOrderNumber}}", "invoiceDate": "{{response_data.invoiceDate}}" } ], "locationId": "{{fetch from Database using externalChannelID}}" "shipmentId": "{{response_data.externalShipmentID}}" } ] }

Response Body

  1. 200 OK

{ "shipments": [ { "status": "string", "errorCode": "string", "errorMessage": "string", "shipmentId": "string" } ] }

 

 

 

 

 

 

 

 

 

 

 

Related content