{"_id":"54cc2149380ecd0d00ca18bd","__v":0,"category":{"_id":"54cc2149380ecd0d00ca18b2","project":"5436a1e1d0ffee0e00f18f8c","__v":2,"version":"54cc2148380ecd0d00ca18aa","pages":["54cc2149380ecd0d00ca18bc","54cc2149380ecd0d00ca18bd","54cc2149380ecd0d00ca18be","54cc2149380ecd0d00ca18bf","54cc2149380ecd0d00ca18c0","54cc2149380ecd0d00ca18c1","54cc2149380ecd0d00ca18c2","55cbcc534cf2180d00bb1bf4"],"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2014-10-30T14:26:30.616Z","from_sync":false,"order":7,"slug":"php-client","title":"PHP client"},"user":"5436a1afb7cf0e1c0020d9ca","version":{"_id":"54cc2148380ecd0d00ca18aa","__v":2,"forked_from":"5436a1e1d0ffee0e00f18f8f","project":"5436a1e1d0ffee0e00f18f8c","createdAt":"2015-01-31T00:26:48.753Z","releaseDate":"2015-01-31T00:26:48.753Z","categories":["54cc2149380ecd0d00ca18ab","54cc2149380ecd0d00ca18ac","54cc2149380ecd0d00ca18ad","54cc2149380ecd0d00ca18ae","54cc2149380ecd0d00ca18af","54cc2149380ecd0d00ca18b0","54cc2149380ecd0d00ca18b1","54cc2149380ecd0d00ca18b2","54cc2149380ecd0d00ca18b3","552f29ca633a5b0d00e99d09"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.1.0","version":"1.1"},"project":"5436a1e1d0ffee0e00f18f8c","parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2014-10-30T14:29:55.355Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"auth":"never","params":[],"url":""},"isReference":false,"order":1,"body":"[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Installation\"\n}\n[/block]\nObtain the latest version of the ShippingEasy PHP bindings with:\n\n`git clone https://github.com/ShippingEasy/shipping_easy-php`\n\nTo get started, add the following to your PHP script:\n\n`require_once(\"/path/to/shipping_easy-php/lib/ShippingEasy.php\");`\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Configuration\"\n}\n[/block]\nYou will need a ShippingEasy API key and secret to sign your API requests. These can be found in your account's settings (https://app.shippingeasy.com/settings/api_credentials).\n\nOnce you have the credentials, add them to the libary's configuration:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"ShippingEasy::setApiKey('d8e8fca2dc0f896fd7cb4cb0031ba249');\\nShippingEasy::setApiSecret('XXX');\",\n      \"language\": \"php\"\n    }\n  ]\n}\n[/block]\nIf you are a 3rd party plugin developer and have a staging account with ShippingEasy, you can change the endpoint like so:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"ShippingEasy::setApiBase('https://staging.shippingeasy.com');\",\n      \"language\": \"php\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Tests\"\n}\n[/block]\nIn order to run tests you have to install [SimpleTest](http://packagist.org/packages/vierbergenlars/simpletest) via [Composer](http://getcomposer.org/) (recommended way):\n\n`composer.phar update --dev`\n\nRun the test suite:\n\n`php ./test/ShippingEasy.php`","excerpt":"","slug":"php-getting-started","type":"basic","title":"Getting Started"}
[block:api-header] { "type": "basic", "title": "Installation" } [/block] Obtain the latest version of the ShippingEasy PHP bindings with: `git clone https://github.com/ShippingEasy/shipping_easy-php` To get started, add the following to your PHP script: `require_once("/path/to/shipping_easy-php/lib/ShippingEasy.php");` [block:api-header] { "type": "basic", "title": "Configuration" } [/block] You will need a ShippingEasy API key and secret to sign your API requests. These can be found in your account's settings (https://app.shippingeasy.com/settings/api_credentials). Once you have the credentials, add them to the libary's configuration: [block:code] { "codes": [ { "code": "ShippingEasy::setApiKey('d8e8fca2dc0f896fd7cb4cb0031ba249');\nShippingEasy::setApiSecret('XXX');", "language": "php" } ] } [/block] If you are a 3rd party plugin developer and have a staging account with ShippingEasy, you can change the endpoint like so: [block:code] { "codes": [ { "code": "ShippingEasy::setApiBase('https://staging.shippingeasy.com');", "language": "php" } ] } [/block] [block:api-header] { "type": "basic", "title": "Tests" } [/block] In order to run tests you have to install [SimpleTest](http://packagist.org/packages/vierbergenlars/simpletest) via [Composer](http://getcomposer.org/) (recommended way): `composer.phar update --dev` Run the test suite: `php ./test/ShippingEasy.php`