https://github.com/best-brands/sendcloud-shipping-api
A SendCloud API client with full object mapping
https://github.com/best-brands/sendcloud-shipping-api
api-client sendcloud sendcloud-api
Last synced: 28 days ago
JSON representation
A SendCloud API client with full object mapping
- Host: GitHub
- URL: https://github.com/best-brands/sendcloud-shipping-api
- Owner: best-brands
- Created: 2020-06-12T11:57:31.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-04-19T20:08:40.000Z (almost 3 years ago)
- Last Synced: 2025-06-13T18:48:46.525Z (9 months ago)
- Topics: api-client, sendcloud, sendcloud-api
- Language: PHP
- Homepage: https://packagist.org/packages/harm-smits/sendcloud-shipping-api
- Size: 63.5 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# A working API for a shitty API
A simple API that supports almost all calls and which is mapped to objects accordingly.
## Initialize the client as follows and work with the api
```php
$client = new \HarmSmits\SendCloudClient\Client(
"...",
"..."
);
```
Going over all parcels is really easy:
```php
$cursor = null;
while (($result = $client->getParcels($cursor))) {
$cursor = $result->getNext();
foreach ($result->getParcels() as $parcel) {
...
}
}
```
Statuses work likewise:
```php
foreach ($client->getParcelStatuses() as $parcelStatus) {
...
}
```
Same for brands:
```php
$cursor = null;
while (($result = $client->getBrands($cursor))) {
$cursor = $result->getNext();
foreach ($result->getBrands() as $brand) {
...
}
}
```
Everything can be done asynchronously as well
```php
$promise = $client->asyncGetParcelStatuses();
...
$result = $promise->wait();
```
## The following methods can be used directly from the client, suffix with `Async` if you want to get a promise.
* getParcels
* getParcel
* createParcel
* createParcels
* updateParcel
* cancelOrDeleteParcel
* getParcelReturnPortalUrl
* getParcelDocuments
* getParcelStatuses
* getReturns
* getReturn
* getBrands
* getBrand
* getShippingMethods
* getShippingMethod
* getPdfLabel
* getBulkPdfLabel
* getUser
* getInvoices
* getInvoice
* getSenderAddresses
* getSenderAddress
* getIntegrations