/
Flipkart order onhold After DAD Prepone

Flipkart order onhold After DAD Prepone

when ever we get the event to prepone the DAD of unhold orders.we follow the below steps

MAKE ONHOLD API
step 1: update the onhold state in of order in Order table

UPDATE orders SET onHold = '1' where customerOrderNumber=:customerOrderNumber;

step 2: update the status and onhold in order items table (api)

UPDATE order_items JOIN orders ON orders.id = order_items.order_id SET order_items.onHold = '1', order_items.status = 'onHold' WHERE orders.customerOrderNumber = :customerOrderNumber;

 

step 3:
publish the below event "eventSubType": "onhold", "statusMovedTo": "onhold"

{ "resource": "shipment", "eventType": "PUT", "eventSubType": "onhold", "accountSlug": "spykar", "accountId": null, "actor": "SYSTEM", "version": "v1", "request_data": [], "response_data": { "customerOrderNumber": "bd076a63-069b-45db-8e3b-766f78f7fec6", "orderSiteID": "", "vendorOrderNumber": "OD332642845034780100", "externalShipmentID": "OD332642845034780100-1286-571", "externalWarehouseID": "ACCU", "externalChannelID": "CH1286", "externalWmsChannelName": "FLIPKART_SPYKAR_SPYKAR_ACCU_3176", "external_wms_channel_id": 3176, "channelLabel": "Flipkart Spykar", "integrationType": "6", "vendorPartyID": null, "partner_as2_id": null, "defaultWarehouseCode": "ACCU", "facilityLabel": "Kolkata (ACCU)", "flexStatus": "0", "facilityType": "auperator", "orderDate": "2024-10-22 10:28:55", "portal_id": 1, "paymentType": "COD", "expectedShipDate": "2024-10-23 10:00:00", "dispatchAfterDate": "2024-10-22 10:34:12", "externalManifestNumber": null, "channelManifestNumber": null, "order_id": 56569355, "channel_id": 1286, "warehouse_id": 793, "channel_account_id": 0, "account_id": 142, "connectionId": 468, "locationId": "LOC1d1f9ece85e94cba89c59bb071ce6fa5", "region": "National", "isMetro": "0", "isSpecialplace": "0", "shippingConnectionId": null, "picklistCode": null, "invoiceNumber": "", "boxType": "UNKNOWN", "isPriorityShipment": "0", "isGift": "0", "invoice_url": "", "invoiceDate": null, "label_url": "", "labels": "", "shippingInfo": [], "boxAdditionalRecommendation": [], "dimension_length": "34", "dimension_width": "27", "dimension_height": "2.5", "weight": "500", "chargeableWeight": "500", "trackingID": "", "trackingDomain": "", "packageID": "", "barcode": "", "barcodeType": "item", "taxAmount": 0, "shipChargeAmount": 0, "courierName": "", "cp_id": 0, "created_at": "2024-10-22 10:30:21", "updated_at": "2024-10-22 10:40:27", "status": "unhold", "remarks": "", "warehousePincode": "711302", "thirdPartyShipping": true, "customerName": "Naeem", "customerContactNumber": "9999999999", "email": "xyz@gmail.com", "channelSlug": null, "status_updated_at": "2024-10-22 10:31:18", "status_log": { "created": "2024-10-22 10:30:21", "accepted": "2024-10-22 10:31:18" }, "status_log_first_occurrence": { "accepted": "2024-10-22 10:31:18", "created": "2024-10-22 10:30:21" }, "status_log_count": { "created": 1, "accepted": 1 }, "status_log_id": "222137633", "orderExternalCreatedAt": "2024-10-22 10:30:15", "riskScore": null, "riskScoreReasons": "", "weightProtectionShieldFlag": false, "pincodeServiceableRemarks": null, "orderAdditionalInfo": "", "shippingAddress": { "customerName": "Naeem", "addressLine1": "House No 2", "addressLine2": "Village Laxmi Nagar post Shankarpur kala\nPachperwa", "city": "Pachperwa", "state": "UTTAR PRADESH", "postalCode": "271206", "countryCode": "IN", "countryName": "India", "contactPhone": "9999999999", "email": "xyz@gmail.com" }, "billingAddress": { "customerName": "Naeem", "email": "xyz@gmail.com", "contactPhone": "9999999999" }, "warehouseAddress": { "addressLine1": "Amta Road, NH-6, Mouza Mallickbagan, J.L. No-. 07, Ranihati", "addressLine2": "Panchla, Howrah", "city": "Kolkata", "state": "West Bengal", "postalCode": "711302", "gstin": "19AAFCB0498R1ZW" }, "totalItemsWeight": 500, "portalUrl": "https:\/\/storage.googleapis.com\/eshopbox-client-portal-prod.appspot.com\/TransactionCSVFiles\/flipkart.png", "id": 24700994, "orderTotal": 1399, "subTotal": 1399, "isCOD": "1", "track_payload": [], "itemsWeightProtectionShieldFlag": false, "items": [ { "order_item_id": 40387050, "lineItemSequenceNumber": "332642845034780100", "orderItemID": "332642845034780100-40387050", "itemID": "JEAGWK9FSZQRQVGU", "sku": "79UBU3HJSJG", "asin": "", "productName": "Spykar Slim Men Blue Jeans 32 MDSKN2BC038", "quantity": 1, "orderItemCreatedAt": "2024-10-22 10:30:15", "customerPrice": 1399, "lineItemTotal": 1399, "invoiceTotal": 1399, "cashOnDeliveryCharges": 0, "discount": 0, "taxRate": 0, "taxAmount": 0, "inventoryItemCode": "", "giftMessage": "", "isGift": "0", "giftLabelContent": "", "lineItemOrderStatus": "created", "orderItemIDs": [ "332642845034780100-40387050" ], "productImageUrl": "https:\/\/i.postimg.cc\/05wLdThq\/MDSKN2-BC038-MID-BLUE-1.jpg", "productAdditionalInfo": { "breadth": 27, "length": 34, "weight": 0.5, "height": 2.5, "productDetails": { "unitPrice": 3999, "hsnCode": "62034300", "dimensionHeight": 2.5, "dimensionLength": 34, "dimensionUnit": "cm", "description": "Spykar Low Rise Slim Fit Blue Jeans For Men", "weight": 500, "weight_dimension_status": "unverified", "mrp": 3999, "dimensionWidth": 27, "type": "BASE", "verticalName": "Apparels", "imageUrl": "https:\/\/i.postimg.cc\/05wLdThq\/MDSKN2-BC038-MID-BLUE-1.jpg", "accountSlug": "spykar", "sku": "8905566352179", "esin": "79UBU3HJSJG", "brand": "SPYKAR", "additionalNames": { "ean": "8905566352179", "upc": "8905566352179", "gtin": "8905566352179", "others": [] }, "groupCode": "MDSKN2BC038MidBlue", "status": "ACTIVE", "weightUnit": "g" } }, "expectedDeliveryDate": null, "shippingCharges": 0, "productUrl": null, "originalOrderItemId": null, "isVirtualKit": "0", "component": [], "onhold": "0", "cancellationAdditionalReason": "", "cancellationReason": "", "customerOrderItemID": "", "recallBlockedInventoryUsed": "" } ], "balanceDue": 1399, "statusMovedTo": "onhold" }, "previous_data": [], "resource_type": "shipment.update", "account_slug": "spykar", "custom": [] }

