Marketplaces / ASOS - Technical Scope / ASOS Order Management / ASOS - Order Download

ASOS - Order Download

Summary of Changes: (The purpose of this table is to keep traceability and Product team to highlight the things that were changed into the scope, based on comments or discussions)

Date Version Name Applied changes
28/09/2022 1.1 Some fields from the mapping changed
05/10/2022 1.2 Note added into row 56 into the mapping table
07/10/2022 1.3 N/A to field on row 6;

N/A to field on row 173; Shipping Country Code & Billing country code notes updated based on raised bug (row 16 & row 33 in mapping table). | | 09/10/2022 | 1.4 | | Item Price need to be divided by quantity | | 17/10/2022 | 1.5 | Bogomil Pavlov | Status flow added, description of the Acknowledge flag | | 20/10/2022 | 1.6 | Bogomil Pavlov | Incorporate logic for can_refund and can_cancel fields | | 09/12/2022 | 1.7 | Bogomil Pavlov | Logic for downloading shipped orders added | | 07.02.2023 | 1.8 | Bogomil Pavlov | Updated mapping for order item status | | 09.03.2023 | 1.9 | Bogomil Pavlov | Add mapping for the phone numbers when downloading orders | | 31.01.2024 | 2.0 | Milen Markov | Amend the tool status change when not all the products are ‘rejected’ | | 15.02.2024 | 2.1 | Hristiyan Georgiev | Added logic for cancelled/refunded items in modified orders download | | 29.02.2024 | 2.2 | Hristiyan Georgiev | Marketplace Closed Status handle changes |

The purpose of this page is to give good understanding of how we will download orders from ASOS marketplace.

As mentioned on summary pages, ASOS is MIRAKL type integration . We are able to use most of the code we already have for Catch, Secret Sales, Decathlon and the basic logic.

The specific for MIRAKL type of integrations in regards to orders flow is that we need to separate the cron which download the orders into 1 cron which will download and store in Hemi the New orders, and another one, which need to download again new orders BUT to update the statuses and all related orders information to already stored orders.

Note: For easier reading, above mentioned crons will be described separately.

Sales Tax Group Marketplace VAT Group Internal VAT Group
Orders >Total Sales Tax Orders > Total Marketplace VAT Orders > Total VAT
Orders >Total Shipping Sales Tax Orders > Total Shipping Marketplace VAT Orders > Total Shipping VAT
Product In Order > Item Sales Tax Price Product in Order > Marketplace VAT Item Price Product In Order > Vat Item Price
Product In Order > Sales Tax Percent Product in Order > Marketplace VAT Percent Product In Order > Vat Percent
Product In Order > Item Shipping Cost Sales Tax Product in Order > Marketplace VAT Item Shipping Cost Product In Order > Vat Item Shipping Cost
  • Get New Orders

To download orders, we will use GET OR11 - List orders. The first run will check for new orders in the last 90 days and afterwards we need to get the date from last_date_run table and filter orders using parameter:

start_date: {last_date_run - 1 hours} date format: 2022-03-25T11:02:04Z

API Call: GET OR11 - List orders

Docs: https://asosuk-dev.mirakl.net/help/api-doc/seller/mmp.html#OR11

{
    "orders": [
          {
            "acceptance_decision_date": null,
            "can_cancel": true,
            "can_shop_ship": true,
            "channel": {
                "code": "GB",
                "label": "United Kingdom"
            },
            "commercial_id": "Order_25082022-5",
            "created_date": "2022-08-25T11:06:29Z",
            "currency_iso_code": "GBP",
            "customer": {
                "billing_address": {
                    "city": "London",
                    "company": null,
                    "country": "GBR",
                    "country_iso_code": "GBR",
                    "firstname": "smith",
                    "lastname": "Taylor",
                    "phone": "string",
                    "state": null,
                    "street_1": "113 MacDougal Street",
                    "street_2": null,
                    "zip_code": "E14 5AB"
                },
                "civility": null,
                "customer_id": "Customer_id_001",
                "firstname": "Smith",
                "lastname": "Taylor",
                "locale": null,
                "shipping_address": {
                    "additional_info": null,
                    "city": "London",
                    "company": null,
                    "country": "GBR",
                    "country_iso_code": "GBR",
                    "firstname": "smith",
                    "lastname": "Taylor",
                    "phone": "string",
                    "state": null,
                    "street_1": "113 MacDougal Street",
                    "street_2": null,
                    "zip_code": "E14 5AB"
                }
            },
            "customer_debited_date": null,
            "customer_directly_pays_seller": false,
            "customer_notification_email": "rmsbxawrxps.n3xi3gl9f@dev.notification.mirakl.net",
            "delivery_date": null,
            "fulfillment": {
                "center": {
                    "code": "DEFAULT"
                }
            },
            "has_customer_message": false,
            "has_incident": false,
            "has_invoice": false,
            "last_updated_date": "2022-08-29T15:00:07Z",
            "leadtime_to_ship": 5,
            "order_additional_fields": [],
            "order_id": "Order_25082022-5-A",
            "order_lines": [
                {
                    "can_refund": false,
                    "cancelations": [],
                    "category_code": "accessories",
                    "category_label": "Accessories",
                    "commission_fee": 1.20,
                    "commission_rate_vat": 0.0000,
                    "commission_taxes": [
                        {
                            "amount": 0.00,
                            "code": "TAXZERO",
                            "rate": 0.0000
                        }
                    ],
                    "commission_vat": 0.00,
                    "created_date": "2022-08-25T11:06:29Z",
                    "debited_date": null,
                    "description": "test1",
                    "last_updated_date": "2022-08-25T11:06:29Z",
                    "offer_id": 2006,
                    "offer_sku": "test123456",
                    "offer_state_code": "11",
                    "order_line_additional_fields": [],
                    "order_line_id": "Order_25082022-5-A-1",
                    "order_line_index": 1,
                    "order_line_state": "SHIPPING",
                    "order_line_state_reason_code": null,
                    "order_line_state_reason_label": null,
                    "price": 10.00,
                    "price_additional_info": "Price including taxes",
                    "price_amount_breakdown": {
                        "parts": [
                            {
                                "amount": 10.00,
                                "commissionable": true,
                                "debitable_from_customer": true,
                                "payable_to_shop": true
                            }
                        ]
                    },
                    "price_unit": 5.00,
                    "product_medias": [],
                    "product_sku": "8720245248259",
                    "product_title": "Test4",
                    "promotions": [],
                    "quantity": 2,
                    "received_date": null,
                    "refunds": [],
                    "shipped_date": null,
                    "shipping_price": 2.00,
                    "shipping_price_additional_unit": null,
                    "shipping_price_amount_breakdown": {
                        "parts": [
                            {
                                "amount": 2.00,
                                "commissionable": true,
                                "debitable_from_customer": true,
                                "payable_to_shop": true
                            }
                        ]
                    },
                    "shipping_price_unit": null,
                    "shipping_taxes": [],
                    "taxes": [],
                    "total_commission": 1.20,
                    "total_price": 12.00
                }
            ],
            "order_state": "SHIPPING",
            "order_state_reason_code": null,
            "order_state_reason_label": null,
            "order_tax_mode": "TAX_INCLUDED",
            "paymentType": null,
            "payment_type": null,
            "payment_workflow": "NO_CUSTOMER_PAYMENT_CONFIRMATION",
            "price": 10.00,
            "promotions": {
                "applied_promotions": [],
                "total_deduced_amount": 0
            },
            "quote_id": null,
            "shipping_carrier_code": null,
            "shipping_company": null,
            "shipping_deadline": "2022-08-30T11:06:29.692Z",
            "shipping_price": 2.00,
            "shipping_pudo_id": null,
            "shipping_tracking": null,
            "shipping_tracking_url": null,
            "shipping_type_code": "STD",
            "shipping_type_label": "Standard",
            "shipping_zone_code": "GBR",
            "shipping_zone_label": "United Kingdom",
            "total_commission": 1.20,
            "total_price": 12.00
        }
      ]
    }

