VeePee 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 |
---|---|---|---|
15.02.2023 | 1.0 | Bogomil Pavlov | First Publish |
28.02.2023 | 1.1 | Danail Deltchev | Add expectation for Hemi “Pending” order tool status based on received info from MP |
Change logic for handling Products in Order vs Order Item Lines Small addition to the way we want to handle the VAT incoming from the MP | | 01.03.2023 | 1.2 | Danail Deltchev | Additional explanations and clean ups to reduce unnecessary info while reading | | 07.03.2023 | 1.3 | Bogomil Pavlov | We do not want to download refunds from the MP | | 03.04.2023 | 1.4 | Bogomil Pavlov | Update the logic for Order Item Line ID |
The purpose of this document is to give detailed explanation how Get Orders for VeePee would work.
Get Orders
We are able to get the order based on updated date which means we will have one cron for Get New and Get Modified orders.
We will not have any acceptance or acknowledgement as we will switch on an auto acceptance from the Marketplace. Still we should be prepared to receive orders for Hemi “Pending” tool status which will later move to a further “Read only” status (meaning RFS, Shipped, Cancelled, etc). We expect the abstraction enrichments and additions to kick in when we read any of those statuses (Enrichment includes but is not limited to: Debundler, Split Shipping Cost, Vat calculation, Subtotal, Acknowledged, etc.)
Please Note: If we have an order on an “Incomplete” Hemi status it still triggers enrichments and additions once it moves to any of the other statuses. We do not expect buyers to have the capability to change (remove/add items) their order once we’ve reached Incomplete or any “Read only” status
API Call: GET {{BaseURL}}/orders
API Docs: https://pinkstaging.pink-connect.com/swagger#operation/listOrders
Query Parameters we want to use:offset
- Number of records to skip for pagination
limit
- Maximum number of records to return
shopChannelId
- The Id of the shop channel on which the orders where placed
updateDateGTE
- Update start date for filtering greater or equal than yyyy-MM-dd'T'HH:mm:ss. Please have in mind the overlap period.
Sample Request: GET {{baseUrl}}/orders?offset=1&limit=10&shopChannelId=1160&updateDateGTE=2022-04-22T07:36:23
VeePee field | Hemi Field | Comment |
---|---|---|
shopChannelId | Account VeePee > Shop Channel Id | |
offset | Used for pagination | |
limit | Max limit is 100 | |
updateDateGTE | For the first run we want to check for orders within the last 90 days. | |
If we have a record in Last Date Run table we want to get the last date and overlap with 90 mins |
Sample Response:
{
"orderId": 34935,
"marketplaceName": "Veepee France",
"marketplaceCode": "venteprivee",
"marketplaceOrderCode": "Test_738-1160-214079121",
"shopChannelId": 1160,
"shopChannelName": "Pentagon test Veepee France",
"status": "PENDING",
"createOrderDate": "2023-02-15 14:55:26",
"updateOrderDate": "2023-02-16 23:42:32",
"shippedOrderDate": null,
"totalPrice": 57.5,
"shippingCosts": 5,
"shippingTaxRate": 0,
"currency": "eur",
"deliveryNote": "https://pinkstaging.pink-connect.com/order-pdf/view-pdf?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6MzQ5MzUsIm5hbWUiOiIiLCJkZXN0IjoiSSIsInVzZXJJZCI6MTA3OCwiZXhwIjoxNjc3Nzk2OTU4fQ.jEN3h93Y3GVgdrFe3GDW8MJdLGoEyCCm2bomRfcB9qE",
"shippingInformation": {
"name": "Delivery Name",
"company": "Company",
"address": "Address ñáñiç",
"city": "City",
"state": "state",
"zipCode": "Zip Code",
"country": "España",
"countryIsoCode": "ES",
"email": "email@testemail.com",
"phone": "phone",
"comment": "note"
},
"pickupPointId": null,
"billingInformation": {
"name": "Billing Name",
"company": "BillingCompany",
"address": "Billing Address ñáñiç",
"city": "BillingCity",
"state": "Billingstate",
"zipCode": "BillingZip Code",
"country": "BillingCountry",
"countryIsoCode": null,
"email": "emailBilling@testemail.com",
"phone": "billing_phone",
"comment": null
},
"deliveryDetails": [
{
"carrierId": 35,
"carrierName": "Agediss",
"trackingNumber": "1234567",
"trackingUrl": null
}
],
"orderLines": [
{
"id": 69741,
"gtin": "1234567891013",
"sku": "1234",
"name": "Náuticas Hombre Nautico Garçon",
"price": 17.5,
"taxRate": 21,
"quantity": 1,
"brandName": "Brand",
"totalPrice": 17.5,
"manufacturerReference": "1234",
"status": {
"Pending": 1
},
"promotion": null,
"merchandising": null
},
{
"id": 69742,
"gtin": "1234567891013",
"sku": "1234",
"name": "Náuticas Hombre Nautico Garçon",
"price": 17.5,
"taxRate": 21,
"quantity": 1,
"brandName": "Brand",
"totalPrice": 17.5,
"manufacturerReference": "1234",
"status": {
"Pending": 1
},
"promotion": null,
"merchandising": null
},
{
"id": 69743,
"gtin": "1234567891013",
"sku": "1234",
"name": "Náuticas Hombre Nautico Garçon",
"price": 17.5,
"taxRate": 21,
"quantity": 1,
"brandName": "Brand",
"totalPrice": 17.5,
"manufacturerReference": "1234",
"status": {
"Cancelled": 1,
"Returned": 1,
"Pending": -1
},
"promotion": null,
"merchandising": null
}
],
"additionalInformation": null,
"refunds": [
{
"date": "2023-02-16 23:42:30",
"productCost": 17.5,
"shippingCost": 5,
"currency": "eur",
"type": "CANCELLATION"
},
{
"date": "2023-02-16 23:42:32",
"productCost": 17.5,
"shippingCost": 5,
"currency": "eur",
"type": "REFUND"
}
],
"requestedShippingMethod": null,
"memberId": "77aa6418-fbc4-488e-b256-0a4cb4e6582d"
}
Mapping: All field with N/A mean we do not want to store them in Hemi.
VeePee Field | Hemi Field | Comment | ||
---|---|---|---|---|
orderId |
Order > Marketplace Order ID | |||
marketplaceName |
N/A | |||
marketplaceCode |
N/A | |||
marketplaceOrderCode |
Order > Selling Manager SalesRecordNumber | |||
shopChannelId |
N/A | |||
shopChannelName |
N/A | |||
status |
Order > Order Status | |||
createOrderDate |
Order > Order Created Time | |||
updateOrderDate |
N/A | |||
shippedOrderDate |
Order > Shipping Shipped Date |
AND
Order Shipment > Shipment Time | This is returned only if the order is shipped.We want to populate both fields IF empty in Hemi (note - Shipment can be only one successful for the whole order as we Ship the full order here. If there are multiple such the first one to be picked is to be updated) |
| totalPrice
| | | Order > Оrder Тotal Аmount | Difference between these two fields to be stored in Order > Order Subtotal Amount
|
| shippingCosts
| | | Order > Shipping Service Cost | |
| shippingTaxRate
| | | Order > Total Shipping Marketplace VAT | Calculate the Shipping VAT by taking the provided % from the total shipping cost provided in field shippingCosts
|
| currency
| | | Order > Order Currency | The pickup from the Account field (Account > Exchange Rate Calculator Currency) should be based on a general abstraction addition which will pick it from there only in cases where A ) mapping for currency is generally not provided and we are not receiving this field in the payload at all
or
B ) there is no currency provided for the order from the MP (case B generally is expected to be a very edge case where there might be a MP problem) |
| deliveryNote
| | | Order > Note | |
| shippingInformation
| | | | |
| | name
| | Order > Shipping Buyer Name | |
| | company
| | Order > Company Name | |
| | address
| | Order > Shipping Street 1 | |
| | city
| | Order > Shipping City | |
| | state
| | Order > Shipping State Province | |
| | zipCode
| | Order > Shipping Postal Code | |
| | country
| | Order > Shipping Country Name | |
| | countryIsoCode
| | Order > Shipping Country Code | |
| | email
| | Order > Buyer mail | |
| | phone
| | Order > Shipping Phone | |
| | comment
| | N/A | |
| pickupPointId
| | | N/A | |
| billingInformation
| | | | |
| | name
| | Order > Billing Name | |
| | company
| | Order > Company Name | |
| | address
| | Order > Billing Street 1 | |
| | city
| | Order > Billing City Name | |
| | state
| | Order > Billing State Province | |
| | zipCode
| | Order > Billing Postal Code | |
| | country
| | Order > Billing Country Name | |
| | countryIsoCode
| | Order > Billing Country Code | |
| | email
| | N/A | |
| | phone
| | Order > Billing Phone | |
| | comment
| | N/A | |
| deliveryDetails
| | | | This is received if the order is already shipped. Expectation is to Insert these only if the order is stored anew OR from pending to Shipped OR moving from RFS in Hemi to Shipped in Hemi via the download of Orders. If we’ve successfully shipped the order from Hemi expectation is the Shipment is already set correctly and we don’t have anything to update/create |
| | carrierId
| | Order Shipment > External Id | |
| | carrierName
| | Order > Shipping Carrier
AND
Order Shipment >Courier | we want to populate both fields |
| | trackingNumber
| | Order > Shipping Track Number
AND
Order Shipment >Tracking Number | we want to populate both fields |
| | trackingUrl
| | Order > Shipping Tracking URL
AND
Order Shipment >Tracking URL | we want to populate both fields |
| orderLines
| | | | It seems the products from the MP are coming per line which means based on our general internal logic we want to combine them. The information for this is below in Additional Information |
| | id
| | Order Item Line > Marketplace Order Item ID | |
| | gtin
| | Product In Order >EAN | |
| | sku
| | Product In Order >SKU | |
| | name
| | Product In Order >Item Title | |
| | price
| | Product In Order >Item Price | |
| | taxRate
| | Product In Order >Marketplace VAT Percent
AND
Product In Order >Marketplace VAT Item Price
AND
Order > Total Marketplace VAT | For Product In Order > Marketplace VAT Item Price
we want to calculate the line value for the product based on the provided price
and taxRate
We then want to calculate the total available Product In Order > Marketplace VAT Item Price
(every Product in Order field x quantity and sum it up) and store the received value in Order > Total Marketplace VAT
|
| | quantity
| | Product In Order >Quantity | To be summed for all Lines added to the same Hemi Product in Order |
| | brandName
| | N/A | |
| | totalPrice
| | N/A | |
| | manufacturerReference
| | N/A | |
| | status
| | | |
| | | Pending
| Order Item Line > Marketplace Status | We are interested only in the statuses with positive values. Going from back to forth - if we have a “Cancelled” status with positive value (1 as it seems everything is broken down per quantity on the lines) we want to store the line as Cancelled and treat it accordingly in cases where we have to store refunds. Same goes for “Returned”. In case we have both “Cancelled” takes precedent over “Returned” (in reality we should treat them the same way in Hemi just store the different status). Then it is “Shipped” and at the end comes “Pending”
Please note: there is a case where we can “partially refund” an item at which point at the moment we are not expecting a change in statuses but this has to be confirmed TBC |
| | promotion
| | N/A | |
| | merchandising
| | N/A | |
| additionalInformation
| | | | |
| refunds
| | | | |
| | date
| | N/A | |
| | productCost
| | N/A | |
| | shippingCost
| | N/A | |
| | currency
| | N/A | |
| | type
| | N/A | |
| requestedShippingMethod
| | | | |
| memberId
| | | Order > Buyer User Id | |
Additional Information:
The Products in orders are provided per quantity (meaning per Order Item Line). I believe best case would be to combine these in one Product in Order with the relevant Order Item Lines. These will have to be combined and sum up the quantity ordered with the relevant sub information stored in the Order Item Line (as per the mapping above). A few key points to ensure we do this as best as possible:
- Lines are to be combined based on the sameness of the
gtin
- We will have always the same
price
ortaxRate
for items with the samegtin
and we should store it in the same Product in Order - We want to store the EAN in
Product in Order > Item Order Line ID
as well - but when we are downloading the orders and we are making updates to statuses (on order or on line level) we should keep track of the right Product in Order that we are picking based on the ID mapping
VAT and TAX fields
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 |
Order Status Mapping
VeePee Status | VeePee Description | Hemi Status |
---|---|---|
Waiting Acceptance | to be added | Pending |
Waiting Information | to be added | Pending |
Pending | Once the order is accepted, the order will appear as Pending. Now you can prepare and send the order. |
At this step you can: • Move to PROCESSING status. (not mandatory) • Move to SHIPPED. • CANCEL the order. • Cancel one product if you don't have stock. | Ready For Shipping / Incomplete (based on internal validation for order mandatory fields) | | Processing | This is an optional step, not mandatory. Some sellers use it for internal workflow reasons. At this step you can: • Move to SHIPPED. • CANCEL the order. • Cancel one product if you don't have stock. | Ready For Shipping / Incomplete (based on internal validation for order mandatory fields) | | Shipped | At this step, you can CANCEL the order in case the product has not being delivered for any reason (lost shipment, etc...) | Shipped | | Cancelled | | Cancelled |
Hemi Order Statuses Transitions
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. This is only for orders that are otherwise to be stored as RFS. If they are to be stored / updated to “shipped” for example we don’t want to go through Incomplete | |
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. |
We want all abstraction requirements to fit here too as per the Order management general requirements abstraction.
Note: Until the Refunds section is fully described and stored it is acceptable we don’t store refunds as well based only on Line statuses so we don’t have to redo something there to work better with the refunds section too. Storing the statuses will be a must though