0

I am in the midst of writing an integration between our ERP system and a new Magento 2 (version 2.2.5) website.

I have never used Magento before, and the setup of the site etc has been managed by a third party.

We have 3 websites, each with one store and one store view; NZ, AU, UK.

I am trying to create a product against our AU website, which is website ID 3.

To do so, I am sending the below request:

{
    "product": {
        "sku": "API_TEST-AU",
        "name": "Api Test AU",
        "price": 1337.00,
        "weight": 4.8,
        "visibility": 4,
        "type_id": "simple",
        "attribute_set_id": 4,
        "status": 1,
        "extension_attributes": {
            "website_ids": [
                3
            ],
            "stock_item": {
                "qty": 5,
                "is_in_stock": true
            }
        }
    }
}

However, when I send the request, the response shows that it has also been associated with website ID 1:

Postman request

Why does this happen and how do I prevent this from happening? I only want the product to be associated with the website IDs I have specified.

1

Please see the answer here

https://magento.stackexchange.com/a/241402/31830

it is the same issue, The main idea is the endpoint URL, you should use the right endpoint and the default store view for specific website

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.