Mapping:

ASOS Field ASOS Notes Integration Required Hemi Field Hemi note
1 orders List of orders N/A
2 acceptance_decision_date The date where the shop decided to accept or refuse the order. Null when the order was automatically refused or accepted.
date-time N/A
3 can_cancel Indicate if the order can be cancelled.
boolean We will use this field to check before each refund/cancellation which request to make OR28 or OR30
4 can_shop_ship Indicates if shops can or cannot ship orders
boolean N/A
5 channel The channel of the commercial's order N/A
6 code Channel code N/A
7 label Channel label
8 commercial_id Commercial order's identifier
9 created_date Order's creation date
2022-08-25T11:06:29Z Order > Order Created Time
10 currency_iso_code Shop's currency (ISO format)
One of: AED, ARS, AUD, BGN, BHD, BRL, CAD, CHF, CLP, CNY, COP, CZK, DKK, EGP, EUR, GBP, HKD, HRK, HUF, ILS, INR, JOD, JPY, KES, KRW, KWD, LKR, MXN, MYR, NGN, NOK, NZD, OMR, PEN, PHP, PKR, PLN, RON, RSD, RUB, SAR, SEK, SGD, TND, TRY, THB, TWD, UAH, USD, UYU, VND, ZAR Order > Order Currency
11 customer Information of the customer who ordered
12 billing_address Customer’s billing address
13 city Address city Orders > Billing City Name
14 company Company of the person associated with the address Orders >Billing Details > Company Name
15 country Address country Orders > Billing Country Name
16 country_iso_code Orders > Billing Country Code As we store in Hemi 2 letter code, we should convert the value from MIRAKL (3letted code) into 2 letter code and store it in Hemi.
17 firstname First name of the person associated with the address Orders > Billing Name Concatenate with “lastname” with a single space between them
18 lastname Last name of the person associated with the address Orders > Billing Name Concatenate with “firstname” with a single space between them
19 phone Orders > Billing Phone
20 state Address state Orders > Billing State Province
21 street_1 First information line of the address street Orders > Billing Street 1
22 street_2 Second information line of the address street Orders > Billing Street 2
23 zip_code Address zip code Orders > Billing Postal Code
24 civility Civility of the person associated with the address N/A
25 customer_id Customer's identifier Order > Buyer User ID
26 firstname Customer contact's firstname N/A
27 lastname Customer contact's lastname N/A
28 locale Customer contact's locale N/A
29 shipping_address Customer's Shipping address
30 additional_info Additional information for the shipping address
31 city Address city Orders > Shipping City
32 company Company of the person associated with the address N/A
33 country Address country Orders > Shipping Country Name
34 country_iso_code Orders > Shipping Country Code As we store in Hemi 2 letter code, we should convert the value from MIRAKL (3letted code) into 2 letter code and store it in Hemi.
35 firstname First name of the person associated with the address Orders > Shipping Buyer Name Concatenate with “lastname” with a single space between them
36 lastname Last name of the person associated with the address Orders > Shipping Buyer Name Concatenate with “firstname” with a single space between them
37 phone Orders > Shipping Phone
38 state Orders > Shipping State Province
39 street_1 First information line of the address street Orders > Shipping Street 1
40 street_2 Second information line of the address street Orders > Shipping Street 2
41 zip_code Address zip code Orders > Shipping Postal Code
42 customer_debited_date The payment's date of the order by the customer Orders > Order Paid Time We will store UNIX format in Hemi but we need to display Human readable format into the UI
43 customer_directly_pays_seller True if order is paid directly to seller. False otherwise. N/A
44 customer_notification_email Anonymized customer email usable for notifications that do not expect an answer Order > Buyer mail
45 delivery_date Expected order delivery date N/A
46 fulfillment Fulfillment information N/A
47 center Fulfillment center code N/A
48 code Center code N/A
49 has_customer_message Indicate if the customer has sent a message related to this order N/A
50 has_incident Indicate if order has incident on at least one order line N/A
51 has_invoice Is an invoice available for this order N/A
52 last_updated_date Order's last updated date N/A
53 leadtime_to_ship Order's lead time to ship, in calendar days.
Deprecated N/A
54 order_additional_fields Order's additional fields N/A
55 order_id Order's identifier Order >Marketplace Order ID
56 order_lines Order lines
57 can_refund Indicate whether the order line full amount can be refunded We will use this field to check before each refund/cancellation which request to make OR28 or OR30
58 cancelations List of the cancellations N/A *Note:** Please note here we will receive the same information as we receive into the refund node (under row 94)
59 category_code Category code of the product associated with the order line N/A
60 category_label Category label of the product associated with the order line N/A
61 commission_fee Order line's commission fee Orders > Marketplace Fee We need to sum all order line commissions and store them on order level
62 commission_rate_vat Deprecated N/A
63 commission_taxes Commission taxes N/A
64 amount N/A
65 code N/A
66 rate N/A
67 commission_vat Deprecated N/A
68 created_date Order line's creation date N/A
69 debited_date Order line's debited date N/A
70 description Order line's description N/A
71 last_updated_date Order line's last updated date N/A
72 offer_id Associated offer's id Product in Order > Channel Item ID
73 offer_sku Associated offer sku (this is the sku of the offer defined by the shop) Product in Order > SKU
74 offer_state_code State of the offer associated with the order line N/A
75 order_line_additional_fields List of additional fields N/A
76 order_line_id Order line's identifier Product in Order > Item Order Line ID
77 order_line_index Order line's index in the order N/A
78 order_line_state Order line's state

