{"id":28325783,"url":"https://github.com/picqer/sendcloud-php-client","last_synced_at":"2025-06-24T03:31:07.034Z","repository":{"id":21315343,"uuid":"24631920","full_name":"picqer/sendcloud-php-client","owner":"picqer","description":"PHP Client for SendCloud API","archived":false,"fork":false,"pushed_at":"2025-04-24T19:42:14.000Z","size":96,"stargazers_count":41,"open_issues_count":1,"forks_count":45,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-06-02T07:25:49.035Z","etag":null,"topics":["parcel","php","php-client","sendcloud","sendcloud-api"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"LarryMad/recipes","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/picqer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2014-09-30T09:12:15.000Z","updated_at":"2025-04-26T09:09:12.000Z","dependencies_parsed_at":"2025-05-25T22:08:38.985Z","dependency_job_id":"9d2743c1-61d7-4cb1-936c-535564e7b77a","html_url":"https://github.com/picqer/sendcloud-php-client","commit_stats":{"total_commits":83,"total_committers":26,"mean_commits":"3.1923076923076925","dds":0.8192771084337349,"last_synced_commit":"8c4290571c9d58c92f064e21945eddca6ab7f4d7"},"previous_names":[],"tags_count":38,"template":false,"template_full_name":null,"purl":"pkg:github/picqer/sendcloud-php-client","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/picqer%2Fsendcloud-php-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/picqer%2Fsendcloud-php-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/picqer%2Fsendcloud-php-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/picqer%2Fsendcloud-php-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/picqer","download_url":"https://codeload.github.com/picqer/sendcloud-php-client/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/picqer%2Fsendcloud-php-client/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261598687,"owners_count":23182814,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["parcel","php","php-client","sendcloud","sendcloud-api"],"created_at":"2025-05-25T22:08:30.155Z","updated_at":"2025-06-24T03:31:07.026Z","avatar_url":"https://github.com/picqer.png","language":"PHP","readme":"Sendcloud PHP API Client\n==========\nAn unofficial client for the Sendcloud API. More info about Sendcloud on https://www.sendcloud.nl/ Below are some examples on the usage of this client.\n\nFull docs of the Sendcloud API can be found on [https://docs.sendcloud.sc/api/v2/index.html](https://api.sendcloud.dev/docs/sendcloud-public-api/getting-started)\n\n## Installation\nThis project can easily be installed through Composer.\n\n```\ncomposer require picqer/sendcloud-php-client\n```\n\n## Set-up connection\nPrepare the client for connecting to Sendcloud with your API key and API secret. (Optionally you can send your Partner id as 3rd param.)\n```php\n$connection = new \\Picqer\\Carriers\\SendCloud\\Connection('apikey', 'apisecret');\n$sendcloudClient = new \\Picqer\\Carriers\\SendCloud\\SendCloud($connection);\n```\n\n## Get all parcels\nReturns an array of Parcel objects\n```php\n$parcels = $sendcloudClient-\u003eparcels()-\u003eall();\n```\n\n## Get a single parcel\nReturns a Parcel object\n```php\n$parcel = $sendcloudClient-\u003eparcels()-\u003efind(2342);\n```\n\n## Create a new parcel\n```php\n$parcel = $sendcloudClient-\u003eparcels();\n\n$parcel-\u003eshipment = 10; // Shipping method, get possibilities from $sendCloud-\u003eshippingMethods()-\u003eall()\n\n$parcel-\u003ename = 'John Smith';\n$parcel-\u003ecompany_name = 'ACME';\n$parcel-\u003eaddress = 'Wellingtonstreet 25';\n$parcel-\u003ecity = 'Wellington';\n$parcel-\u003epostal_code = '3423 DD';\n$parcel-\u003ecountry = 'NL';\n$parcel-\u003eorder_number = 'ORDER2014-52321';\n\n$parcel-\u003erequestShipment = true; // Specifically needed to create a shipment after adding the parcel\n\n$parcel-\u003esave();\n```\n\n## Getting label from parcel\n```php\n$labelUrl = $parcel-\u003egetPrimaryLabelUrl();\n\n$documentDownloader = new \\Picqer\\Carriers\\SendCloud\\DocumentDownloader($connection);\n$labelContents = $documentDownloader-\u003egetDocument($labelUrl, 'pdf');\n```\n\n## Exceptions\nActions to the API may cause an Exception to be thrown in case something went wrong\n```php\ntry {\n    $parcel-\u003esave();\n} catch (SendCloudApiException $e) {\n    throw new Exception($e-\u003egetMessage());\n}\n```\n\n## Create an international parcel\n```php\n$parcel = $sendcloudClient-\u003eparcels();\n\n$parcel-\u003eshipment = 9; // Shipping method, get possibilities from $sendCloud-\u003eshippingMethods()-\u003eall()\n\n$parcel-\u003ename = 'John Smith';\n$parcel-\u003ecompany_name = 'ACME';\n$parcel-\u003eaddress = 'Wellingtonstreet 25';\n$parcel-\u003ecity = 'Wellington';\n$parcel-\u003epostal_code = '3423 DD';\n$parcel-\u003ecountry = 'CH';\n$parcel-\u003eorder_number = 'ORDER2014-52321';\n$parcel-\u003eweight = 20.4;\n\n// For international shipments\n$parcel-\u003ecustoms_invoice_nr = 'ORD9923882';\n$parcel-\u003ecustoms_shipment_type = 2; // Commercial goods\n$parcel-\u003eparcel_items = [\n    [\n        'description' =\u003e 'Cork',\n        'quantity' =\u003e 2,\n        'weight' =\u003e 10.2,\n        'value' =\u003e 12.93,\n        'hs_code' =\u003e '992783',\n        'origin_country' =\u003e 'CN',\n    ]\n];\n\n$parcel-\u003erequestShipment = true; // Specifically needed to create a shipment after adding the parcel\n\n$parcel-\u003esave();\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpicqer%2Fsendcloud-php-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpicqer%2Fsendcloud-php-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpicqer%2Fsendcloud-php-client/lists"}