Skip to content

updateInventory() fails with no variations/combinations #46

@StanProg

Description

@StanProg

Hi guys,

I'm using this SDK for synchronization of the quantity of our products.

Etsy-php version: 0.12.1
PHP version: 5.5.9
OAuth version: 1.2.3

The code that I'm using is the following (sample data):

$argument = [
    'params' => [
        'listing_id' => 486961999,
    ],
    'data' => [
        'products' => [
            'json' => json_encode([
                0 => [
                    'sku' => 'HB_XXX123',
                    'offerings' => [
                        0 => [
                            'price' => '19.90',
                            'quantity' => 999,
                        ],
                    ],
                ],
            ]),
        ],
    ],
];

After calling the updateInventory() method with this argument I get an exception:

Etsy\EtsyRequestException: [1]: Invalid auth/bad request (got a 400, expected HTTP/1.1 20X or a redirect): Array
(
    [products] => [{"sku":"HB_XXX123","offerings":[{"price":"19.90","quantity":999}]}]
)

All combinations of property values must be supplied

So, in my case I do not have any combinations and yet the system requests such.

I suppose the problem is in the $argument that I'm passing to the method.

  1. Is there any way to update the quantity of a non-variation (non-combination) products?
  2. Is there a way to update only quantity, without updating the price?

Any idea @inakiabt ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions