Created
August 17, 2017 23:51
-
-
Save tristansokol/91e0085d7cb9aae762ef1b64bb804a85 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
require_once(__DIR__ . '/vendor/autoload.php'); | |
// Configure OAuth2 access token for authorization: oauth2 | |
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('xxx'); | |
$api_instance = new SquareConnect\Api\CatalogApi(); | |
$body = new \SquareConnect\Model\UpsertCatalogObjectRequest( | |
array("idempotency_key"=>uniqid(), | |
"object"=>array( | |
"type"=>"CATEGORY", | |
"id"=>"#Drinks", | |
"category_data"=>array( | |
"name"=>"Drinks" | |
) | |
) | |
) | |
); | |
try { | |
$result = $api_instance->upsertCatalogObject($body); | |
print_r($result); | |
} catch (Exception $e) { | |
echo 'Exception when calling CatalogApi->upsertCatalogObject: ', $e->getMessage(), PHP_EOL; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment