@@ -156,7 +156,15 @@ body['batches'][0]['objects'][0]['item_data']['variations'].append({})
156156body[' batches' ][0 ][' objects' ][0 ][' item_data' ][' variations' ][0 ][' type' ] = ' ITEM_VARIATION'
157157body[' batches' ][0 ][' objects' ][0 ][' item_data' ][' variations' ][0 ][' id' ] = ' #Tea_Mug'
158158body[' batches' ][0 ][' objects' ][0 ][' item_data' ][' variations' ][0 ][' present_at_all_locations' ] = True
159-
159+ body[' batches' ][0 ][' objects' ][0 ][' item_data' ][' variations' ][0 ][' item_variation_data' ] = {
160+ " item_id" : " #Tea" ,
161+ " name" : " Mug" ,
162+ " pricing_type" : " FIXED_PRICING" ,
163+ " price_money" : {
164+ " amount" : 150 ,
165+ " currency" : " USD"
166+ }
167+ }
160168
161169body[' batches' ][0 ][' objects' ].append({})
162170body[' batches' ][0 ][' objects' ][1 ][' type' ] = ' ITEM'
@@ -173,23 +181,50 @@ body['batches'][0]['objects'][1]['item_data']['variations'].append({})
173181body[' batches' ][0 ][' objects' ][1 ][' item_data' ][' variations' ][0 ][' type' ] = ' ITEM_VARIATION'
174182body[' batches' ][0 ][' objects' ][1 ][' item_data' ][' variations' ][0 ][' id' ] = ' #Coffee_Regular'
175183body[' batches' ][0 ][' objects' ][1 ][' item_data' ][' variations' ][0 ][' present_at_all_locations' ] = True
184+ body[' batches' ][0 ][' objects' ][1 ][' item_data' ][' variations' ][0 ][' item_variation_data' ] = {
185+ " item_id" : " #Coffee" ,
186+ " name" : " Regular" ,
187+ " pricing_type" : " FIXED_PRICING" ,
188+ " price_money" : {
189+ " amount" : 250 ,
190+ " currency" : " USD"
191+ }
192+ }
176193
177194body[' batches' ][0 ][' objects' ][1 ][' item_data' ][' variations' ].append({})
178195body[' batches' ][0 ][' objects' ][1 ][' item_data' ][' variations' ][1 ][' type' ] = ' ITEM_VARIATION'
179196body[' batches' ][0 ][' objects' ][1 ][' item_data' ][' variations' ][1 ][' id' ] = ' #Coffee_Large'
180197body[' batches' ][0 ][' objects' ][1 ][' item_data' ][' variations' ][1 ][' present_at_all_locations' ] = True
181-
198+ body[' batches' ][0 ][' objects' ][1 ][' item_data' ][' variations' ][1 ][' item_variation_data' ] = {
199+ " item_id" : " #Coffee" ,
200+ " name" : " Large" ,
201+ " pricing_type" : " FIXED_PRICING" ,
202+ " price_money" : {
203+ " amount" : 350 ,
204+ " currency" : " USD"
205+ }
206+ }
182207
183208body[' batches' ][0 ][' objects' ].append({})
184209body[' batches' ][0 ][' objects' ][2 ][' type' ] = ' CATEGORY'
185210body[' batches' ][0 ][' objects' ][2 ][' id' ] = ' #Beverages'
186211body[' batches' ][0 ][' objects' ][2 ][' present_at_all_locations' ] = True
212+ body[' batches' ][0 ][' objects' ][2 ][' category_data' ] = {
213+ " name" : " Beverages"
214+ }
187215
188216body[' batches' ][0 ][' objects' ].append({})
189217body[' batches' ][0 ][' objects' ][3 ][' type' ] = ' TAX'
190218body[' batches' ][0 ][' objects' ][3 ][' id' ] = ' #SalesTax'
191219body[' batches' ][0 ][' objects' ][3 ][' present_at_all_locations' ] = True
192-
220+ body[' batches' ][0 ][' objects' ][3 ][' tax_data' ] = {
221+ " name" : " Sales Tax" ,
222+ " calculation_phase" : " TAX_SUBTOTAL_PHASE" ,
223+ " inclusion_type" : " ADDITIVE" ,
224+ " percentage" : " 5.0" ,
225+ " applies_to_custom_amounts" : True ,
226+ " enabled" : True
227+ }
193228
194229
195230result = catalog_api.batch_upsert_catalog_objects(body)
0 commit comments