# Understanding error message - INVALID\_VALUE

**URL:** <https://developer.squareup.com/forums/t/understanding-error-message-invalid-value/3349>\
**Category:** Questions\
**Tags:** catalog-api\
**Created:** [August 31, 2021, 7:56pm UTC](https://developer.squareup.com/forums/t/understanding-error-message-invalid-value/3349 "2021-08-31T19:56:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![heather](https://avatars.discourse-cdn.com/v4/letter/h/9f8e36/32.png) [@heather](https://developer.squareup.com/forums/u/heather)\
**Post date:** [August 31, 2021, 7:56pm UTC](https://developer.squareup.com/forums/t/understanding-error-message-invalid-value/3349/1 "2021-08-31T19:56:25Z")

</div>

I am trying to understand this error message. I know “INVALID\_VALUE” means that my application sent a value the Square did not expect; however, it seems to be suggesting that the “type” parameter is incorrect (when I think it is correct, comparing it to successful API calls). I tried removing the empty `version` parameter, which had no effect.

The data sent to the `upsert_catalog_object` call:

```auto
{
  "object":
  {
    "type": "ITEM",
    "id": "6Y33BADCNVPT2BE33NTTOIL3",
    "product_type": "REGULAR",
    "item_data":
    {
      "name": "Testing",
      "description": "Testing",
      "abbreviation": "Testing",
      "available_online": true,
      "available_for_pickup": true,
      "category_id": "I3PO3ELB4Z6UMQ47R2YE4FLS",
      "variations":
      [
        {
          "id": "#child387",
          "type": "ITEM_VARIATION",
          "present_at_locations_ids": [],
          "item_variation_data":
          {
            "name": "Testing",
            "price_money": {"amount": 10000, "currency": "USD"},
            "pricing_type": "FIXED_PRICING",
            "sku": "327",
            "stockable": true,
            "track_inventory": true,
            "upc": ""
          },
          "version": null
        }
      ]
    },
    "version": 1629385868350
  },
  "idempotency_key": "61c4262bc28a4be88c43effe6dc1d8e2"
}

```

The response:

```auto
[
  {
    "category": "INVALID_REQUEST_ERROR", 
    "code": "INVALID_VALUE", 
    "detail": "Invalid object: Invalid Object with Id: 6Y33BADCNVPT2BE33NTTOIL3\n[merchant_token=<token>] Updated object 6Y33BADCNVPT2BE33NTTOIL3 has incorrect type 1 (5 expected)."
  }
]

```

Using the Python SDK.

---

<div class="post-metadata">

**Author:** ![Bryan-Square](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/bryan-square/32/38_2.png) [@Bryan-Square](https://developer.squareup.com/forums/u/Bryan-Square)\
**Post date:** [September 1, 2021, 3:28pm UTC](https://developer.squareup.com/forums/t/understanding-error-message-invalid-value/3349/2 "2021-09-01T15:28:48Z")

</div>

The request was trying to upsert an existing object `6Y33BADCNVPT2BE33NTTOIL3` , but it changed the `type` field from `ITEM_VARIATION` to `ITEM` . Changing the type of an existing object isn’t allowed. The error message is definitely bad and our team is going to make the necessary adjustments. 🙂

---

<div class="post-metadata">

**Author:** ![heather](https://avatars.discourse-cdn.com/v4/letter/h/9f8e36/32.png) [@heather](https://developer.squareup.com/forums/u/heather)\
**Post date:** [September 2, 2021, 1:31pm UTC](https://developer.squareup.com/forums/t/understanding-error-message-invalid-value/3349/3 "2021-09-02T13:31:20Z")

</div>

Ah, that makes more sense. Thank you!
