square-php-sdk
square-php-sdk copied to clipboard
Request to create an item variation through the UpsertCatalogObject call using POST /v2/catalog/object endpoint creates additional variation "Regular"
I used the UpsertCatalogObject API using these information.
Application ID sandbox-xxxxx--XXXXXXXXXXX Merchant ID XXXXXXXXXXX API Catalog Endpoint NameUpsertCatalogObject Status 200 Path POST /v2/catalog/object Square Version 2020-09-23 User Agent Square-PHP-SDK/6.4.0.20200923 Timestamp 6/13/2021, 12:04:52 PM GMT+5:30
{ "idempotency_key": "60c5a70b1f115", "object": { "type": "ITEM_VARIATION", "id": "#8ed1fc15", "item_variation_data": { "item_id": "TM22UNGDY53S7I4B4EGI7AJX", "name": "A1", "sku": "4cda8f53", "pricing_type": "FIXED_PRICING", "price_money": { "amount": 1000, "currency": "USD" } } } }
And got this response from the API.
{ "catalog_object": { "type": "ITEM_VARIATION", "id": "XXXXXXXXXXXXXXXX", "updated_at": "2021-06-13T06:34:52.166Z", "version": 1623566092166, "is_deleted": false, "present_at_all_locations": true, "item_variation_data": { "item_id": "XXXXXXXXXXXXXXXX", "name": "A1", "sku": "4cda8f53", "pricing_type": "FIXED_PRICING", "price_money": { "amount": 1000, "currency": "USD" } } }, "id_mappings": [ { "client_object_id": "#8ed1fc15", "object_id": "XXXXXXXXXXXXXXXX" } ] }
I only gave one variant to create, but, it created an additional variant "Regular" when I checked in the Squareup items dashboard.
Any idea why this is happening ?
@jishcem this doesn't seem to be a bug with the SDK, though maybe with the API. I'm not as familiar with the workings of each API. This would be a great question to ask on our developer forums, developer Slack, or by contacting support directly.
Hi @jishcem,
We are closing this issue due to inactivity. If you have further questions around this topic, please do ask about it on our developer forums or developer Slack