Decathlon OMC - Orders & Products Management
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)
Version | Date | Created / Updated | Notes |
---|---|---|---|
v1.0 | 06.07.2022 | Bogomil Pavlov | First publish |
v1.1 | 17.10.2022 | Bogomil Pavlov | Additional mapping added for order item id. |
v1.2 | 25.10.2022 | Bogomil Pavlov | Incorporate the logic for Account > Country field |
v1.3 | 04.11.2022 | Bogomil Pavlov | Changes in the mapping and in the validation |
v1.4 | 30.11.2022 | Bogomil Pavlov | Empty StreetNumber logic |
v1.5 | 08.12.2022 | Bogomil Pavlov | Change the order id characters |
v1.6 | 01.06.2023 | Bogomil Pavlov | Send dummy phone number when empty |
v1.7 | 06.05.2023 | Bogomil Pavlov | Promisedate calculation changes |
v1.8 | 05.07.2023 | Bogomil Pavlov | Additional mapping for marketplaceOrderId and URL selection |
v1.9 | 01.08.2023 | Bogomil Pavlov | DeliveryByDate additional calculation changes |
v2.0 | 17.08.2023 | Bogomil Pavlov | DeliveryByDate additional validation |
v2.1 | 13.03.2024 | Bogomil Pavlov | Stop updating products before order export |
Decathlon as a client is project where we will be helping them to start selling on different marketplaces using our solution. In order to achieve this we will have to integrate Hemi to their system called OMC. Where we will export orders and create/update products. While they will integrate to Hemi using our Open API to update stock levels and ship orders. There is an available sandbox environment where we can conduct all the relevant tests:
Decathlon OMC Sandbox.postman_collection.json
Decathlon OMC Environment.postman_environment.json
Decathlon OMC Sandbox Docs.docx
To create an order in Decathlon`s system, we should define the partner name into the request parameters. The partner name will be provided from Decathlon once the partner is configured on their system.
We need to send the order information to Decathlon as per payload and mapping below. The document is separated in 2 sections, but bear in mind that we will have only 1 flow (i.e. 1 cron). Note: We have no option to split into 2 scripts (1 for product update and 1 for order export) because we need to be sure that the product will be with the exact same price in Decathlon’s system. A case which will break the export if we split it would be if there are 2 orders for export, both having the same order item (SKU) but with a different price - if we make a script which updates prices only without exporting order, we will have updated the SKU with the price from the second order and the export will fail for the first order.
The flow will be, before we export an order to OMC we will have to update/create the product first based on the order item information because if the product is missing or the price does not match in OMC we will receive an error. Thus, to make sure, we will always export orders with order items that are created and the price is the same in OMC we will have to first create/update each order item before export the order.
- Order management
<v2.1>This is NO longer applicable- “The specific is we need to use the information from the order, to create a product and to push respectively price to this product. So, before exporting the order to Decathlon, we need to make sure we have pushed the products from the order for creation to Decathlon OMC. Once we have pushed a product for creation on Decathlon OMC and product was successfully created on Decathlon OMC, we can proceed with exporting the order. Otherwise if the first step of creating or updating the product failed we return an error in Order Error table and do not export the order.”</v2.1>
Please note we are exporting only orders that are with Ready For Shipping Status and Orders >Connector Order ID = ‘' and Orders > Connector Error = '’ this way if we have an error we wont enter in a loop. Also we need to be careful and make sure all internal enrichments are done
- Order > Splitted Shipping Cost = yes
- Product on Order > Check for Bundle = yes
- Is Product In Order > Seller filled in for EVERY order item
<v2.1>This is NO longer applicable - “Once the order is successfully exported and also the products are updated/created we store the Orders >Connector Order ID and set Product In Order > Connector Exported = Yes If error is received during the product creation/update, order creation, internal validation or missing information, we need to store the error into Orders > Connector Error and Order Error table”</v2.1>
Hemi Sales Tax, Marketplace VAT and Internal VAT overview and logic.
For the ease of use we will use the group names for reference instead mentioning all of the fields in the document. From now on these are the fields which will be used for any VAT/Sales Tax purposes.
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 Percent | Product In Order > Vat Item Price |
Product In Order > Sales Tax Percent | Product in Order > Marketplace VAT Item Price | 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 |
Please note the priority of the fields is Sales Tax, Marketplace VAT, Internal VAT, which means if on the order there is populated Sales Tax we will use it for the order, if not we will check the Marketplace VAT and finally if there is not Sales Tax or Marketplace VAT we will use our Internal VAT. This is controlled based on the Account > Country field where if we have selected “United States“ we are using only the Sales Tax Group even if they are empty. If we have Account > Country != “United States“ or not selected we are using the Marketplace VAT Group or the Internal VAT Group. Based on the priority we first check if we have Marketplace VAT and use it if not we check the Internal VAT Group and even if there is nothing calculated here we send “0”. Please note even if some of the fields are “null” in the database we still need to send them as “0“
Please note this is required because not all integrations work in the same way.
In terms of times and dates we need to
API Call: POST /{partner_name}/orders/receive/
API Docs: https://omcdev.playstg.net/api-swagger-docs/
Example Call:
{
"orderId": "71946259",
"customer": {
"name": "przemyslaw drygalski",
"email": "drygalski_p@wp.pl",
"address": {
"city": "warszawa",
"state": "",
"district": "",
"postalCode": "01-756",
"streetName": "przasnyska 7 m 125",
"countryCode": "PL",
"streetNumber": "",
"additionalNumber": "",
"additionalAddress1": "przasnyska 7 m 125",
"additionalAddress2": "",
"additionalPostalCode": ""
},
"civility": "",
"firstName": "przemyslaw",
"companyName": "",
"phoneNumber": "+48696042784",
"languageCode": "pl_PL",
"additionalName": ""
},
"payments": [
{
"id": "",
"type": "EXT_FREE",
"amount": "72.97",
"currency": "PLN"
}
],
"shipping": {
"fees": {
"vatRate": "23.00",
"vatAmount": "2.9877",
"withTaxes": "12.99",
"withoutTaxes": "10.0023"
},
"carrier": "PACZKOMATY",
"timeSlotEnd": "",
"carrierMethod": "INPOST_RELAY",
"timeSlotStart": "",
"carrierService": "",
"deliveryAddress": [
{
"city": "warszawa",
"state": "",
"district": "",
"storeEan": "",
"postalCode": "01-756",
"streetCode": "",
"streetName": "przasnyska 7 m 125",
"addressType": "primary",
"countryCode": "PL",
"customerName": "przemyslaw drygalski",
"relayPointId": "",
"streetNumber": "",
"relayPointName": "",
"relayPointType": "",
"pickUpFriendName": "",
"additionalAddress1": "przasnyska 7 m 125",
"additionalAddress2": "",
"additionalPostalCode": ""
}
],
"geographicalArea": "",
"shipmentMethodTypeId": ""
},
"materials": [
{
"currency": "PLN",
"quantity": "1",
"unitCode": "PCE",
"packaging": "CAS",
"productId": "2398071",
"partnerProductId":"1231412421",
"unitPrice": {
"orderPrice": {
"vatAmount": null,
"withTaxes": null,
"withoutTaxes": "29.99"
},
"declaredPrice": {
"vatAmount": null,
"withTaxes": null,
"withoutTaxes": "29.99"
}
},
"lineNumber": "1",
"preOrderId": "",
"totalPrice": {
"vatRate": "23.00",
"currency": "PLN",
"vatAmount": null,
"withTaxes": "59.98",
"withoutTaxes": null
},
"productName": "KIESZONKA WODOODPORNA 150 7 L NA BASEN",
"purchaseDate": "2022-01-31T12:41:30",
"preOrderStatus": "C",
"purchaseOrderId": "71946259",
"shipmentPriority": "",
"supplierPartyEan": "003020910001086"
}
],
"orderType": "ZVCO",
"invoiceUrl": "https://orders-b.baselinker.com/71946259/33hqtbmo3r/",
"shipmentId": "71946259",
"deliveryDateTime": "2022-01-31T12:41:57",
"orderTotalAmount": {
"currency": "PLN",
"vatAmount": "11.22",
"withTaxes": "59.98",
"withoutTaxes": "48.76",
"declaredValue": "48.76"
},
"supplierPartyEan": "003020910001086",
"referenceStoreEan": "",
"lastPurchaseOrderId": "71946259",
"marketplaceOrderId": "dbz_order_12345",
"promisedShipDateTime": "2022-02-02T12:41:57",
"orderCreationDateTime": "2022-01-31T12:41:30"
}
Mapping: we need to export the order information into Hemi as follow:
Integration Field | Integration Notes | Integration required | Hemi Mapping | Hemi Notes | |||
---|---|---|---|---|---|---|---|
orderId |
format: eg: 00000123 | yes | Orders > ID | Please note we need to have always 8 digit id. | |||
customer |
|||||||
name |
yes | Orders > Shipping Buyer Name | |||||
email |
Orders > Buyer mail | ||||||
address |
yes | ||||||
city |
yes | Orders > Billing City Name | |||||
state |
Orders > Billing State Province | ||||||
district |
N/A | ||||||
postalCode |
yes | Orders > Billing Postal Code | 1. When the postal code is 6 letters, it should contain space after 3 letters like this.(JE3 3BD) | ||||
2. When the postal code is 7 letters, it should contain space after 4 letters like this.(CB22 7QX) | |||||||
streetName |
yes | Orders > Billing Street 1 | To push only the shipping street name (split name & street number) |
If Orders > Billing Street 1 is empty we need to refer to Orders > Billing Street 2 |
| | | countryCode
| | | yes | Orders > Billing Country Code
OR
Orders > Billing Country Name | If the Orders > Billing Country Code is missing we need to use our JSON file for the mapping based on the Country Name and get the Country Code. |
| | | streetNumber
| | | Yes | Orders > Billing Street 1 | To push only the billing street number here (split name & street number)
If Orders > Billing Street 1 is empty we need to refer to Orders > Billing Street 2
If the address does not contain any numbers we push the StreetNumber empty |
| | | additionalNumber
| | | | N/A | |
| | | additionalAddress1
| | | yes | Orders > Billing Street 2 | If Orders > Billing Street 2 is empty we need to refer to Orders > Billing Street 1 |
| | | additionalAddress2
| | | | N/A | |
| | | additionalPostalCode
| | | | N/A | |
| | civility
| | | | | N/A | |
| | firstName
| | | | yes | Orders > Billing Name | The Client expect only the first name.
For example:
John Dow = John
Mr. John Dow = Mr. John
Mr. John Patrick Dow = Mr. John Patrick |
| | companyName
| | | | | Orders > Company Name | |
| | phoneNumber
| | | | yes | Orders > Billing Phone
OR
Orders > Shipping Phone | Firs we check the Orders > Billing PhoneIf the Orders > Billing Phone is empty we pick the Orders > Shipping Phone else (v1.6) we push a dummy phone number “1234567890“ |
| | languageCode
| | | | yes | “en_GB“ | Hardcoded as “en_GB“ |
| | additionalName
| | | | | N/A | |
| payments
| | | | | | | |
| | id
| | | | | Order Payment Details > Transaction ID | |
| | type
| | | | yes | “EXT_FREE“ | Hardcoded as “EXT_FREE“ |
| | amount
| | | | yes | Order Payment Details > Total Amount | |
| | currency
| | | | yes | Orders > Order Currency | |
| shipping
| | | | | yes | | If there is no shipping cost we need to push it as:
"fees": { "withoutTaxes": "0.0", "vatAmount": "0.0", "vatRate": "0.0", "withTaxes": "0.00" } |
| | fees
| | | | | | |
| | | vatRate
| | | | Product In Order > Sales Tax Percent
OR
Product in Order > Marketplace VAT Item Price
OR
Product In Order > Vat Percent | Based on the Account > Country if we have selected “United States“ we are using the Sales Tax Group, if “United States“ is not selected or nothing is selected we check the Marketplace VAT Group and if empty the Internal VAT Group. |
| | | vatAmount
| | | | Orders >Total Shipping Sales Tax
OR
Orders > Total Shipping Marketplace VAT
OR
Orders > Total Shipping VAT | Based on the Account > Country if we have selected “United States“ we are using the Sales Tax Group, if “United States“ is not selected or nothing is selected we check the Marketplace VAT Group and if empty the Internal VAT Group.
If there are no Shipping Totals on the Order
We need to refer to the Product in Order and check
Product In Order > Item Shipping Cost Sales Tax
OR
Product in Order > Marketplace VAT Item Shipping Cost
OR
Product In Order > Vat Item Shipping Cost
Please note this need to be SUM for all order items. |
| | | withTaxes
| | | | US Accounts:
Orders > Shipping Service Cost + (Orders >Total Shipping Sales Tax OR SUM(Product In Order > Item Shipping Cost Sales Tax)
Rest: Orders > Shipping Service Cost | Based on the Account > Country if we have selected “United States“ we are using the Sales Tax Group, if “United States“ is not selected or nothing is selected we check the Marketplace VAT Group and if empty the Internal VAT Group.
Please note for US accounts the tax is not included in the Shipping Cost thus we need to add it |
| | | withoutTaxes
| | | | US Accounts:
Orders > Shipping Service Cost
Rest:
Orders > Shipping Service Cost - (Orders >Total Shipping Marketplace VAT OR SUM(Product In Order > Marketplace VAT Item Shipping Cost)
ОR
Orders > Shipping Service Cost - (Orders >Total Shipping VAT OR SUM(Product In Order > Vat Item Shipping Cost) | Based on the Account > Country if we have selected “United States“ we are using the Sales Tax Group, if “United States“ is not selected or nothing is selected we check the Marketplace VAT Group and if empty the Internal VAT Group. |
| | carrier
| | | | yes | ““ | We push empty string |
| | timeSlotEnd
| | | | | N/A | |
| | carrierMethod
| | | | | N/A | |
| | timeSlotStart
| | | | | N/A | |
| | carrierService
| | | | | Orders > Shipping Service | |
| | deliveryAddress
| | | | | | |
| | | city
| | | yes | Orders > Shipping City | |
| | | state
| | | | Orders > Shipping State Province | |
| | | district
| | | | N/A | |
| | | storeEan
| | | | N/A | |
| | | postalCode
| | | yes | Orders > Shipping Postal Code | 1. When the postal code is 6 letters, it should contain space after 3 letters like this.(JE3 3BD)
- . When the postal code is 7 letters, it should contain space after 4 letters like this.(CB22 7QX) |
| | |
streetCode
| | | | N/A | | | | |streetName
| | | yes | Orders > Shipping Street 1 | To push only the shipping street name (split name & street number) | | | |addressType
| | | yes | N/A | | | | |countryCode
| | | yes | Orders > Shipping Country Code OR Orders > Shipping Country Name | If the Orders > Shipping Country Code is missing we need to use our JSON file for the mapping based on the Country Name and get the Country Code. | | | |customerName
| | | yes | Orders > Shipping Buyer Name | | | | |relayPointId
| | | | N/A | | | | |streetNumber
| | | | Orders > Shipping Street 1 | We need to push only the shipping street number here (split name & street number) | | | |relayPointName
| | | | N/A | | | | |relayPointType
| | | | N/A | | | | |pickUpFriendName
| | | | N/A | | | | |additionalAddress1
| | | yes | Orders > Shipping Street 2 | If Orders > Shipping Street 2 is empty we need to refer to Orders > Shipping Street 1 | | | |additionalAddress2
| | | | N/A | | | | |additionalPostalCode
| | | | N/A | | | |geographicalArea
| | | | | N/A | | | |shipmentMethodTypeId
| | | | | N/A | | |materials
| | | | | | | each order item will be in a separate array within the materials node | | |currency
| | | | yes | Orders > Order Currency | | | |quantity
| | | | yes | Product in Order > Quantity | | | |unitCode
| | | | yes | “PCE“ | Hardcoded as “PCE“ | | |packaging
| | | | yes | Hardcoded as “CAS“ | Hardcoded as “CAS“ | | |productId
| | | | yes | Product in Order > SKU | If we have a case where we have single order but with two order items having the same SKU but with different prices we need to return a error. | | |partnerProductId
| | | | Yes | Product In Order > Id | | | |unitPrice
| | | | | | | | | |orderPrice
| | | | | What will be expected is: vatAmount - The total VAT amount or if there is a Tax the total tax amount
withTaxes - The total order amount with VAT or Tax
withoutTaxes - The total order amount without VAT or TAX
e.g:
{'currency': 'USD',
'vatAmount': '29.92',
'withTaxes': '159.99',
'withoutTaxes': '130.07',
'declaredValue': '130.07'} |
| | | | vatAmount
| | yes | Product In Order > Item Sales Tax Price
OR
Product in Order > Marketplace VAT Item Price
OR
Product In Order > Vat Item Price | Based on the Account > Country if we have selected “United States“ we are using the Sales Tax Group, if “United States“ is not selected or nothing is selected we check the Marketplace VAT Group and if empty the Internal VAT Group. |
| | | | withTaxes
| | yes | US Accounts:
Product In Order > Item Price
- Product In Order > Item Sales Tax Price
Rest Accounts:
Product In Order > Item Price | Based on the Account > Country if we have selected “United States“ we are using the Sales Tax Group, if “United States“ is not selected or nothing is selected we check the Marketplace VAT Group and if empty the Internal VAT Group. |
| | | |
withoutTaxes
| | yes | US Accounts: Product In Order > Item Price
Rest: Product In Order > Item Price
- Product in Order > Marketplace VAT Item Price
OR
Product In Order > Item Price- Product in Order > VAT Item Price | Based on the Account > Country if we have selected “United States“ we are using the Sales Tax Group, if “United States“ is not selected or nothing is selected we check the Marketplace VAT Group and if empty the Internal VAT Group. |
| |
lineNumber
| | | order item sequence number starts from 1 | yes | N/A | We need to start from id 1 and autoincrement each next order item line. lineNumber should denote the lineNumber of the product in the order.(1, 2, ....), also this should be string. | | |preOrderId
| | | | | | | | |totalPrice
| | | | | | The total prices of the Line, e.g. the Unit Price Quantity | | | |vatRate
| | | | Product In Order > Sales Tax Percent OR Product in Order > Marketplace VAT Percent OR Product In Order > Vat Percent | Based on the Account > Country if we have selected “United States“ we are using the Sales Tax Group, if “United States“ is not selected or nothing is selected we check the Marketplace VAT Group and if empty the Internal VAT Group. | | | |currency
| | | | Orders > Order Currency | | | | |vatAmount
| | | | Product In Order > Item Sales Tax Price Product in Order > Quantity OR Product in Order > Marketplace VAT Item Price * Product in Order > Quantity
OR
Product In Order > Vat Item Price * Product in Order > Quantity | Based on the Account > Country if we have selected “United States“ we are using the Sales Tax Group, if “United States“ is not selected or nothing is selected we check the Marketplace VAT Group and if empty the Internal VAT Group. |
| | | withTaxes
| | | | US Accounts:
(Product In Order > Item Price
- Product In Order > Item Sales Tax Price) * Product in Order > Quantity
Rest:
Product In Order > Item Price Product in Order > Quantity | Based on the Account > Country if we have selected “United States“ we are using the Sales Tax Group, if “United States“ is not selected or nothing is selected we check the Marketplace VAT Group and if empty the Internal VAT Group. |
| | | withoutTaxes
| | | | US Accounts:
Product In Order > Item Price Product in Order > Quantity
Rest:
(Product In Order > Item Price - Product in Order > Marketplace VAT Item Price) * Product in Order > Quantity
OR
(Product In Order > Item Price- Product in Order > VAT Item Price) * Product in Order > Quantity | Based on the Account > Country if we have selected “United States“ we are using the Sales Tax Group, if “United States“ is not selected or nothing is selected we check the Marketplace VAT Group and if empty the Internal VAT Group.
Please note for US orders the tax is not added in the Product in Order > Item Price |
| | productName
| | | | | Product in Order > Item Title | |
| | purchaseDate
| | | | | Orders > Order Paid Time | Date Format - 2022-08-31T09:32:47 |
| | preOrderStatus
| | | | | “c“ | Hardcoded as 'c' |
| | purchaseOrderId
| | | format: eg: 000000123 | yes | Orders > ID | Please note we need to have always 8 digit id. |
| | shipmentPriority
| | | | | N/A | |
| | supplierPartyEan
| | | | yes | “3020910001819“ | Hardcoded as “3020910001819“ |
| orderType
| | | | | yes | “ZVCO“ | Hardcoded as “ZVCO“ |
| invoiceUrl
| | | | | | N/A | |
| shipmentId
| | | | format: eg: 000000123 | yes | Orders > ID | Please note we need to have always 9 digit id. |
| deliveryDateTime
| | | | | | Orders > Delivery By Date | <v1.9>If this date is missing we need to use
Orders > Order Created Time +(Product Account > Dispatch Time Max or Shipping template > Dispatch Time Max )+ Shipping Method > Delivery Time
(*Shipping Method > Delivery Time is part of the Shipping Template)
However there are couple of cases we have to cover and be careful which dates/days we are picking.
Case #1: If there is NO Product Account > Dispatch Time Max and NO Product Account > Shipping Template. We get the default shipping template details and we calculate the delivery date using Orders > Order Created Time + Shipping template > Dispatch Time Max + Shipping Method > Delivery Time
Case #2 If there is Product Account > Dispatch Time Max and NO Product Account > Shipping Template We use the Product Account > Dispatch Time Max as a priority and we calculate the delivery date using Orders > Order Created Time + Product Account > Dispatch Time Max + Shipping Method > Delivery Time
Case #3 If there is NO Product Account > Dispatch Time Max and Product Account > Shipping Template We get the assigned shipping template details and we calculate the delivery date using Orders > Order Created Time + Shipping template > Dispatch Time Max + Shipping Method > Delivery Time
Case #4
If there is Product Account > Dispatch Time Max and Product Account > Shipping Template
We use the Product Account > Dispatch Time Max as a priority and we calculate the delivery date using Orders > Order Created Time + Product Account > Dispatch Time Max + Shipping Method > Delivery Time
If there is nothing assigned on the Product Account and there is no default Shipping template we want to use Orders > Order Created Time + 4 days
If we have order with more than one product and the deliveryDateTime
is different for the products we use the earliest date
If we have a shipping templated with more than one method with more than one Shipping Method > Delivery Time we use the earliest *Shipping Method > Delivery Time</v1.9><v2.0>
If for some reason the Shipping Method > Delivery Time* is negative we want to treat it as 0
</v2.0> |
| orderTotalAmount
| | | | | yes | | |
| | currency
| | | | | Orders > Order Currency | |
| | vatAmount
| | | | | Orders >Total Sales Tax
OR
Orders > Total Marketplace VAT
OR
Orders > Total VAT | Based on the Account > Country if we have selected “United States“ we are using the Sales Tax Group, if “United States“ is not selected or nothing is selected we check the Marketplace VAT Group and if empty the Internal VAT Group. |
| | withTaxes
| | | | | US Accounts:
Orders > Оrder Тotal Аmount + Orders > Total Tax Amount
Rest: Orders > Оrder Тotal Аmount | Based on the Account > Country if we have selected “United States“ we are using the Sales Tax Group, if “United States“ is not selected or nothing is selected we check the Marketplace VAT Group and if empty the Internal VAT Group.
Please note if Orders > Total Tax Amount is missing in the order we need to try and calculate it from the product in orders.
SUM(Product In Order > Item Sales Tax Price * Product in Order > Quantity) |
| | withoutTaxes
| | | | | US Accounts:
Orders > Оrder Тotal Аmount
Rest:
Orders > Оrder Тotal Аmount
- Orders > Total Shipping Marketplace VAT
OR Orders > Оrder Тotal Аmount - Orders > Total Shipping VAT | Based on the Account > Country if we have selected “United States“ we are using the Sales Tax Group, if “United States“ is not selected or nothing is selected we check the Marketplace VAT Group and if empty the Internal VAT Group.
Please note if the Orders > Total Shipping VAT OR Orders > Total Shipping Marketplace VAT are missing we need to check if we can get and calculate the total shipping VAT from the product in order. SUM(Product In Order >Total Shipping Marketplace VAT * Product in Order > Quantity)
OR
SUM(Product In Order > Total Shipping VAT * Product in Order > Quantity) |
| | declaredValue
| | | | | US Accounts:
Orders > Оrder Тotal Аmount
Rest:
Orders > Оrder Тotal Аmount - Orders > Total Shipping Marketplace VAT
OR
Orders > Оrder Тotal Аmount - Orders > Total Shipping VAT | Based on the Account > Country if we have selected “United States“ we are using the Sales Tax Group, if “United States“ is not selected or nothing is selected we check the Marketplace VAT Group and if empty the Internal VAT Group.
Please note if the Orders > Total Shipping VAT OR Orders > Total Shipping Marketplace VAT are missing we need to check if we can get and calculate the total shipping VAT from the product in order.
SUM(Product In Order >Total Shipping Marketplace VAT Product in Order > Quantity)
OR
SUM(Product In Order > Total Shipping VAT Product in Order > Quantity) |
| supplierPartyEan
| | | | | | “3020910001819“ | Hardcoded as “3020910001819“ |
| referenceStoreEan
| | | | | | N/A | |
| lastPurchaseOrderId
| | | | | | Orders > Id | |
| marketplaceOrderId
| | | | | | Orders > Marketplace Order Id | (v1.8) Additional field which we have to map to the MP order id |
| promisedShipDateTime
| | | | | yes | Orders > Ship By Date | Date Format - 2022-08-31T09:32:47
(v1.7)If this date is missing we need to use
Orders > Order Created Time + Product Account > Dispatch Time Max
if we do not have (we have set -1 in Hemi) Product Account > Dispatch Time Max we want to refer to the Product Account > Shipping Template
if assigned on the product.
If there is not Product Account > Dispatch Time Max or Product Account > Shipping Template we get the Dispatch Time Max from the default Shipping Template > Dispatch Time Max
This date need to calculated based on the Shipping Templates > Dispatch Time Max but in order to get the correct template we need to map the Product Account and get the selected Shipping Template from the product otherwise we want to get the Shipping Templates > Dispatch Time Max from the default template else we want to set it as +2 days
Please note if we have an order with more than one product with different Shipping Templates > Dispatch Time Max we want to use the earliest date. |
| orderCreationDateTime
| | | | | yes | Orders > Order Created Time | Date Format - 2022-08-31T09:32:47 |
Example responses:
{
"success": "message",
"order_id": "order_id",
"order_promised_delivery_date": "promised_delivery_date",
"order_promised_shipping_date": "promised_shipment_date"
}
// Error response1:
{
"error_message": "Order already exist"
}
// Error response2:
{
"error_message": "Not a Valid Partner"
}
// Error response3:
{
"error_message": "This order previously had different products, please correct the anomaly and try again"
}
Response Mapping:
Integration Field | Integration Notes | Integration required | Hemi Mapping | Hemi Notes | |||
---|---|---|---|---|---|---|---|
success |
N/A | ||||||
order_id |
Orders > Connector ID | ||||||
order_promised_delivery_date |
N/A | ||||||
order_promised_shipping_date |
N/A |
- <v2.1>DEPRECATED</v2.1>Product management
<v2.1> We wont be updating/creating any products before exporting the orders</v2.1>
As described above, to create a product on Decathlon system, we will take the info for the product from the order we have download, and we need to make sure we will create a product before the order is exported.
Note that into the response example, Decathlon do not return to us assigned product ID, so having in mind this, we can conclude we will set the SKU as a product identifier.
The partner name will be provided on later stage.
If we have already created a product with let’s say ID 1234 and we try to send the same ID, this will be treated as update of the product and we will update the product with the latest pricing send on request data.Please note each product update is one by one which mean every order item is send as a separate request. This way we can track which updates are successful or failed.
Decathlon note: we might release one new api for products to add a few other params
API Call: POST /{partner_name}/products/add/
API Docs: https://omcdev.playstg.net/api-swagger-docs/
Example Call:
{
"id": "string",
"name": "string",
"vat": "string",
"is_discontinued": true,
"cost_price": "string",
"selling_price": "string",
"shipping_price": "string"
}
Request Mapping:
Integration Field | Integration Notes | Integration required | Hemi Mapping | Hemi Notes |
---|---|---|---|---|
id |
string |
maxLength: 18
minLength: 1 | Yes | Product In Order > Item SKU
OR
Item > SKU | |
| name
| maxLength: 500
minLength: 1 | Yes | Product in Order > Item Title | |
| vat
| string($decimal) | Yes | Product In Order > Item Sales Tax Percent
OR
Product in Order > Marketplace VAT Percent
OR
Product In Order > Vat Item Price | If any of these fields is missing we return an error. |
| is_discontinued
| boolean | No | “false“ | Hardcoded as “false“ |
| cost_price
| string($decimal | Yes | Product in Order > Item Price | to be checked if they will provide us this info |
| selling_price
| string($decimal | Yes | Product in Order > Item Price | We will get this information from order and will push it to Decathlon; |
| shipping_price
| string($decimal | Yes | Product in Order > Item Shipping Cost | We need to push the item shipping cost ( will be split from Order > Shipping Service Cost, using shipping split cron).
We would want to export the order to Decathlon OMC only if the order is debundled, shipping cost is split and we have filled out the seller! |
Example response:
{
"status": "success",
"message": "Successfully added new product"
}
After “success” we mark the Product In Order > Connector Exported = Yes and continue with the order creation
Error response:
{
"status": "error",
"message": "Could not create product"
}
If we receive “error“ we add the error message in Orders > Connector Error and Order Error table and we do not export the order.