Next as MP (Platform Plus)
The purpose of this scope is to detail the requirements for connection with Platform Plus (custom platform for connection with Next’s website as to a Marketplace)
Version | Date | Created / Updated by | Notes |
---|---|---|---|
v1.1 | 26/04/2023 | Hristiyan Georgiev | Updated cancellation and refund scope. The two flows will be separated into two crons. |
Tagged with (v1.1) | |||
v1.2 | 15.05.2023 | Bogomil Pavlov | Brand mapping changes |
v1.3 | 16.05.2023 | Danail Deltchev | Adding validation for Order Item Line > Status |
v1.4 | 26.05.2023 | Milen Markov | Updated get orders. Another field to keep included |
Documentation from Platform Plus can be found as an attachment below:
Dorothy Perkins Non-stocked supplier integration v1.pdf
The integration we are targeting is the SFTP connection via XML feeds and includes the following sections:
Stock Specification - this specifies the method of communicating for Stock updates from Hemisphere to Platform Plus - an XML needs to be created with the following specifications
- Naming convention: “INV-MM-DD-HHMMSS.xml”
- File path: files should be posted to “/transfer/inventory” on the required SFTP
- Fields specification:
Name | Format | Mandatiry | Notes | Hemisphere field |
---|---|---|---|---|
Brand | Alpha / numeric | Y | The brand of the product we are sending stock for | item_account.ItemSpecifics > “brand” (to be always converted to lower-case for better matching) |
EAN | Numeric | Y | The unique reference Platform Plus uses for tracking quantity | item.EAN |
Quantity | Numeric | Y | The quantity level we want to send them | item_account.Quantity |
WarehouseCode | Alpha / numeric | Y | Next require a specific predominantly based on Brand. For the first brand named “Dorothy Perkins” they need value “DOROTHYP001” | It is good to be managed from the account / seller / account_seller. |
Not sure the best place for this but we need to make it in the way to easily through setup manage multiple future brands | | StockFeedName | Alpha / numeric | Y | Next require a specific predominantly based on Brand. For the first brand named “Dorothy Perkins” they need value “DOROTHYPSTK” | It is good to be managed from the account / seller / account_seller. Not sure the best place for this but we need to make it in the way to easily through setup manage multiple future brands | | DateTimeStamp | Date / time | Y | Date and time of creation of the feed | Format YYYY-MM-DDTHH:MI:SS (example: 2020-06-18T09:00:01) |
- Example XML:
<?xml version="1.0" encoding="UTF-8”?>
4. Frequency of the files: We need to be creating a file with frequency not faster than every 15 minutes. We still want to keep the Delta updates (only changed values) running on that time period. Once every 24 hours instead of a Delta feed we need to create a feed with current values of all non closed products we have
5. Triggers - Stock update needs to be sent the following three options: 1) If we have update_quantity = ‘pending' AND item_closed = 0 then send the Value in the Quantity field; 2) If we have end_item = 1 then send Quantity = 0. We don’t care for any other values in this case; 3) If it is time for the full stock update if we have item_closed = 0 then send the Value in the Quantity field
**NEW:** A validation for adding a product to the feed is to be made. The check is to ensure we have all needed information to add successfully a product to the feed. In case we can’t we are to set update_quantity to “error” and end_item to 0. When sending Stock feeds we are to pick any products as per the above criteria besides such that are on update_quantity = “error”. The only exclusion from this rule is products with end_item = 1. In ANY case where we have end_item = 1 we should try to send 0 quantity. Meaning it doesn’t matter if it is a full stock update or delta updates through out the day if the flag end_item is set to 1 regardless of status we should try to send quantity 0. In case it hits a validation error we should just threat it again as usual - set update_quantity to “error” and end_item = 0
We don’t have any feedback for the read of the feed so the successful creation of the feed on the end SFTP is to be treated as successful operation meaning ‘pending’ flags are to be pushed to 'normal' or end_item flag to be set to 0
Order Specification - this specifies the method of communication of orders form Next’s platform to us
- Naming convention: “Orders
.xml” where the is the unique reference number provided by Next’s system Each order should be coming in a separate file - File path: files should be consumed from “/transfer/orders” on the required SFTP Once the orders are consumed the files should be moved to “/transfer/archive” on the same SFTP
- Fields specification:
Name | Format | Mandatory | Notes | Hemisphere field |
---|---|---|---|---|
Brand | Alpha / numeric | Y | I’ve asked the question but don’t have the answer yet - there is no “Brand” in the example but we should be expecting to have this field. We don’t need it just to not break anything | N/A |
ID | Numeric | Y | Unique order ID - 8 characters - created by the Next system for the order | orders.marketplace_order_id |
EAN | Numeric | Y | EAN is the primary identifier Platform Plus uses for Stock references, hence it is present in the Orders feed as well | order_item.ChannelItemID |
ItemID | Numeric | Y | Unique Item ID per each EAN per each Quantity. In other words the equivalent of the unique line_ids we generate for each order | order_item_line.mp_order_item_id |
BrandSKU | Alpha / numeric | N | If we have the SKU in the feed we are to use it, if not we are to match by the EAN to obtain the SKU from “item” |
Note: As EAN currently is not Unique field we need to validate and in case there are multiple EANs SKU should be empty and an error should be stored on the order | order_item.item_sku | | Quantity | Numeric | Y | Expectation is this will be always “1” | order_item.item_quantity | | PromiseDate | Date / time | Y | The promised date by Next to the end buyer by which this order is to be delivered | N/A | | OrderExternalRef | Alpha / numeric | N | Marketplace order ID used by next for orders that are not handled by their warehouse | orders.sm_sales_rec_num | | Destination | Alpha / numeric | N | Where is expected for this order to be delivered as Next DC | At this point N/A | | DateTimeStamp | Date / time | Y | When the order was placed | orders.order_created_time |
3. Example XML:
<?xml version="1.0" encoding="UTF-8”?>
4. Frequency of the files: upon creation in Next systems. We should be polling for new orders every 5 or 10 minutes
- Triggers - N/A
Additionally if the order has been successfully mapped for the above field we need to set it as “waiting_for_delivery”, calculate a total if possible (by getting the Price from the designated item_accounts) or set 0 if not possible, set Currency to GBP, set shipping_country_code to “UK”
Order Acknowledgement Specification - literally just providing acknowledgement we’ve received the order as expected
- Naming convention: “OrderACK-
-.xml” where the ID is the provided unique ID reference from Next systems (orders.marketplace_order_id) Each order should be in a separate file - File path: files should be posted to “/transfer/acknowledgements” on the required SFTP
- Fields specification:
Name | Format | Mandatory | Notes | Hemisphere field |
---|---|---|---|---|
ID | Numeric | Y | The reference previously provided by Next | orders.marketplace_order_id |
3. Example XML:
<?xml version="1.0" encoding="UTF-8”?>
-
Frequency of the files - whenever an order has been received successfully. Can be running and checking every 5/10 minutes
-
Triggers - Whenever we have an order on Ready for shipping that has order_items, has corresponding order_item_lines, order_item_line.status = ‘' and both order_item.item_sku and order_item_line.mp_order_item_id have values it should be exported for acknowledgement. Upon successful export of an acknowledgement file we are to set the order_item_line.status = 'acknowledged’
(v1.1)Order Ship Status Specification - this specifies the method of post acknowledgement update to the Next system (Shipment). Status update is final, once a status update has been pushed with one or the other to Platform Plus a consecutive status update should not be sent
- Naming convention: “OrderStatus-
- .xml” where is the unique reference ID provided by Next systems (orders.marketplace_order_id) and is the date of creation of the file in the format YYYY-MM-DD-MIHH (example: “2020-06-18-0900”) - File path: files should be posted to “/transfer/shipping” on the required SFTP
- Fields specification:
Name | Format | Mandatory | Notes | Hemi field |
---|---|---|---|---|
ID | Numeric | Y | Unique order ID - 8 characters - created by the Next system for the order | Order > Marketplace Order ID |
ItemID | Numeric | Y | The unique MP line ID provided by Next systems | Order Item Line > Marketplace Order Item ID |
Brand | Alpha / numeric | Y | The brand of the product | Product Account > ItemSpecifics > “brand” or “Brand” |
EAN | Numeric | Y | EAN is the primary identifier Platform Plus uses for Stock references, hence it is present in the Orders feed as well | Product in Order > Channel Item ID |
Brand SKU | Alpha / numeric | N | The SKU we’ve stored for the ordered product | Product in Order > SKU |
Quantity | Numeric | Y | The ordered quantity we are updating. As it is per ItemID expectation is it will be always “1” | Based on the amount added in Order Refund Rows we need to calculate the needed quantity and allocate the relevant Order Item Lines that are still not Shipped or already Cancelled / Returned |
Status | Alpha / numeric | Y | The status we want to send for the ItemID. In this case it will be “Cancelled” | hardcoded |
ShippingReference | Alpha / numeric | Y | Tracking ID | Orders > Shipping Track Number |
Destination | Alpha / numeric | N | If needed this is how we can sort orders to different Next DCs if we are to send those to them directly | N/A |
DateTimeStamp | Date / time | Y | Date and time of creation of the original order |
ISO 8601 Format : YYYY-MM-DDThh:mm:ss | Orders > Order Created Time |
3. Example XML:
<?xml version="1.0" encoding="UTF-8”?>
4. Frequency of the files - whenever an order has been prepared for update. Can be running and checking every 5/10 minutes
- Triggers - an order that has (update_shipping_pending = 1 and tool_status = ‘waiting_for_delivery' and order_item_line.status = ‘acknowledged'). Once we’ve determined we need to send an update we need to use the following:
Send a “Dispatched” update to Platform Plus.
Once we’ve successfully sent a Status update to Platform Plus we are to update the order to remove the update_shipping_pending flag (set it to 0), update the order_item_line.status field with the actual status we sent in the file (“Dispatched”) and update the tool_status.
(v1.1)Order cancellation specification - this specifies the method of post acknowledgement update to the Next system (Cancellation). Status update is final, once a status update has been pushed with one or the other to Platform Plus a consecutive status update should not be sent
- Naming convention: “OrderStatus-
- .xml” where is the unique reference ID provided by Next systems (Order > Marketplace Order ID) and is the date of creation of the file in the format YYYY-MM-DD-MIHH (example: “2020-06-18-0900”) - File path: files should be posted to “/transfer/shipping” on the required SFTP
- Mapping:
Name | Format | Mandatory | Notes | Hemi field | Comment |
---|---|---|---|---|---|
ID | Numeric | Y | Unique order ID - 8 characters - created by the Next system for the order | Order > Marketplace Order ID | |
ItemID | Numeric | Y | The unique MP line ID provided by Next systems | Order Item Line > Marketplace Order Item ID | |
Brand | Alpha / numeric | Y | The brand of the product | (v1.2)Product Account > Item Specifics OR | |
Product > Brand | (v1.2) Please note we want to have case insensitive search for Product Account > Item Specifics and we want to get the value for the Brand name | ||||
If there is no match we return an error in Order Error Table | |||||
EAN | Numeric | Y | EAN is the primary identifier Platform Plus uses for Stock references, hence it is present in the Orders feed as well | Product in Order > Channel Item ID | |
Brand SKU | Alpha / numeric | N | The SKU we’ve stored for the ordered product | Product in Order > SKU | Based on the SKU we can get the Product and Product Account |
Quantity | Numeric | Y | The ordered quantity we are updating. As it is per ItemID expectation is it will be always “1” | Based on the amount added in Order Refund Rows we need to calculate the needed quantity and allocate the relevant Order Item Lines that are still not Shipped or already Cancelled / Returned | |
Status | Alpha / numeric | Y | The status we want to send for the ItemID. In this case it will be “Cancelled” | hardcoded | |
ShippingReference | Alpha / numeric | Y | Tracking ID | Orders > Shipping Track Number | |
Destination | Alpha / numeric | N | If needed this is how we can sort orders to different Next DCs if we are to send those to them directly | N/A | |
DateTimeStamp | Date / time | Y | Date and time of creation of the original order |
ISO 8601 Format : YYYY-MM-DDThh:mm:ss | Orders > Order Created Time | |
Example XML:
<?xml version="1.0" encoding="UTF-8”?>
5. Frequency of the files - whenever an order has been prepared for update. Can be running and checking every 5/10 minutes
6. Triggers : as per our abstraction for preShipment refund , can be found [Refunds send general logic](https://www.notion.so/Refunds-send-general-logic-d643578dd9364d4faea0198cab5aa38e?pvs=21).
7. Validations: Once we’ve selected the refunds we want to make a check if Order Item Line > Status for all item lines participating are on an “acknowledged” status. If not, this means some one is trying to make an update to a line that is already Shipped or Dispatched and we want this to block the refund, setting it on Error and storing an Order Error with the message “Order item line for refund row line {{ID}} needs to be on status ”acknowledged”“ (**v1.3**)
Once we’ve determined we need to send an update we need to use the following:
Send a “Cancelled” status update for any of the ItemIDs in the refund rows.
If we fail to upload the file on the FTP we should :
- Put the status of the Order Payment on “error”
- Store a message with type “Refund” and severity “Error” in the table Order Error with the corresponding message too