STAGING, WAITING_ACCEPTANCE, WAITING_DEBIT, WAITING_DEBIT_PAYMENT, SHIPPING, SHIPPED, TO_COLLECT, RECEIVED, CLOSED, REFUSED, CANCELED, INCIDENT_OPEN, REFUNDED, | | Product in Order > Status | | | 79 | | | order_line_state_reason_code | | | | | | Reason's code of the order line's state | | N/A | | | 80 | | | order_line_state_reason_label | | | | | | Reason's label of the order line's state | | N/A | | | 81 | | | price | | | | | | Order line's price without shipping price | | Product in Order > Item Price / Product In Order > Quantity | | | 82 | | | price_additional_info | | | | | | Price's additional information of the offer | | N/A | | | 83 | | | price_amount_breakdown | | | | | | The breakdown of the price, only available when advanced features are enabled | | N/A | | | 84 | | | | parts | | | | | The parts which constitute the total amount. Each part can have different invoicing rules. The sum of the amount of each part is equal to the total amount. There is at least one part and maximum two parts. | | N/A | | | 85 | | | | | amount | | | | Part's amount. The sum of each part's amount is equal to the total amount. | | N/A | | | 86 | | | | | commissionable | | | | Should this amount be applied to the sellers commissions calculation. | | N/A | | | 87 | | | | | debitable_from_customer | | | | Should this amount be debited to the customer. If true, the amount is taken into account when generating the debit file. If false, the amount is not taken into account when generating the debit file. | | N/A | | | 88 | | | | | payable_to_shop | | | | Should this amount be paid to the shop. If true, the amount is taken into account when generating the shop payment voucher. If false, the amount is not taken into account when generating the shop payment voucher. | | N/A | | | 89 | | | price_unit | | | | | | Unit price for the offer associated with the order line | | N/A | | | 90 | | | product_medias | | | | | | Media URL | | N/A | | | 91 | | | product_sku | | | | | | Sku of the product associated with the order line | | N/A | | | 92 | | | product_title | | | | | | Title of the product associated with the order line | | Product in Order > Item Title | | | 93 | | | promotions | | | | | | List of promotions | | N/A | | | 94 | | | quantity | | | | | | Product's quantity for the order line | | Product in Order > Quantity | | | 95 | | | received_date | | | | | | Product's date of receipt | | N/A | | | 96 | | | refunds | | | | | | List of the refunds | | | Order Payment with type 'Refund” if there are details in the refund node we will need to create a new refund row. | | 97 | | | | amount | | | | | Refund's amount | | Order Refund row > Amount | | | 98 | | | | amount_breakdown | | | | | | | N/A | | | 99 | | | | | parts | | | | | | N/A | | | 100 | | | | | | amount | | | | | N/A | | | 101 | | | | | | commissionable | | | | | N/A | | | 102 | | | | | | debitable_from_customer | | | | | N/A | | | 103 | | | | | | payable_to_shop | | | | | N/A | | | 104 | | | | commission_amount | | | | | Refund's commission amount | | N/A | | | 105 | | | | commission_tax_amount | | | | | Refund's commission taxes | | N/A | | | 106 | | | | commission_taxes | | | | | | | N/A | | | 107 | | | | | amount | | | | | | N/A | | | 108 | | | | | code | | | | | | N/A | | | 109 | | | | commission_total_amount | | | | | | | N/A | | | 110 | | | | created_date | | | | | Refund's creation date | | Order Refund row > Payment Date | | | 111 | | | | id | | | | | Refund's id | | Order Payment > Transaction ID | If we have same Transaction IDs in the response we will need to group them in one single payment row with type=refund

