Skip to content

toppynl/sendcloud-v2-php-client

Repository files navigation

toppy/sendcloud-client

Complete Sendcloud API v2 specification - merged from official sendcloud.dev documentation

For more information, please visit https://sendcloud.dev.

Installation & Usage

Requirements

PHP 7.2 and later.

Composer

To install the bindings via Composer, add the following to composer.json:

{
  "repositories": [
    {
      "type": "vcs",
      "url": "https://github.com/GIT_USER_ID/GIT_REPO_ID.git"
    }
  ],
  "require": {
    "GIT_USER_ID/GIT_REPO_ID": "*@dev"
  }
}

Then run composer install

Your project is free to choose the http client of your choice Please require packages that will provide http client functionality: https://packagist.org/providers/psr/http-client-implementation https://packagist.org/providers/php-http/async-client-implementation https://packagist.org/providers/psr/http-factory-implementation

As an example:

composer require guzzlehttp/guzzle php-http/guzzle7-adapter http-interop/http-factory-guzzle

Manual Installation

Download the files and include autoload.php:

<?php
require_once('/path/to/toppy/sendcloud-client/vendor/autoload.php');

Getting Started

Please follow the installation procedure and then run the following:

<?php
require_once(__DIR__ . '/vendor/autoload.php');



// Configure HTTP basic authorization: HTTPBasicAuth
$config = Toppy\Sendcloud\V2\Configuration::getDefaultConfiguration()
              ->setUsername('YOUR_USERNAME')
              ->setPassword('YOUR_PASSWORD');


$apiInstance = new Toppy\Sendcloud\V2\Api\BrandsApi(
    // If you want use custom http client, pass your client which implements `Psr\Http\Client\ClientInterface`.
    // This is optional, `Psr18ClientDiscovery` will be used to find http client. For instance `GuzzleHttp\Client` implements that interface
    new GuzzleHttp\Client(),
    $config
);

try {
    $result = $apiInstance->scPublicV2BrandsGetAllUserBrands();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling BrandsApi->scPublicV2BrandsGetAllUserBrands: ', $e->getMessage(), PHP_EOL;
}

API Endpoints

All URIs are relative to https://panel.sendcloud.sc/api/v2

