PHP code example of torreycommerce / acenda-php-sdk
1. Go to this page and download the library: Download torreycommerce/acenda-php-sdk library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
torreycommerce / acenda-php-sdk example snippets
// Autoloading of your dependecies.
_CLIENT_ID_,
_CLIENT_SECRET_,
_STORE_NAME_);
$acenda->get('/order', [
'limit' => 1,
'attributes' => 'id'
]);
/**
** Response example
** object(Acenda\Response)#16 (2) {
** ["code"]=>
** int(200)
** ["body"]=>
** object(stdClass)#14 (4) {
** ["code"]=>
** int(200)
** ["status"]=>
** string(2) "OK"
** ["num_total"]=>
** int(1)
** ["result"]=>
** array(1) {
** [0]=>
** object(stdClass)#15 (1) {
** ["id"]=>
** int(3398553)
** }
** }
** }
** }
**/
}catch (Exception $e){
/*
** Two types of exceptions are thrown,
** AcendaException which are Acenda HTTP request related,
** And Exception which are usage and PHP related.
*/
var_dump($e);
}