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

Invalid path provided in patch at index of 0. #4228

Open
liuzhenggang opened this issue Oct 14, 2024 · 1 comment
Open

Invalid path provided in patch at index of 0. #4228

liuzhenggang opened this issue Oct 14, 2024 · 1 comment
Assignees

Comments

@liuzhenggang
Copy link

I am using the patchListingsItem interface (/listings/2021-08-01/items/{sellerId}/{sku}) to update the price attribute of the listing, and the payload is as follows:

{
    "productType": "MECHANICAL_BELT",
    "patches": [
        {
            "op": "replace",
            "path":"/attributes/purchasable_offer",
            "value":[
                {
                "our_price": [
                    {
                        "schedule": [
                            {
                                "value_with_tax": 14.47
                            }
                        ]
                    }
                ]
                }
            ]
        }
    ]
}

The modification was successful at this point.
However, when I modify the message as follows, the interface will return an error message. “Invalid path provided in patch at index of 0.

{
    "productType": "MECHANICAL_BELT",
    "patches": [
        {
            "op": "replace",
            "path":"/attributes/purchasable_offer/0",
            "value":{
                "marketplace_id": "ATVPDKIKX0DER",
                "currency": "USD",
                "our_price": [
                    {
                        "schedule": [
                            {
                                "value_with_tax": 14.47
                            }
                        ]
                    }
                ]
			}
        }
    ]
}

Is the interface not following the JSON Patch specification?

@jawheral jawheral self-assigned this Oct 14, 2024
@jawheral
Copy link

Hi @liuzhenggang,

Only patching of the full top-level attribute is supported currently. You need to replace the full purchasable_offer.
If you, however, have multiple offers with a different audience, currency or marketplace - see here - you can update a certain offer only by providing the audience, currency and marketplace_id that you need to update.

Best,
Jawher
Selling Partner Developer Services

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

No branches or pull requests

2 participants