Fetch the "response_data" by the below api:

curl --location 'http://spykar.eshopbox.com/api/order/shipment/OD332642845034780100-1286-571' \ --header 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVC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": "bd076a63-069b-45db-8e3b-766f78f7fec6", "orderSiteID": "", "vendorOrderNumber": "OD332642845034780100", "externalShipmentID": "OD332642845034780100-1286-571", "externalWarehouseID": "ACCU", "externalChannelID": "CH1286", "externalWmsChannelName": "FLIPKART_SPYKAR_SPYKAR_ACCU_3176", "external_wms_channel_id": 3176, "channelLabel": "Flipkart Spykar", "integrationType": "6", "vendorPartyID": null, "partner_as2_id": null, "defaultWarehouseCode": "ACCU", "facilityLabel": "Kolkata (ACCU)", "flexStatus": "0", "facilityType": "auperator", "orderDate": "2024-10-22 10:28:55", "portal_id": 1, "paymentType": "COD", "expectedShipDate": "2024-10-23 10:00:00", "dispatchAfterDate": "2024-10-22 10:34:12", "externalManifestNumber": null, "channelManifestNumber": null, "order_id": 56569355, "channel_id": 1286, "warehouse_id": 793, "channel_account_id": 0, "account_id": 142, "connectionId": 468, "locationId": "LOC1d1f9ece85e94cba89c59bb071ce6fa5", "region": "National", "isMetro": "0", "isSpecialplace": "0", "shippingConnectionId": null, "picklistCode": null, "invoiceNumber": "", "boxType": "UNKNOWN", "isPriorityShipment": "0", "isGift": "0", "invoice_url": "", "invoiceDate": null, "label_url": "", "labels": "", "shippingInfo": [], "boxAdditionalRecommendation": [], "dimension_length": "34", "dimension_width": "27", "dimension_height": "2.5", "weight": "500", "chargeableWeight": "500", "trackingID": "", "trackingDomain": "", "packageID": "", "barcode": "", "barcodeType": "item", "taxAmount": 0, "shipChargeAmount": 0, "courierName": "", "cp_id": 0, "created_at": "2024-10-22 10:30:21", "updated_at": "2024-10-22 10:40:27", "status": "accepted", "remarks": "", "warehousePincode": "711302", "thirdPartyShipping": true, "customerName": "Naeem", "customerContactNumber": "9999999999", "email": "xyz@gmail.com", "channelSlug": null, "status_updated_at": "2024-10-22 10:31:18", "status_log": { "created": "2024-10-22 10:30:21", "accepted": "2024-10-22 10:31:18" }, "status_log_first_occurrence": { "accepted": "2024-10-22 10:31:18", "created": "2024-10-22 10:30:21" }, "status_log_count": { "created": 1, "accepted": 1 }, "status_log_id": "222137633", "orderExternalCreatedAt": "2024-10-22 10:30:15", "riskScore": null, "riskScoreReasons": "", "weightProtectionShieldFlag": false, "pincodeServiceableRemarks": null, "orderAdditionalInfo": "", "shippingAddress": { "customerName": "Naeem", "addressLine1": "House No 2", "addressLine2": "Village Laxmi Nagar post Shankarpur kala\nPachperwa", "city": "Pachperwa", "state": "UTTAR PRADESH", "postalCode": "271206", "countryCode": "IN", "countryName": "India", "contactPhone": "9999999999", "email": "xyz@gmail.com" }, "billingAddress": { "customerName": "Naeem", "email": "xyz@gmail.com", "contactPhone": "9999999999" }, "warehouseAddress": { "addressLine1": "Amta Road, NH-6, Mouza Mallickbagan, J.L. No-. 07, Ranihati", "addressLine2": "Panchla, Howrah", "city": "Kolkata", "state": "West Bengal", "postalCode": "711302", "gstin": "19AAFCB0498R1ZW" }, "totalItemsWeight": 500, "portalUrl": "https://storage.googleapis.com/eshopbox-client-portal-prod.appspot.com/TransactionCSVFiles/flipkart.png", "id": 24700994, "orderTotal": 1399, "subTotal": 1399, "isCOD": "1", "track_payload": [], "itemsWeightProtectionShieldFlag": false, "items": [ { "order_item_id": 40387050, "lineItemSequenceNumber": "332642845034780100", "orderItemID": "332642845034780100-40387050", "itemID": "JEAGWK9FSZQRQVGU", "sku": "79UBU3HJSJG", "asin": "", "productName": "Spykar Slim Men Blue Jeans 32 MDSKN2BC038", "quantity": 1, "orderItemCreatedAt": "2024-10-22 10:30:15", "customerPrice": 1399, "lineItemTotal": 1399, "invoiceTotal": 1399, "cashOnDeliveryCharges": 0, "discount": 0, "taxRate": 0, "taxAmount": 0, "inventoryItemCode": "", "giftMessage": "", "isGift": "0", "giftLabelContent": "", "lineItemOrderStatus": "created", "orderItemIDs": [ "332642845034780100-40387050" ], "productImageUrl": "https://i.postimg.cc/05wLdThq/MDSKN2-BC038-MID-BLUE-1.jpg", "productAdditionalInfo": { "breadth": 27, "length": 34, "weight": 0.5, "height": 2.5, "productDetails": { "unitPrice": 3999, "hsnCode": "62034300", "dimensionHeight": 2.5, "dimensionLength": 34, "dimensionUnit": "cm", "description": "Spykar Low Rise Slim Fit Blue Jeans For Men", "weight": 500, "weight_dimension_status": "unverified", "mrp": 3999, "dimensionWidth": 27, "type": "BASE", "verticalName": "Apparels", "imageUrl": "https://i.postimg.cc/05wLdThq/MDSKN2-BC038-MID-BLUE-1.jpg", "accountSlug": "spykar", "sku": "8905566352179", "esin": "79UBU3HJSJG", "brand": "SPYKAR", "additionalNames": { "ean": "8905566352179", "upc": "8905566352179", "gtin": "8905566352179", "others": [] }, "groupCode": "MDSKN2BC038MidBlue", "status": "ACTIVE", "weightUnit": "g" } }, "expectedDeliveryDate": null, "shippingCharges": 0, "productUrl": null, "originalOrderItemId": null, "isVirtualKit": "0", "component": [], "onhold": "0", "cancellationAdditionalReason": "", "cancellationReason": "", "customerOrderItemID": "", "recallBlockedInventoryUsed": "" } ], "balanceDue": 1399 }

Fetching account slug by using below query (open point)

select accounts.account_slug from accounts left join channels on channels.account_id = accounts.id left join orders on orders.channel_id=channels.id where orders.customerOrderNumber= :customerOrderNumber ;

Related content