B&Q - Get Orders
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.0 | Initial Version | |
09/12/2022 | 1.1 | Bogomil Pavlov | Logic for downloading shipped orders added |
12/01/2022 | 1.2 | Bogomil Pavlov | Payload and mapping updated with real test order and the changes are left in red |
07.02.2023 | 1.3 | Bogomil Pavlov | Updated mapping for order item status |
07.03.2023 | 1.4 | Bogomil Pavlov | Add mapping for the phone numbers when downloading orders |
The purpose of this page is to give good understanding of how we will download orders from B&Q marketplace.
As mentioned on summary pages, B&Q is MIRAKL type integration . We are able to use most of the code we already have for Catch, Secret Sales, Decathlon, ASOS and the basic logic.
The specific for MIRAKL type of integrations in regards to orders flow is that we need to single cron which download the orders in Hemi the and also update the statuses and all related orders information to already stored orders.
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
{
"acceptance_decision_date": null,
"can_cancel": false,
"can_shop_ship": true,
"channel": {
"code": "BQ_UK",
"label": "B&Q UK"
},
"commercial_id": "Order_00244",
"created_date": "2023-01-11T16:08:38Z",
"currency_iso_code": "GBP",
"customer": {
"billing_address": {
"city": "London",
"civility": "M",
"company": null,
"country": "UK",
"country_iso_code": "GBR",
"firstname": "John",
"lastname": "Smith",
"phone": "string",
"state": null,
"street_1": "113 MacDougal Street",
"street_2": "1st floor",
"zip_code": "SW19 5NR"
},
"civility": "M",
"customer_id": "Customer_id_001",
"firstname": "Smith",
"lastname": "Taylor",
"locale": null,
"shipping_address": {
"additional_info": null,
"city": "London",
"civility": "M",
"company": null,
"country": "UK",
"country_iso_code": "GBR",
"firstname": "John",
"lastname": "Smith",
"phone": "string",
"state": null,
"street_1": "113 MacDougal Street",
"street_2": "1st floor",
"zip_code": "SW19 5NR"
}
},
"customer_debited_date": "2023-01-11T16:22:13.881Z",
"customer_directly_pays_seller": false,
"customer_notification_email": "rki9eobfxfs.j3uj5t6l1@preprod.notification.mirakl.net",
"delivery_date": {
"earliest": "2023-01-16T16:22:13.850Z",
"latest": "2023-01-23T16:22:13.850Z"
},
"fulfillment": {
"center": {
"code": "DEFAULT"
}
},
"fully_refunded": false,
"has_customer_message": false,
"has_incident": false,
"has_invoice": false,
"invoice_details": {
"document_details": [
{
"format": "PDF"
}
],
"payment_terms": {
"days": 10,
"type": "NET"
}
},
"last_updated_date": "2023-01-11T16:22:14Z",
"leadtime_to_ship": 5,
"order_additional_fields": [
],
"order_id": "Order_00244-A",
"order_lines": [
{
"can_refund": true,
"cancelations": [
],
"category_code": "PIM_11060",
"category_label": "Cooker Hood & Carbon Filters",
"commission_fee": 80.00,
"commission_rate_vat": 20.0000,
"commission_taxes": [
{
"amount": 16.00,
"code": "TAXDEFAULT",
"rate": 20.0000
}
],
"commission_vat": 16.00,
"created_date": "2023-01-11T16:08:38Z",
"debited_date": "2023-01-11T16:22:13Z",
"description": null,
"last_updated_date": "2023-01-11T16:22:13Z",
"offer_id": 2167,
"offer_sku": "S2038",
"offer_state_code": "11",
"order_line_additional_fields": [
],
"order_line_id": "Order_00244-A-1",
"order_line_index": 1,
"order_line_state": "SHIPPING",
"order_line_state_reason_code": null,
"order_line_state_reason_label": null,
"price": 1000.00,
"price_additional_info": null,
"price_amount_breakdown": {
"parts": [
{
"amount": 1000.00,
"commissionable": true,
"debitable_from_customer": true,
"payable_to_shop": true
}
]
},
"price_unit": 1000.00,
"product_medias": [
{
"media_url": "/media/product/image/9577b753-57e3-4949-925a-cd5d29dd58b2",
"mime_type": "JPG",
"type": "LARGE"
},
{
"media_url": "/media/product/image/a2b3ac60-c6c6-4197-a8de-045a6af01499",
"mime_type": "JPG",
"type": "MEDIUM"
},
{
"media_url": "/media/product/image/e3f4ebdd-64c2-46f0-8c79-221ade7a477c",
"mime_type": "JPG",
"type": "SMALL"
}
],
"product_sku": "5059120392439",
"product_title": "3 x Universal Cooker Hood Metal Grease Filter 320mm x 320mm",
"promotions": [
],
"quantity": 1,
"received_date": null,
"refunds": [
],
"shipped_date": null,
"shipping_price": 0.00,
"shipping_price_additional_unit": null,
"shipping_price_amount_breakdown": {
"parts": [
{
"amount": 0.00,
"commissionable": true,
"debitable_from_customer": true,
"payable_to_shop": true
}
]
},
"shipping_price_unit": null,
"shipping_taxes": [
],
"taxes": [
],
"total_commission": 96.00,
"total_price": 1000.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": "PAY_ON_ACCEPTANCE",
"price": 1000.00,
"promotions": {
"applied_promotions": [
],
"total_deduced_amount": 0
},
"quote_id": null,
"references": {
"order_reference_for_customer": "ref_customer"
},
"shipping_carrier_code": null,
"shipping_company": null,
"shipping_deadline": "2023-01-16T16:22:13.851Z",
"shipping_price": 0.00,
"shipping_pudo_id": null,
"shipping_tracking": null,
"shipping_tracking_url": null,
"shipping_type_code": "STD",
"shipping_type_label": "Standard",
"shipping_zone_code": "EWSM",
"shipping_zone_label": "England, Wales & Scotland Mainland",
"total_commission": 96.00,
"total_price": 1000.00,
"transaction_date": "2019-04-02T09:45:53.000Z",
"transaction_number": "Trx-00321"
}
Mapping:
B&Q Field | B&Q 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 | N/A | |||||||||||
4 | can_shop_ship |
Indicates if shops can or cannot ship orders | ||||||||||
boolean | N/A | |||||||||||
5 | channel |
The channel of the commercial's order | ||||||||||
6 | code |
Channel code | N/A | |||||||||
7 | label |
Channel label | N/A | |||||||||
8 | commercial_id |
Commercial order's identifier | N/A | |||||||||
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 | civility | N/A | ||||||||||
15 | company |
Company of the person associated with the address | Orders >Billing Details > Company Name | |||||||||
16 | country |
Address country | Orders > Billing Country Name | |||||||||
17 | 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. | |||||||||
18 | firstname |
First name of the person associated with the address | Orders > Billing Name | Concatenate with “lastname” with a single space between them | ||||||||
19 | lastname |
Last name of the person associated with the address | Orders > Billing Name | Concatenate with “firstname” with a single space between them | ||||||||
20 | phone |
Orders > Billing Phone | ||||||||||
21 | state |
Address state | Orders > Billing State Province | |||||||||
22 | street_1 |
First information line of the address street | Orders > Billing Street 1 | |||||||||
23 | street_2 |
Second information line of the address street | Orders > Billing Street 2 | |||||||||
24 | zip_code |
Address zip code | Orders > Billing Postal Code | |||||||||
25 | civility |
Civility of the person associated with the address | N/A | |||||||||
26 | customer_id |
Customer's identifier | Order > Buyer User ID | |||||||||
27 | firstname |
Customer contact's firstname | N/A | |||||||||
28 | lastname |
Customer contact's lastname | N/A | |||||||||
29 | locale |
Customer contact's locale | N/A | |||||||||
30 | shipping_address |
Customer's Shipping address | ||||||||||
31 | additional_info |
Additional information for the shipping address | N/A | |||||||||
32 | city |
Address city | Orders > Shipping City | |||||||||
33 | civility | N/A | ||||||||||
34 | company |
Company of the person associated with the address | N/A | |||||||||
35 | country |
Address country | Orders > Shipping Country Name | |||||||||
36 | 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. | |||||||||
37 | firstname |
First name of the person associated with the address | Orders > Shipping Buyer Name | Concatenate with “lastname” with a single space between them | ||||||||
38 | lastname |
Last name of the person associated with the address | Orders > Shipping Buyer Name | Concatenate with “firstname” with a single space between them | ||||||||
39 | phone |
Orders > Shipping Phone | ||||||||||
40 | state |
Orders > Shipping State Province | ||||||||||
41 | street_1 |
First information line of the address street | Orders > Shipping Street 1 | |||||||||
42 | street_2 |
Second information line of the address street | Orders > Shipping Street 2 | |||||||||
43 | zip_code |
Address zip code | Orders > Shipping Postal Code | |||||||||
44 | 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 | ||||||||
45 | customer_directly_pays_seller |
True if order is paid directly to seller. False otherwise. | N/A | |||||||||
46 | customer_notification_email |
Anonymized customer email usable for notifications that do not expect an answer | Order > Buyer mail | |||||||||
47 | delivery_date |
Expected order delivery date | N/A | |||||||||
48 | earliest | N/A | ||||||||||
49 | latest | N/A | ||||||||||
50 | fulfillment |
Fulfillment information | N/A | |||||||||
51 | center |
Fulfillment center code | N/A | |||||||||
52 | code |
Center code | N/A | |||||||||
53 | fully_refunded | N/A | ||||||||||
54 | has_customer_message |
Indicate if the customer has sent a message related to this order | N/A | |||||||||
55 | has_incident |
Indicate if order has incident on at least one order line | N/A | |||||||||
56 | has_invoice |
Is an invoice available for this order | N/A | |||||||||
57 | invoice_details | N/A | ||||||||||
58 | document_details | N/A | ||||||||||
59 | format | N/A | ||||||||||
60 | payment_terms | N/A | ||||||||||
61 | days | N/A | ||||||||||
62 | type | N/A | ||||||||||
63 | last_updated_date |
Order's last updated date | N/A | |||||||||
64 | leadtime_to_ship |
Order's lead time to ship, in calendar days. | ||||||||||
Deprecated | N/A | |||||||||||
65 | order_additional_fields |
Order's additional fields | N/A | |||||||||
66 | order_id |
Order's identifier | Order >Marketplace Order ID | |||||||||
67 | order_lines |
Order lines | ||||||||||
68 | can_refund |
Indicate whether the order line full amount can be refunded | N/A | |||||||||
69 | 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) | ||||||||
70 | amount |
Refund's amount | Order Refund row > Amount | This applies for the row with type “item“ | ||||||||
71 | amount_breakdown |
N/A | ||||||||||
72 | parts |
N/A | ||||||||||
73 | amount |
N/A | ||||||||||
74 | commissionable |
N/A | ||||||||||
75 | debitable_from_customer |
N/A | ||||||||||
76 | payable_to_shop |
N/A | ||||||||||
77 | commission_amount |
Refund's commission amount | N/A | |||||||||
78 | commission_tax_amount |
Refund's commission taxes | N/A | |||||||||
79 | commission_taxes |
N/A | ||||||||||
80 | amount |
N/A | ||||||||||
81 | code |
N/A | ||||||||||
82 | commission_total_amount |
N/A | ||||||||||
83 | created_date |
Refund's creation date | Order Refund row > Payment Date | |||||||||
84 | id |
Refund's id | Order Payment > Transaction ID | When we are sending cancellation we group the ids into a single refund row but when we are downloading them every id will be a separate payment row 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. |
| 85 | | | | purchase_information
| | | | | | | N/A | |
| 86 | | | | | purchase_commission_on_price
| | | | | | N/A | |
| 87 | | | | | purchase_commission_on_shipping
| | | | | | N/A | |
| 88 | | | | | purchase_price
| | | | | | N/A | |
| 89 | | | | | purchase_shipping_price
| | | | | | N/A | |
| 90 | | | | quantity
| | | | | The quantity of products canceled (This quantity is informative only) | | N/A | Based on the details added in the refund row. |
| 91 | | | | 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" |
| 92 | | | | shipping_amount
| | | | | Refund's shipping amount | | Order Refund Row > Amount | This applies for the row with type “shipping“ |
| 93 | | | | shipping_amount_breakdown
| | | | | | | N/A | |
| 94 | | | | | parts
| | | | | | N/A | |
| 95 | | | | | | amount
| | | | | | |
| 96 | | | | | | commissionable
| | | | | N/A | |
| 97 | | | | | | debitable_from_customer
| | | | | N/A | |
| 98 | | | | | | payable_to_shop
| | | | | N/A | |
| 99 | | | | shipping_taxes
| | | | | The taxes on the shipping price | | | |
| 100 | | | | | amount
| | | | Tax amount | | Order Refund Row > Refund VAT | This applies for the row with type “shipping“ |
| 101 | | | | | | amount_breakdown
| | | | | N/A | |
| 102 | | | | | | | parts
| | | | N/A | |
| 103 | | | | | | | | amount
| | | N/A | |
| 104 | | | | | | | | commissionable
| | | N/A | |
| 105 | | | | | | | | debitable_from_customer
| | | N/A | |
| 106 | | | | | | | | payable_to_shop
| | | N/A | |
| 107 | | | | | | code
| | | | | N/A | |
| 108 | | | | | | purchase_tax
| | | | | N/A | |
| 109 | | | | | | | purchase_amount
| | | | N/A | |
| 110 | | | | | | rate
| | | | | N/A | |
| 111 | | | | | taxes
| | | | | | | |
| 112 | | | | | | amount
| | | | | Order Refund Row > Refund VAT | This applies for the row with type “item“ |
| 113 | | | | | | amount_breakdown
| | | | | N/A | |
| 114 | | | | | | | parts
| | | | N/A | |
| 115 | | | | | | | | amount
| | | N/A | |
| 116 | | | | | | | | commissionable
| | | N/A | |
| 117 | | | | | | | | debitable_from_customer
| | | N/A | |
| 118 | | | | | | | | payable_to_shop
| | | N/A | |
| 119 | | | | | | code
| | | | | N/A | |
| 120 | | | | | | purchase_tax
| | | | | N/A | |
| 121 | | | | | | | purchase_amount
| | | | N/A | |
| 122 | | | | | | rate
| | | | | N/A | |
| 123 | | | category_code
| | | | | | Category code of the product associated with the order line | | N/A | |
| 124 | | | category_label
| | | | | | Category label of the product associated with the order line | | N/A | |
| 125 | | | commission_fee
| | | | | | Order line's commission fee | | Orders > Marketplace Fee | We need to sum all order line commissions and store them on order level |
| 126 | | | commission_rate_vat
| | | | | | Deprecated | | N/A | |
| 127 | | | commission_taxes
| | | | | | Commission taxes | | N/A | |
| 128 | | | | amount
| | | | | | | N/A | |
| 129 | | | | code
| | | | | | | N/A | |
| 130 | | | | rate
| | | | | | | N/A | |
| 131 | | | commission_vat
| | | | | | Deprecated | | N/A | |
| 132 | | | created_date
| | | | | | Order line's creation date | | N/A | |
| 133 | | | debited_date
| | | | | | Order line's debited date | | N/A | |
| 134 | | | description
| | | | | | Order line's description | | N/A | |
| 135 | | | last_updated_date
| | | | | | Order line's last updated date | | N/A | |
| 136 | | | offer_id
| | | | | | Associated offer's id | | Product in Order > Channel Item ID | |
| 137 | | | offer_sku
| | | | | | Associated offer sku (this is the sku of the offer defined by the shop) | | Product in Order > SKU | |
| 138 | | | offer_state_code
| | | | | | State of the offer associated with the order line | | N/A | |
| 139 | | | order_line_additional_fields
| | | | | | List of additional fields | | N/A | |
| 140 | | | order_line_id
| | | | | | Order line's identifier | | Product in Order > Item Order Line ID | |
| 141 | | | order_line_index
| | | | | | Order line's index in the order | | N/A | |
| 142 | | | 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 | |
| 143 | | | order_line_state_reason_code
| | | | | | Reason's code of the order line's state | | N/A | |
| 144 | | | order_line_state_reason_label
| | | | | | Reason's label of the order line's state | | N/A | |
| 145 | | | price
| | | | | | Order line's price without shipping price | | Product in Order > Item Price | Product in Order > Item Price / Product In Order > Quantity |
| 146 | | | price_additional_info
| | | | | | Price's additional information of the offer | | N/A | |
| 147 | | | price_amount_breakdown
| | | | | | The breakdown of the price, only available when advanced features are enabled | | N/A | |
| 148 | | | | 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. | | | |
| 149 | | | | | amount
| | | | Part's amount. The sum of each part's amount is equal to the total amount. | | N/A | |
| 150 | | | | | commissionable
| | | | Should this amount be applied to the sellers commissions calculation. | | N/A | |
| 151 | | | | | 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 | |
| 152 | | | | | 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 | |
| 153 | | | price_unit
| | | | | | Unit price for the offer associated with the order line | | N/A | |
| 154 | | | product_medias
| | | | | | Media URL | | N/A | |
| 155 | | | product_sku
| | | | | | Sku of the product associated with the order line | | N/A | |
| 156 | | | product_title
| | | | | | Title of the product associated with the order line | | Product in Order > Item Title | |
| 157 | | | promotions
| | | | | | List of promotions | | N/A | |
| 158 | | | quantity
| | | | | | Product's quantity for the order line | | Product in Order > Quantity | |
| 159 | | | received_date
| | | | | | Product's date of receipt | | N/A | |
| 160 | | | 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. |
| 161 | | | | amount
| | | | | Refund's amount | | Order Refund row > Amount | This applies for the row with type “Item“ |
| 162 | | | | amount_breakdown
| | | | | | | N/A | |
| 163 | | | | | parts
| | | | | | N/A | |
| 164 | | | | | | amount
| | | | | N/A | |
| 165 | | | | | | commissionable
| | | | | N/A | |
| 166 | | | | | | debitable_from_customer
| | | | | N/A | |
| 167 | | | | | | payable_to_shop
| | | | | N/A | |
| 168 | | | | commission_amount
| | | | | Refund's commission amount | | N/A | |
| 169 | | | | commission_tax_amount
| | | | | Refund's commission taxes | | N/A | |
| 170 | | | | commission_taxes
| | | | | | | N/A | |
| 171 | | | | | amount
| | | | | | N/A | |
| 172 | | | | | code
| | | | | | N/A | |
| 173 | | | | commission_total_amount
| | | | | | | N/A | |
| 174 | | | | created_date
| | | | | Refund's creation date | | Order Refund row > Payment Date | |
| 175 | | | | id
| | | | | Refund's id | | Order Payment > Transaction ID | When we are sending refund we group the ids into a single payment row type refund but when we are downloading them every id will be a separate payment row 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. |
| 176 | | | | purchase_information
| | | | | | | N/A | |
| 177 | | | | | purchase_commission_on_price
| | | | | | N/A | |
| 178 | | | | | purchase_commission_on_shipping
| | | | | | N/A | |
| 179 | | | | | purchase_price
| | | | | | N/A | |
| 180 | | | | | purchase_shipping_price
| | | | | | N/A | |
| 181 | | | | quantity
| | | | | The quantity of products canceled (This quantity is informative only) | | N/A | Based on the details added in the refund row. |
| 182 | | | | 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" |
| 183 | | | | shipping_amount
| | | | | Refund's shipping amount | | Order Refund Row > Amount | This applies for the row with type “shipping“ |
| 184 | | | | shipping_amount_breakdown
| | | | | | | N/A | |
| 185 | | | | | parts
| | | | | | N/A | |
| 186 | | | | | | amount
| | | | | | |
| 187 | | | | | | commissionable
| | | | | N/A | |
| 188 | | | | | | debitable_from_customer
| | | | | N/A | |
| 189 | | | | | | payable_to_shop
| | | | | N/A | |
| 190 | | | | shipping_taxes
| | | | | The taxes on the shipping price | | | |
| 191 | | | | | amount
| | | | Tax amount | | Order Refund Row > Refund VAT | This applies for the row with type “shipping“ |
| 192 | | | | | | amount_breakdown
| | | | | N/A | |
| 193 | | | | | | | parts
| | | | N/A | |
| 194 | | | | | | | | amount
| | | N/A | |
| 195 | | | | | | | | commissionable
| | | N/A | |
| 196 | | | | | | | | debitable_from_customer
| | | N/A | |
| 197 | | | | | | | | payable_to_shop
| | | N/A | |
| 198 | | | | | | code
| | | | | N/A | |
| 199 | | | | | | purchase_tax
| | | | | N/A | |
| 200 | | | | | | | purchase_amount
| | | | N/A | |
| 201 | | | | | | rate
| | | | | N/A | |
| 202 | | | | | state
| | | | Refund's state
WAITING_REFUND, WAITING_REFUND_PAYMENT, REFUNDED | | N/A | |
| 203 | | | | | taxes
| | | | | | | |
| 204 | | | | | | amount
| | | | | Order Refund Row > Refund VAT | This applies for the row with type “item“ |
| 205 | | | | | | amount_breakdown
| | | | | N/A | |
| 206 | | | | | | | parts
| | | | N/A | |
| 207 | | | | | | | | amount
| | | N/A | |
| 208 | | | | | | | | commissionable
| | | N/A | |
| 209 | | | | | | | | debitable_from_customer
| | | N/A | |
| 210 | | | | | | | | payable_to_shop
| | | N/A | |
| 211 | | | | | | code
| | | | | N/A | |
| 212 | | | | | | purchase_tax
| | | | | N/A | |
| 213 | | | | | | | purchase_amount
| | | | N/A | |
| 214 | | | | | | rate
| | | | | N/A | |
| 215 | | | shipped_date
| | | | | | | | Orders > Shipping Shipped Date | |
| 216 | | | shipping_price
| | | | | | Total price of the order line's shipping price | | Product in Order > Item Shipping Cost | |
| 217 | | | shipping_price_additional_unit
| | | | | | | | N/A | |
| 218 | | | shipping_price_amount_breakdown
| | | | | | | | N/A | |
| 219 | | | | parts
| | | | | | | | |
| 220 | | | | | amount
| | | | | | Product in Order >Item shipping tax cost | |
| 221 | | | | | commissionable
| | | | | | N/A | |
| 222 | | | | | debitable_from_customer
| | | | | | N/A | |
| 223 | | | | | payable_to_shop
| | | | | | N/A | |
| 224 | | | shipping_price_unit
| | | | | | Deprecated | | | |
| 225 | | | shipping_taxes
| | | | | | List of taxes applied on shipping charges | | N/A | |
| 226 | | | | amount
| | | | | Tax amount | | Product in Order > Marketplace VAT Item Shipping Cost | We sum all order item Shipping Tax Amounts and store them in Orders > Total Shipping Marketplace VAT |
| 227 | | | | amount_breakdown
| | | | | | | N/A | |
| 228 | | | | | parts
| | | | | | N/A | |
| 229 | | | | | | amount
| | | | | N/A | |
| 230 | | | | | | commissionable
| | | | | N/A | |
| 231 | | | | | | debitable_from_customer
| | | | | N/A | |
| 232 | | | | | | payable_to_shop
| | | | | N/A | |
| 233 | | | taxes
| | | | | | | | | |
| 234 | | | | amount | | | | | | | Product in Order > Marketplace VAT Item Price | We sum all order item Tax Amounts and store them in Orders > Total Marketplace VAT |
| 235 | | | | code | | | | | | | N/A | |
| 236 | | | | purchase_tax | | | | | | | | |
| 237 | | | | | purchase_amount | | | | | | N/A | |
| 238 | | | | rate | | | | | | | Product in Order > Marketplace VAT Percent | |
| 239 | | | | tax_calculation_rule | | | | | | | N/A | |
| 240 | | | total_commission
| | | | | | | | N/A | |
| 241 | | | total_price
| | | | | | | | N/A | |
| 242 | | 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. |
| 243 | | order_state_reason_code
| | | | | | | Reason's code of the order state | | N/A | |
| 244 | | order_state_reason_label
| | | | | | | Reason's label of the order state | | N/A | |
| 245 | | 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 | |
| 246 | | paymentType
| | | | | | | Deprecated | | | |
| 247 | | payment_type
| | | | | | | he payment's type used by the customer to pay this order | | Order > Order Payment Method | |
| 248 | | 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 | | N/A | |
| 249 | | price
| | | | | | | Order's price (sum of order line's price) | | Order > Оrder Subtotal Аmount | without shipping cost |
| 250 | | promotions
| | | | | | | | | | |
| 251 | | | applied_promotions
| | | | | | The promotions applied on this order | | Order > Discount Type | |
| 252 | | | total_deduced_amount
| | | | | | The total amount deduced on this order thanks to the promotions | | Order > Discount | |
| 253 | | quote_id
| | | | | | | Quote's id from which the order has been placed, or null if it was not from a quote | | N/A | |
| 254 | | order_reference_for_customer | | | | | | | | | | |
| 255 | | shipping_carrier_code
| | | | | | | Shipping carrier code (associated with the Shipping company label) | | N/A | |
| 256 | | shipping_company
| | | | | | | Shipping company | | Orders > Carrier
AND
Order Shipment > Courier | |
| 257 | | shipping_deadline
| | | | | | | Order's shipping deadline | | N/A | |
| 258 | | shipping_price
| | | | | | | Order's shipping price (sum of order line's shipping price) | | Orders > Shipping Service Cost | |
| 259 | | shipping_pudo_id
| | | | | | | PickUp DropOff (PUDO) point identifier | | N/A | |
| 260 | | shipping_tracking
| | | | | | | Shipping tracking | | Orders> Shipping Track Number
AND
Order Shipment > Track Number | |
| 261 | | shipping_tracking_url
| | | | | | | Shipping tracking url | | Order Shipment > Tracking URL | |
| 262 | | shipping_type_code
| | | | | | | Code of shipping's type | | N/A | |
| 263 | | shipping_type_label
| | | | | | | Label of shipping's type | | Order > Shipping Service | |
| 264 | | shipping_zone_code
| | | | | | | Code of shipping's zone | | N/A | |
| 265 | | shipping_zone_label
| | | | | | | Label of shipping's zone | | N/A | |
| 266 | | total_commission
| | | | | | | Order's total commission (sum of the order line's total commission) | | Order> Total Fee | |
| 267 | | total_price
| | | | | | | otal order's price (sum of the order's price and the order's shipping price). | | Order > Оrder Тotal Аmount | |
| 268 | | transaction_date | | | | | | | | | N/A | |
| 269 | | transaction_number | | | | | | | | | Order Payment > Transaction ID | This is the payment row with type payment |
Get Orders cron should download orders according to their marketplace status:
MP Status | Hemi Status | |
---|---|---|
1 | STAGING | Incomplete |
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 | Cancelled |
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. • If we download an order for the first time with INCIDENT_OPEN status we ??? | | 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:
- MP status = WAITING_ACCEPTANCE; Tool status = Pending and there wont be payment row yet;
- MP status = WAITING_DEBIT; Tool status = Pending and we create a payment row with status Pending;
- MP status = WAITING_DEBIT_PAYMENT; Tool status = Pending and we create a payment row with status Pending;
- MP status = SHIPPING; Tool status = Ready For Shipping and the payment row status is Completed;
- MP status = SHIPPED; Tool status = Shipped and the payment row status is Completed;
- MP status = RECEIVED; Tool status = Shipped and the payment row status is Completed;
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 something missing on the order, like address, items etc. | |
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. |