Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for new IOWS API #5

Closed
Ephigenia opened this issue Dec 12, 2018 · 8 comments
Closed

Support for new IOWS API #5

Ephigenia opened this issue Dec 12, 2018 · 8 comments
Assignees

Comments

@Ephigenia
Copy link
Owner

Noticed in #4 some IKEA websites use another version of the IOWS interface. For example Ireland is requesting the availability information from here: https://www.ikea.com/ie/en/retail/iows/stores/038/item/SPR,29932181

An example response looks like this:

{
    "StoreItem": {
        "ItemNo": {
            "$": 29932181
        },
        "ItemType": {
            "$": "SPR"
        },
        "StoreNo": {
            "$": "038"
        },
        "StoreName": {
            "$": "Dublin Store"
        },
        "Availability": {
            "AvailabilityClassificationList": {
                "AvailabilityClassification": [
                    {
                        "ClassificationValue": {
                            "$": "YES"
                        },
                        "ClassificationType": {
                            "$": "STORE"
                        }
                    },
                    {
                        "ClassificationValue": {
                            "$": "YES"
                        },
                        "ClassificationType": {
                            "$": "CUSTORDER"
                        }
                    }
                ]
            },
            "AvailableStockList": {
                "AvailableStock": {
                    "AvailableStockType": {
                        "$": "STORE"
                    },
                    "InStockProbabilityCode": {
                        "$": "HIGH"
                    },
                    "InStockProbabilityReliabilityCode": {
                        "$": "HIGH"
                    },
                    "EarliestRestockDate": {
                        "$": "2018-12-13"
                    },
                    "RestockReliabilityCode": {
                        "$": "MEDIUM"
                    },
                    "AvailableStockUpdateDateTime": {
                        "$": "2018-10-15"
                    }
                }
            }
        },
        "PriceList": {},
        "ApproachEndDateSale": {
            "$": false
        },
        "StoreItemChildList": {
            "StoreItemChild": [
                {
                    "ItemNo": {
                        "$": 90217972
                    },
                    "ItemType": {
                        "$": "ART"
                    },
                    "Availability": {
                        "AvailabilityClassificationList": {
                            "AvailabilityClassification": [
                                {
                                    "ClassificationValue": {
                                        "$": "YES"
                                    },
                                    "ClassificationType": {
                                        "$": "STORE"
                                    }
                                },
                                {
                                    "ClassificationValue": {
                                        "$": "YES"
                                    },
                                    "ClassificationType": {
                                        "$": "CUSTORDER"
                                    }
                                }
                            ]
                        },
                        "AvailableStockList": {
                            "AvailableStock": {
                                "AvailableStockType": {
                                    "$": "STORE"
                                },
                                "InStockProbabilityCode": {
                                    "$": "HIGH"
                                },
                                "InStockProbabilityReliabilityCode": {
                                    "$": "HIGH"
                                },
                                "EarliestRestockDate": {
                                    "$": "2018-12-13"
                                },
                                "RestockReliabilityCode": {
                                    "$": "MEDIUM"
                                },
                                "AvailableStockUpdateDateTime": {
                                    "$": "2018-10-15"
                                }
                            }
                        }
                    },
                    "PriceList": {},
                    "SalesMethodCode": {
                        "$": "SELF_SERVE"
                    },
                    "RecommendedSalesLocation": {
                        "Aisle": {
                            "$": 16
                        },
                        "Bin": {
                            "$": "02"
                        },
                        "Department": {
                            "$": "Even number aisles"
                        }
                    },
                    "ApproachEndDateSale": {
                        "$": false
                    }
                },
                {
                    "ItemNo": {
                        "$": "00251135"
                    },
                    "ItemType": {
                        "$": "ART"
                    },
                    "Availability": {
                        "AvailabilityClassificationList": {
                            "AvailabilityClassification": [
                                {
                                    "ClassificationValue": {
                                        "$": "YES"
                                    },
                                    "ClassificationType": {
                                        "$": "STORE"
                                    }
                                },
                                {
                                    "ClassificationValue": {
                                        "$": "YES"
                                    },
                                    "ClassificationType": {
                                        "$": "CUSTORDER"
                                    }
                                }
                            ]
                        },
                        "AvailableStockList": {
                            "AvailableStock": {
                                "AvailableStockType": {
                                    "$": "STORE"
                                },
                                "InStockProbabilityCode": {
                                    "$": "HIGH"
                                },
                                "InStockProbabilityReliabilityCode": {
                                    "$": "HIGH"
                                },
                                "EarliestRestockDate": {
                                    "$": "2018-12-13"
                                },
                                "RestockReliabilityCode": {
                                    "$": "MEDIUM"
                                },
                                "AvailableStockUpdateDateTime": {
                                    "$": "2018-11-26"
                                }
                            }
                        }
                    },
                    "PriceList": {},
                    "SalesMethodCode": {
                        "$": "SELF_SERVE"
                    },
                    "RecommendedSalesLocation": {
                        "Aisle": {
                            "$": 16
                        },
                        "Bin": {
                            "$": "05"
                        },
                        "Department": {
                            "$": "Even number aisles"
                        }
                    },
                    "ApproachEndDateSale": {
                        "$": false
                    }
                }
            ]
        }
    }
}
@srokatonie
Copy link

@Ephigenia I get "Access denied" when hitting https://www.ikea.com/ie/en/retail/iows/stores/038/item/SPR,29932181

@Ephigenia
Copy link
Owner Author

Yes, that's probably some of the HTTP headers that the browser usually sends are required. I didn’t have time to reverse engineer which one is required. Usually, it’s the session cookie in the cookie header or just the referer.

@srokatonie
Copy link

@Ephigenia I'll see what I can do.

@patrys666
Copy link

How to fix 403 error?

@Ephigenia
Copy link
Owner Author

@patrys666 please provide more information about the 403 error you’re receiving. Please provide an example request URL and parameters or example call you’re making in the cli.

@patrys666
Copy link

@Ephigenia

You don't have permission to access "http://iows.ikea.com/retail/iows/pl/pl/stores/availability/90210490" on this server.
Reference #18.df710617.1590422538.10587b88

@Ephigenia
Copy link
Owner Author

@patrys666 I’ve created a separate issue for the issue you reported in #9. Please refer to it.

@Ephigenia Ephigenia self-assigned this Sep 18, 2020
@stevenpcc
Copy link

I wrote some software that used this API a few years back. Here are the headers I used. They worked consistently and never had to be updated.

{ 'Consumer' => 'MAMMUT', 'Contract' => '37249', 'Accept' => 'application/vnd.ikea.iows+json;version=1.0', 'Origin' => 'https://order.ikea.com', 'Referer' => 'https://order.ikea.com/gb/en/checkout/shoppinglist/' }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants