Created
July 26, 2017 19:51
-
-
Save tristansokol/ed7d2c00be9ba2bf3ad59ec8bb066cc5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$api_instance = new SquareConnect\Api\CatalogApi(); | |
$body = array( | |
'idempotency_key'=>uniqid(), | |
'object'=>array( | |
'type'=>'ITEM', | |
'id'=>'#temp-item-id', | |
'item_data'=>array( | |
'name'=>'Brass Tube', | |
'description'=>'Great for models', | |
'variations'=>array( | |
array( | |
'type'=>'ITEM_VARIATION', | |
'id'=>'#var0', | |
'item_variation_data'=>array( | |
'item_id'=>'#temp-item-id', | |
'name'=>'15 cm', | |
'pricing_type'=>'VARIABLE_PRICING' | |
) | |
), | |
array( | |
'type'=>'ITEM_VARIATION', | |
'id'=>'#var1', | |
'item_variation_data'=>array( | |
'item_id'=>'#temp-item-id', | |
'name'=>'30 cm', | |
'pricing_type'=>'VARIABLE_PRICING' | |
) | |
) | |
) | |
) | |
) | |
); | |
$result = $api_instance->upsertCatalogObject($body); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment