You are viewing an old version of the API
Batch delete catalog objects

Deletes a set of CatalogItems based on the provided list of target IDs and returns a set of successfully deleted IDs in the response.

Deletion is a cascading event such that all children of the targeted object are also deleted. For example, deleting a CatalogItem will also delete all of its CatalogItemVariation children.

BatchDeleteCatalogObjects succeeds even if only a portion of the targeted IDs can be deleted. The response will only include IDs that were actually deleted.

Required permissions ITEMS_WRITE

Request Body

Name Description
object_ids
string [ ]

The IDs of the CatalogObjects to be deleted. When an object is deleted, other objects in the graph that depend on that object will be deleted as well (for example, deleting a CatalogItem will delete its CatalogItemVariation.

Response Fields

Name Description
errors
Error [ ]

The set of Errors encountered.

deleted_object_ids
string [ ]

The IDs of all CatalogObjects deleted by this request.

deleted_at
string

The database timestamp of this deletion in RFC 3339 format, e.g., "2016-09-04T23:59:33.123Z".

Examples for January 25th, 2020 6:27.34pm Pacific Standard Time:

UTC: 2020-01-26T02:25:34Z

Pacific Standard Time with UTC offset: 2020-01-25T18:25:34-08:00

Examples

You are viewing an old version of the API
POST /v2/catalog/batch-delete
cURL
  • cURL
  • Ruby
  • Python
  • C#
  • Java
curl https://connect.squareup.com/v2/catalog/batch-delete \
  -X POST \
  -H 'Square-Version: 2020-03-25' \
  -H 'Authorization: Bearer ACCESS_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "object_ids": [
      "W62UWFY35CWMYGVWK6TWJDNI",
      "AA27W3M2GGTF3H6AVPNB77CK"
    ]
  }'
Response JSON
{
  "deleted_object_ids": [
    "W62UWFY35CWMYGVWK6TWJDNI",
    "AA27W3M2GGTF3H6AVPNB77CK"
  ],
  "deleted_at": "2016-11-16T22:25:24.878Z"
}

Share Feedback

Thanks for visiting the Square API documentation. What's on your mind?