Hemi Connectors / Storefeeder Technical Scope / StoreFeeder Order Management / StoreFeeder Get Status

StoreFeeder Get Status

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 14/06/2023 Hristiyan Georgiev First publish
v1.1 03/08/2023 Hristiyan Removed the logic to store TransactionID when we get refund
v1.2 03/08/2023 Hristiyan Added new logic for the GET order status call
v1.3 09/08/2023 Hristiyan Added additional logic for the return status
v1.4 29/12/2023 Hristiyan Added logic for when we receive wrong format of TransactionDate

<v1.2> API Call : GET orders/

API Docs : GET orders

Unfortunately StoreFeeder do not have a dedicated call to get tracking information or cancellation and we would need to use the GET orders call. We will use the parameter LastStatusChangeDateFrom and we want to be calling orders with LastStatusChangeDateFrom within the last 15 minutes when we make each call. So it will be LastStatusChangeDateFrom = (last_date_run)-15 minutes .

We also want to be filtering orders only for our channels so we want to add parameter ChannelID in the call as well. We need to be picking the ChannelID from Account StoreFeeder > Channel and then make the calls channel by channel.

This call returns again a lot of information about the order from which we will need only a tiny bit. Since we want to be getting information for orders that we have created, we want to be mapping orders with the following criteria :

1) OrderNumber in the response needs to be equal to Orders > Connector Order ID