We need to have the same logic also when we are downloading refund from MIRAKL and compare it to the transaction id.

e.g: Transaction id = 2346-3563-1563 This means there are 3 refunds on the order and we store then in one payment row with 3 refund rows however the transaction id is constructed with all MIRAKL refund ids for the order “2346“, “3563“, “1563“ so when we are downloading the order we need to compare all refund ids. | | 112 | | | | purchase_information | | | | | | | N/A | | | 113 | | | | | purchase_commission_on_price | | | | | | N/A | | | 114 | | | | | purchase_commission_on_shipping | | | | | | N/A | | | 115 | | | | | purchase_price | | | | | | N/A | | | 116 | | | | | purchase_shipping_price | | | | | | N/A | | | 117 | | | | quantity | | | | | The quantity of products canceled (This quantity is informative only) | | N/A | Based on the details added in the refund row. | | 118 | | | | reason_code | | | | | Reason's code of the refund | | Order Payment > Reason | Based on the ID we need to store the relevant reason "code": "15" = "Out of stock" "code": "16"= "Cancelled by the client prior to shipping" "code": "17" = "Item returned" "code": "18"= "Item not received" "code": "19" = "Agreement found with the vendor" | | 119 | | | | shipping_amount | | | | | Refund's shipping amount | | Order Refund Row > Amount | This applies for the row with type “shipping“ | | 120 | | | | shipping_amount_breakdown | | | | | | | N/A | | | 121 | | | | | parts | | | | | | N/A | | | 122 | | | | | | amount | | | | | Order Refund Row > Amount | This applies for the row with type “shipping“ | | 123 | | | | | | commissionable | | | | | N/A | | | 124 | | | | | | debitable_from_customer | | | | | N/A | | | 125 | | | | | | payable_to_shop | | | | | N/A | | | 126 | | | | shipping_taxes | | | | | The taxes on the shipping price | | | | | 127 | | | | | amount | | | | Tax amount | | Order Refund Row > Refund VAT | This applies for the row with type “shipping“ | | 128 | | | | | | amount_breakdown | | | | | N/A | | | 129 | | | | | | | parts | | | | N/A | | | 130 | | | | | | | | amount | | | N/A | | | 131 | | | | | | | | commissionable | | | N/A | | | 132 | | | | | | | | debitable_from_customer | | | N/A | | | 133 | | | | | | | | payable_to_shop | | | N/A | | | 134 | | | | | | code | | | | | N/A | | | 135 | | | | | | purchase_tax | | | | | N/A | | | 136 | | | | | | | purchase_amount | | | | N/A | | | 137 | | | | | | rate | | | | | N/A | | | 138 | | | | | state | | | | Refund's state WAITING_REFUND, WAITING_REFUND_PAYMENT, REFUNDED | | N/A | | | 139 | | | | | taxes | | | | | | | | | 140 | | | | | | amount | | | | | Order Refund Row > Refund VAT | This applies for the row with type “item“ | | 141 | | | | | | amount_breakdown | | | | | N/A | | | 142 | | | | | | | parts | | | | N/A | | | 143 | | | | | | | | amount | | | N/A | | | 144 | | | | | | | | commissionable | | | N/A | | | 145 | | | | | | | | debitable_from_customer | | | N/A | | | 146 | | | | | | | | payable_to_shop | | | N/A | | | 147 | | | | | | code | | | | | N/A | | | 148 | | | | | | purchase_tax | | | | | N/A | | | 149 | | | | | | | purchase_amount | | | | N/A | | | 150 | | | | | | rate | | | | | N/A | | | 151 | | | shipped_date | | | | | | | | Orders > Shipping Shipped Date | | | 152 | | | shipping_price | | | | | | Total price of the order line's shipping price | | Product in Order > Item Shipping Cost | | | 153 | | | shipping_price_additional_unit | | | | | | | | N/A | | | 154 | | | shipping_price_amount_breakdown | | | | | | | | | | | 155 | | | | parts | | | | | | | | | | 156 | | | | | amount | | | | | | Product in Order >Item shipping tax cost | | | 157 | | | | | commissionable | | | | | | N/A | | | 158 | | | | | debitable_from_customer | | | | | | N/A | | | 159 | | | | | payable_to_shop | | | | | | N/A | | | 160 | | | shipping_price_unit | | | | | | Deprecated | | | | | 161 | | | shipping_taxes | | | | | | List of taxes applied on shipping charges | | | | | 162 | | | | amount | | | | | Tax amount | | Order Refund Row > Refund VAT | This applies for the row with type “shipping“ | | 163 | | | | amount_breakdown | | | | | | | N/A | | | 164 | | | | | parts | | | | | | N/A | | | 165 | | | | | | amount | | | | | N/A | | | 166 | | | | | | commissionable | | | | | N/A | | | 167 | | | | | | debitable_from_customer | | | | | N/A | | | 168 | | | | | | payable_to_shop | | | | | N/A | | | 169 | | | taxes | | | | | | | | | | | 170 | | | total_commission | | | | | | | | | | | 171 | | | total_price | | | | | | | | | | | 172 | | order_state | | | | | | | Order's state STAGING, WAITING_ACCEPTANCE, WAITING_DEBIT, WAITING_DEBIT_PAYMENT, SHIPPING, SHIPPED, TO_COLLECT, RECEIVED, CLOSED, REFUSED, CANCELED, INCIDENT_OPEN, REFUNDED, | | Order > Order Status | Note: You can find more detailed explanations & mapped MP statuses to Hemi statuses under “mapping” table. | | 173 | | order_state_reason_code | | | | | | | Reason's code of the order state | | N/A | | | 174 | | order_state_reason_label | | | | | | | Reason's label of the order state | | N/A | | | 175 | | order_tax_mode | | | | | | | Please note: In case there is no tax, the prices will show the same amount in TAX_EXCLUDED and TAX_INCLUDED mode. The tax mode is only useful if taxes are specified in the order. Possible values: • TAX_EXCLUDED: the price fields (price, unit price, shipping price, cancellation amount, refund amount and order total prices) are expressed without tax (taxes should be added to these prices in order to get the full amount including taxes). • TAX_INCLUDED: the price fields include the tax amount. | | N/A | | | 176 | | paymentType | | | | | | | Deprecated | | | | | 177 | | payment_type | | | | | | | he payment's type used by the customer to pay this order | | Order > Order Payment Method | | | 178 | | payment_workflow | | | | | | | The payment workflow followed by the order PAY_ON_ACCEPTANCE, PAY_ON_DELIVERY, PAY_ON_DUE_DATE, PAY_ON_SHIPMENT, NO_CUSTOMER_PAYMENT_CONFIRMATION | | | PAY_ON_ACCEPTANCE PAY_ON_DELIVERY PAY_ON_DUE_DATE PAY_ON_SHIPMENT NO_CUSTOMER_PAYMENT_CONFIRMATION | | 179 | | price | | | | | | | Order's price (sum of order line's price) | | Order > Оrder Subtotal Аmount | without shipping cost | | 180 | | promotions | | | | | | | | | | | | 181 | | | applied_promotions | | | | | | The promotions applied on this order | | Order > Discount Type | | | 182 | | | total_deduced_amount | | | | | | The total amount deduced on this order thanks to the promotions | | Order > Discount | | | 183 | | quote_id | | | | | | | Quote's id from which the order has been placed, or null if it was not from a quote | | N/A | | | 184 | | shipping_carrier_code | | | | | | | Shipping carrier code (associated with the Shipping company label) | | N/A | | | 185 | | shipping_company | | | | | | | Shipping company | | Order Shipment > Carrier AND Orders > Carrier | | | 186 | | shipping_deadline | | | | | | | Order's shipping deadline | | N/A | | | 187 | | shipping_price | | | | | | | Order's shipping price (sum of order line's shipping price) | | Order > Shipping Service Cost | | | 188 | | shipping_pudo_id | | | | | | | PickUp DropOff (PUDO) point identifier | | N/A | | | 189 | | shipping_tracking | | | | | | | Shipping tracking | | Order Shipment > Tracking Number AND Orders > Tracking Number | | | 190 | | shipping_tracking_url | | | | | | | Shipping tracking url | | Order Shipment > Tracking URL | | | 191 | | shipping_type_code | | | | | | | Code of shipping's type | | N/A | | | 192 | | shipping_type_label | | | | | | | Label of shipping's type | | Order > Shipping Service| | | 193 | |shipping_zone_code| | | | | | | Code of shipping's zone | | N/A | | | 194 | |shipping_zone_label| | | | | | | Label of shipping's zone | | N/A | | | 195 | |total_commission| | | | | | | Order's total commission (sum of the order line's total commission) | | Order> Total Fee | | | 196 | |total_price` | | | | | | | otal order's price (sum of the order's price and the order's shipping price). | | Order > Оrder Тotal Аmount | |

Get Orders cron should download orders according to their marketplace status:

MP Status Hemi Status
1 STAGING Test Orders
2 WAITING_ACCEPTANCE Pending
3 WAITING_DEBIT Pending
4 WAITING_DEBIT_PAYMENT Pending
5 SHIPPING Ready for Shipping
6 SHIPPED Shipped
7 TO_COLLECT Ready for Shipping
8 RECEIVED Shipped
9 CLOSED <v2.2>N/A (We do nothing just update MP Status).

There is only one edge case and this is when we have Orders > Status = Ready For Shipping and for some reason we received Orders > Marketplace Status = Closed. In this case Closed will be last MIRAKL status and we wont know if the order is actually shipped or cancelled thus we have to check the if all order items are refunded to treat it as Orders > Status = Cancelled else Orders > Status = Shipped

The other case is when we download an order directly on Closed status then we have to check again the cancelations and refunds on the order items

In order to check if there is a cancellation or refund we can use the following nodes: order_lines > cancelationsorder_lines >refunds There we can check for each order item what refunds or cancellations we have.</v2.2> | | 10 | REFUSED | Cancelled | | 11 | CANCELED | Cancelled | | 12 | INCIDENT_OPEN | Operators and customers can open an incident on an order whenever the order status allows an incident to be opened: • Shipping in Progress, • Shipped, • Received. So we will need to make sure we update the Order Item Marketplace Status because the incidents are per order line. If the order is not yet paid if the buyer opens an incident then the seller wont get paid. | | 13 | REFUNDED | Cancelled |

Depend on which status we will receive the order we will need to follow different steps below is described the success flow however we might have cases where we are receiving order directly on Shipping status or even Shipped, thus we need to make sure depends on the status we are receiving the correct actions are performed. For example we are now incorporating the Order Acknowledge flag for MIRAKLs and if we download an order which is already accepted we need to update it as “Completed” otherwise by default each new order is downloaded with “Pending” statuses

If we have a new order which is already shipped we need to store all the relevant details like the order shipments, shipping info and the right statuses. If we have an order which is already stored in Hemi but is not shipped yet and we receive order updated we are updating the order with status shipped we still need to check if the order shipment is created, the shipping information is populated and the statuses are updated. If we have an order which is already stored in Hemi but is not shipped yet however we have added the order shipment and the shipping information and we receive order updated we are updating the order with status shipped without updating any other information in the shipping details

Success Flow:

  1. MP status = WAITING_ACCEPTANCE; Tool status = Pending and there wont be payment row yet;
  2. MP status = WAITING_DEBIT; Tool status = Pending and we create a payment row with status Pending;
  3. MP status = WAITING_DEBIT_PAYMENT; Tool status = Pending and we create a payment row with status Pending;
  4. MP status = SHIPPING; Tool status = Ready For Shipping and the payment row status is Completed;
  5. MP status = SHIPPED; Tool status = Shipped and the payment row status is Completed;
  6. MP status = RECEIVED; Tool status = Shipped and the payment row status is Completed;
  • Get Modified Orders

Basically there is no difference in terms of used API call and End point compared with Get new orders.

API Call: GET /api/orders

API Docs: https://decathlonbelgium-preprod.mirakl.net/help/api-doc/seller/mmp.html#OR11

Parameter Value Required Comment
order_id Order identifier Yes A comma-separated list of order's identifiers+

We need to be able to update the orders according to their status on the Marketplace. We have to call each order in the last 30 days which are with statuses different from Closed , Canceled and Shipped. (Final statuses)

Get Modified orders will ONLY update existing orders in Hemi but not create new orders. This means depends on the status of the order we will have to create the payment row, update the statuses, delivery details etc.

<v2.1> If there is a refund on a product in ASOS we don’t want to update the Product On Order > Item Price and Product On Order > Quantity in Hemi. So we need to start skipping the check for price and quantity with the modified orders download. <v2.1> The successful case will be get orders will get all new orders from the last 60 min and they will be with Waiting Acceptance status.  Then we will accept the order and Get Modified Orders will update the status of the order as WAITING_DEBIT_PAYMENT Then Get Modified will update to the following status which is Shipping and will have to download the delivery and payment data.

Hemi Status Transition Comment
Pending From “Pending“ we can move to any other Hemi Status Pending status is indicating that something need to happen on the order like clear debit, waiting acceptance etc.
Incomplete From “Incomplete” we can move to
”Ready For Shipping”, “Shipped“, “Cancelled“ Incomplete status is used when we have address missing on the order, also if all the products in the order are ‘rejected’.

<v2.0> - If there is at least 1 product that is not ‘rejected’ but there is another ‘rejected’ product, we keep the Hemi order status to what it is and do not change it to ‘Incomplete’ </v2.0> | | Ready For Shipping | From ”Ready For Shipping” we can move to “Shipped“ or “Cancelled“ only | Ready For Shipping indicates the order can be shipped successfully have all required information stored and payment cleared | | Shipped | From “Shipped“ we can move to “Cancelled“ | Shipped indicating that the order has been dispatched. | | Cancelled | “Cancelled“ is our final status. | Cancelled is the Hemi final status and we cannot revert back or move forward. |

Note: Payload and mapping is the same as Get New Orders.

Is this article helpful?
0 0 0