Class Method HTTP request Description
BrandsApi scPublicV2BrandsGetAllUserBrands GET /brands Retrieve a list of brands
BrandsApi scPublicV2BrandsGetUserBrandById GET /brands/{id} Retrieve a brand
CustomsDocumentsDownloadApi scPublicV2ScpGetCustomsDocumentMultipleNormalPrinter GET /customs_declaration/normal_printer Retrieve multiple customs declaration PDFs
CustomsDocumentsDownloadApi scPublicV2ScpGetCustomsDocumentNormalPrinter GET /customs_declaration/normal_printer/{parcel_id} Retrieve a customs declaration PDF
IntegrationsApi scPublicV2OrdersDeleteDeleteAnIntegration DELETE /integrations/{id} Delete an integration
IntegrationsApi scPublicV2OrdersGetRetrieveAListOfIntegrations GET /integrations Retrieve a list of integrations
IntegrationsApi scPublicV2OrdersGetRetrieveAnIntegration GET /integrations/{id} Retrieve an integration
IntegrationsApi scPublicV2OrdersGetRetrieveIntegrationLogs GET /integrations/{id}/logs Retrieve exception logs for a specific integration
IntegrationsApi scPublicV2OrdersGetRetrieveIntegrationsLogs GET /integrations/logs Retrieve all integration exception logs
IntegrationsApi scPublicV2OrdersPatchPartialUpdateAnIntegration PATCH /integrations/{id} Partially update an integration
IntegrationsApi scPublicV2OrdersPostCreateIntegrationLogs POST /integrations/{id}/logs Create integration exceptions logs
IntegrationsApi scPublicV2OrdersPutUpdateAnIntegration PUT /integrations/{id} Update an integration
InvoicesApi scPublicV2ScpGetAllUserInvoices GET /user/invoices Retrieve a list of invoices
InvoicesApi scPublicV2ScpGetInvoiceById GET /user/invoices/{id} Retrieve a specific invoice
LabelDownloadApi scPublicV2ScpGetLabelDocumentLabelPrinter GET /labels/label_printer/{parcel_id} Retrieve a specific PDF label for a label printer
LabelDownloadApi scPublicV2ScpGetLabelDocumentMultipleLabelPrinter GET /labels/label_printer Retrieve PDF labels for a label printer
LabelDownloadApi scPublicV2ScpGetLabelDocumentMultipleNormalPrinter GET /labels/normal_printer Retrieve multiple PDF labels
LabelDownloadApi scPublicV2ScpGetLabelDocumentNormalPrinter GET /labels/normal_printer/{parcel_id} Retrieve a PDF label
LabelsApi scPublicV2ScpGetLabelByParcelId GET /labels/{parcel_id} Retrieve a label for a specific parcel
LabelsApi scPublicV2ScpPostLabelByParcelIds POST /labels Bulk PDF label printing
ParcelStatusesApi scPublicV2ScpGetRetrieveAllParcelStatuses GET /parcels/statuses Retrieve a list of parcel statuses
ParcelsApi scPublicV2ScpGetAllParcels GET /parcels Retrieve parcels
ParcelsApi scPublicV2ScpGetParcelById GET /parcels/{id} Retrieve a parcel
ParcelsApi scPublicV2ScpGetReturnPortalUrl GET /parcels/{id}/return_portal_url Retrieve a return portal URL
ParcelsApi scPublicV2ScpPostCancelSpecific POST /parcels/{id}/cancel Cancel a parcel
ParcelsApi scPublicV2ScpPostCreateParcel POST /parcels Create a parcel or parcels
ParcelsApi scPublicV2ScpPutUpdateAParcel PUT /parcels Update a parcel
ReturnsApi scPublicV2ScpGetAllReturns GET /returns Retrieve a list of returns
ReturnsApi scPublicV2ScpGetReturnById GET /returns/{id} Retrieve a return
SenderAddressApi scPublicV2AddressesGetAllSenderAddresses GET /user/addresses/sender Retrieve a list of sender addresses
SenderAddressApi scPublicV2AddressesGetSenderAddressById GET /user/addresses/sender/{id} Retrieve a sender address
ServicePointsApi scPublicV2ServicepointsGetCarriers GET /carriers Retrieve a list of service point carriers
ServicePointsApi scPublicV2ServicepointsGetCheckAvailability GET /service-points/{service_point_id}/check-availability Retrieve availability of a service point
ServicePointsApi scPublicV2ServicepointsGetServicePointById GET /service-points/{service_point_id} Retrieve a service point
ServicePointsApi scPublicV2ServicepointsGetServicePoints GET /service-points Retrieve a list of service points
ServicePointsApi scPublicV2ServicepointsGetStore GET /service-points/{shop_type}/store Create a selected service point object
ServicePointsApi scPublicV2ServicepointsPostCheckAndStore POST /service-points/check_and_store Create a selected servicepoint record after checking its availability
ServicePointsApi scPublicV2ServicepointsPostItemsFitInShipment POST /service-points/items_fit_in_shipment Service point carrier dimension check
ShipmentsApi scPublicV2OrdersGetRetrieveAListOfShipments GET /integrations/{id}/shipments Retrieve a list of shipments
ShipmentsApi scPublicV2OrdersPostCreateAListOfShipments POST /integrations/{id}/shipments Create or update a list of shipments
ShipmentsApi scPublicV2OrdersPostDeleteAShipment POST /integrations/{id}/shipments/delete Delete a shipment
ShippingMethodsApi scPublicV2ScpGetAllShippingMethods GET /shipping_methods Retrieve a list of shipping methods
ShippingMethodsApi scPublicV2ScpGetShippingMethodById GET /shipping_methods/{id} Retrieve a shipping method
TrackingApi scPublicV2TrackingGetDetailedTrackingInformation GET /tracking/{tracking_number} Retrieve tracking information of a parcel

Models

Authorization

HTTPBasicAuth

  • Type: HTTP basic authentication

OAuth2

  • Type: OAuth
  • Flow: application
  • Authorization URL: ``
  • Scopes:
    • api: Full API access

OAuth2

  • Type: OAuth
  • Flow: accessCode
  • Authorization URL: https://account.sendcloud.com/oauth2/auth
  • Scopes:
    • api: Full API access

Tests

To run the tests, use:

composer install
vendor/bin/phpunit

Author

contact@sendcloud.com

About this package

This PHP package is automatically generated by the OpenAPI Generator project:

  • API version: 2.0.0
    • Package version: 0.4.1
    • Generator version: 7.18.0
  • Build package: org.openapitools.codegen.languages.PhpClientCodegen

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published