Using Square’s endpoint API I wrote a script to create a bundle of a small and large coffee that can be sold as a “single line” within an invoice from the Dashboard or the client’s website, neglecting the need for adding both items individually. However, this does not work and I keep getting the following error:
result = client.catalog.upsert_catalog_object(
body={
"idempotency_key": str(idempotency_key),
"object": {
"type": "ITEM",
"id": "#Cocoa_bundle",
"item_data": {
"name": "Cocoa Bundle",
"description": "Hot Chocolate Bundle of Small and Large sizes",
"abbreviation": "CB",
"item_variation_ids": ["H6EK5FZ4MMJB56FFASFNYZXC", "NZGVV7TXJHVUMNQAY743FRQX"],
"track_inventory": False,
}
}
}
)
Response:
"category": "INVALID_REQUEST_ERROR",
"code": "BAD_REQUEST",
"detail": "Item with name Cocoa Bundle and token #Cocoa_bundle must have at least one variation."
However, creating an item with “variations” will ultimately create a new inventory item which is not what want. It needs to be an item linked to the variations: item_variation_ids
.