# Square Catalog API Upset Version number

**URL:** <https://developer.squareup.com/forums/t/square-catalog-api-upset-version-number/23559>\
**Category:** Questions\
**Tags:** catalog-api\
**Created:** [August 7, 2025, 2:43pm UTC](https://developer.squareup.com/forums/t/square-catalog-api-upset-version-number/23559 "2025-08-07T14:43:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![shayne](https://avatars.discourse-cdn.com/v4/letter/s/5fc32e/32.png) [@shayne](https://developer.squareup.com/forums/u/shayne)\
**Post date:** [August 7, 2025, 2:43pm UTC](https://developer.squareup.com/forums/t/square-catalog-api-upset-version-number/23559/1 "2025-08-07T14:43:38Z")

</div>

When upserting an object using the Catalog API. Where do we get this `version` number that is required to update the object? Passing the version number returned when the object was created returns `Object version does not match latest database version.`

Omitting the version number returns the same error.

`version` integer(64-bit)

The version of the object. When updating an object, the version supplied must match the version in the database, otherwise the write will be rejected as conflicting.

---

<div class="post-metadata">

**Author:** ![Square-Dev-AI](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/square-dev-ai/32/2513_2.png) [@Square-Dev-AI](https://developer.squareup.com/forums/u/Square-Dev-AI)\
**Post date:** [August 7, 2025, 2:43pm UTC](https://developer.squareup.com/forums/t/square-catalog-api-upset-version-number/23559/2 "2025-08-07T14:43:52Z")

</div>

👋 I’m Square Dev AI, here to help answer your question!  
Based on the information you’ve provided, the following documentation will help answer your question:

> **[Update Catalog Objects](https://developer.squareup.com/docs/catalog-api/update-catalog-objects)**
>
> The UpsertCatalogObject endpoint updates one item at a time, whereas the BatchUpsertCatalogObjects endpoint can update multiple objects at the same time.

> **[Retrieve Catalog Objects](https://developer.squareup.com/docs/catalog-api/retrieve-catalog-objects)**
>
> Learn how to retrieve Square catalog objects of given IDs or versions using the Catalog API.

> **Additional Documentation**
>
> [Catalog API Webhooks](https://developer.squareup.com/docs/catalog-api/webhooks)  
> [Synchronize a Catalog with an External Platform](https://developer.squareup.com/docs/catalog-api/sync-with-external-system)  
> [Versioning in the Square API](https://developer.squareup.com/docs/build-basics/versioning)

If this documentation helped you find a solution, please check the box indicating that this reply solves the problem.  
Otherwise one of our Developer Advocates will provide additional assistance shortly.

---

<div class="post-metadata">

**Author:** ![Square-Dev-AI](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/square-dev-ai/32/2513_2.png) [@Square-Dev-AI](https://developer.squareup.com/forums/u/Square-Dev-AI)\
**Post date:** [August 7, 2025, 4:35pm UTC](https://developer.squareup.com/forums/t/square-catalog-api-upset-version-number/23559/3 "2025-08-07T16:35:13Z")

</div>

When upserting an object using the Catalog API, the `version` number is crucial for ensuring that you are updating the most current version of the object. This is part of the optimistic concurrency control mechanism that prevents conflicting updates.

To get the correct `version` number for an object, you should retrieve the object using the `RetrieveCatalogObject` endpoint before performing an update. This endpoint will return the current version number of the object, which you can then use in your upsert request. If you attempt to use an outdated version number, you will encounter the “Object version does not match latest database version” error, indicating that the object has been modified since you last retrieved it.

Therefore, always ensure you have the latest version number by retrieving the object just before you perform an update.

_This answer was reviewed by @Bryan-Square._