3) Orders > Order Status IN (‘Ready for shipping', ‘Shipped’) as we don't want to be checking for changes on a Cancelled order anyways </v1.2>

Example response :

{
    "OrderNumber": 6654428,
    "OrderGuid": "fe512e85-404f-44c4-8dd0-6d0cd0457ce9",
    "OrderStatus": "Despatched",
    "Warehouse": {
        "WarehouseName": "FF STORES WAREHOUSES",
        "WarehouseGuid": "47b69f20-ca67-48ad-b347-fa6d5b023a0e",
        "WarehouseID": 213
    },
    "Channel": {
        "ChannelName": "eBay UK",
        "ChannelType": "PhoneOrder",
        "ChannelID": 11435,
        "ChannelGuid": "f51ebe13-eb6c-4969-8011-d690610186b1",
        "IsActive": false
    },
    "ChannelOrderRef": "3346",
    "OrderTotals": {
        "Subtotal": 10.9900,
        "Tax": 0.0000,
        "ShippingCost": 0.0000,
        "Discount": 0.0000,
        "Total": 0.0000,
        "ShippingNet": 0.0000,
        "ShippingTax": 0.0000
    },
    "Customer": {
        "CustomerID": 6122074,
        "CustomerGuid": "dfef3066-0c44-4c3e-8878-7b525bc90ad0",
        "CustomerRef": "701725bf-68e6-44f7-99ab-1919a755e9fd",
        "RegisterDate": "2023-06-13T07:29:55.507",
        "Email": "-",
        "FirstName": "Ian",
        "LastName": "Harthan",
        "PhoneNumber": ""
    },
    "BillingAddress": {
        "FirstName": "IAN",
        "LastName": "HARTHAN",
        "Company": "",
        "Address1": "69 BREEZE HILL ROAD",
        "Address2": "",
        "City": "OLDHAM",
        "State": "",
        "Postcode": "OL4 5JF",
        "Country": "UNITED KINGDOM",
        "PhoneNumber": ""
    },
    "Shippingaddress": {
        "FirstName": "IAN",
        "LastName": "HARTHAN",
        "Company": "",
        "Address1": "69 BREEZE HILL ROAD",
        "Address2": "",
        "City": "OLDHAM",
        "State": "",
        "Postcode": "OL4 5JF",
        "Country": "UNITED KINGDOM",
        "PhoneNumber": ""
    },
    "OrderDate": "2023-06-13T07:29:55.563",
    "AttentionIsRequired": false,
    "IsPrime": false,
    "IsPriority": false,
    "IsAmazonBusiness": false,
    "ImportDate": "2023-06-13T07:29:55.6",
    "DespatchDate": "2023-06-13T08:05:31.937",
    "LastStatusChangeDate": "2023-06-13T08:05:31.967",
    "PaymentMethod": "",
    "PaymentID": "",
    "ChannelShippingMethod": "DEFAULT",
    "ShippingMethod": {
        "ShippingMethodID": 1417,
        "Name": "Royal Mail Tracked 48 - HV",
        "ServiceCode": "TPL"
    },
    "ShippingTrackingNumber": "JV305521704GB",
    "ShippedVia": "Royal Mail",
    "Weight": 0.0950,
    "NumberOfPackages": 1,
    "Packaging": {
        "PackagingID": 505,
        "PackagingName": "Parcel"
    },
    "PackerName": "Andreea Vizitiu",
    "PickerInstructions": "",
    "SpecialInstructions": "",
    "ContactNotes": [],
    "Currency": "GBP",
    "ExchangeRate": 1.00000,
    "Transactions": [
        {
            "TransactionID": 6798719,
            "TransactionRef": "",
            "Subtotal": 10.9900,
            "Total": 0.0000,
            "Discount": 0.0000,
            "Tax": 0.0000,
            "ShippingCost": 0.0000,
            "TransactionDate": "2023-06-13T07:29:55.633",
            "TransactionMethod": ""
        }
    ],
    "OrderLines": [
        {
            "Product": {
                "ProductID": 4907355,
                "SKU": "2200008608-4/5"
            },
            "OrderedProductSKU": "2200008608-4/5",
            "ChannelSKU": "2200008608-4/5",
            "OrderedProductName": "Paw Patrol Movie Girls T-shirt and Leggings Set Pink & Purple-4/5",
            "QuantityOrdered": 1,
            "QuantitySent": 1,
            "QuantityReturned": 0,
            "LineStatus": "Allocated",
            "SingleItemPrice": 10.9900,
            "TotalItemPriceExVat": 10.9900,
            "TotalItemPriceIncVat": 10.9900,
            "VatTotal": 0.0000,
            "RegularPrice": 9.9900,
            "TaxRate": 0.0000,
            "Discount": 0.0000,
            "IsComponent": false,
            "IsKit": false,
            "TextOption": ""
        }
    ],
    "CompanyIdentity": {
        "CompanyIdentityID": 186,
        "CompanyIdentityName": "F&F Stores"
    }
}

Get Shipment Status :

We want to be looking for orders which have OrderStatus : "Despatched" in the response and then please note we don't want to map anything except the following :

StoreFeeder Field StoreFeeder Notes Hemi Mapping Notes
OrderNumber StoreFeeder Order Number We want to map the OrderNumber with what we have stored in the Orders > Connector Order ID
ShippingTrackingNumber The tracking number assigned to the order Orders > Shipping Track Number
ShippedVia The carrier assigned to the order Orders > Shipping Carrier

Once we get the shipping details from StoreFeeder and the order status is “Ready For Shipping“ we set Orders > Update Shipping Pending = Yes, so we can trigger the shipping update to the relevant MP.

Get Return Status :

We want to be looking for orders which have OrderStatus = "Returned" OR OrderStatus = "PartReturn"and LineStatus = "Returned" then please note we dont want to map anything except the following :

StoreFeeder Field StoreFeeder Notes Hemi Mapping Hemi Notes
OrderNumber Orders > Connector Order ID
Transactions
TransactionID <v1.1>N/A We dont want to store transaction ID as we will have to push the refund to the MP and get the respective TransactionID from the MP</v1.1>
TransactionDate Order Payment > Payment Date We want to store the TransactionDateonly for transactions which have "TransactionMethod": "Refund"
<v1.4> If we receive wrong date format for some reason, we want to store the current date/time. </v1.4>
Total Order Payment > Amount Please note this amount is negative value, we need to store it as positive.
OrderLines
Product
ProductID
SKU Order Refund Row > SKU
SingleItemPrice Order Refund Row > Amount

Please note this should create the Order Payment in Hemi with: Order Payment > Type = Refund Order Payment > Status = Pending Order Payment >Process by MP = Yes Order Payment > Refund Type = Full Refund, Partial Refund (depends on the line items )

All other fields, triggers and validation are as per our standard abstraction

<v1.3> If we have more than one item refunded in StoreFeeder we will receive it item by item, so we want to make a validation and group the refunds by transaction date and if the date matches for all refunded items we want to create one refund for all products instead of creating refund per item. </v1.3>

We also want to introduce default refund reasons table called “StoreFeeder default refund reason” where we can choose a default refund reason for each account. We want to have a default reason for Return and default reason for Cancellation per each account.

Get Cancelled Status : We want to be looking for orders which have OrderStatus = "CancelledByClient" OR OrderStatus = CancelledByCustomer. Unfortunately StoreFeeder do not provide much information for a cancelled order so we are to treat each order with any of the above orderstatuses as full order cancellation. Once we receive this status we are to create a refund for the whole order with Status = Pending , Process by MP = Yes and Refund Type = Full Refund.

All other fields, triggers and validation are as per our standard abstraction

Is this article helpful?
0 0 0