Download the PHP package alsendo/alsendo-one-sdk without Composer

On this page you can find all versions of the php package alsendo/alsendo-one-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package alsendo-one-sdk

AlsendoOne SDK

Latest Stable Version PHP Version License

Official PHP client for Apaczka API v2. Ship parcels with 20+ couriers through a single integration.

Requirements

Installation

If you want to use the built-in Guzzle adapter, also install Guzzle:

Quick start

Authentication

Every API request is signed with HMAC-SHA256. The SDK handles this automatically -- you only need to provide your app_id and app_secret when creating the client.

The signature is computed from four components:

Each signature is valid for 15 minutes. The SDK generates expires timestamps internally, so there is nothing to manage on your end.

For endpoints without parameters the SDK signs and sends {} (an empty JSON object), while the official API examples sign [] (an empty JSON array) — the API accepts both, but the two payloads produce different signatures, so don't mix the SDK with hand-rolled signing code for the same request.

You can obtain your API credentials in the Apaczka panel under Settings > API.

Available methods

Service structure

Method Description
getServiceStructure() Get available services, options, and package types

Access points

Method Description
getPoints(string $supplier, string $countryCode = 'PL', string $subtype = '') Get pickup/drop-off points for a courier (e.g. InPost lockers)

Notes:

Pricing

Method Description
getValuation(array $orderData) Get a price quote for given shipment parameters. Prices are returned in groszy (1 PLN = 100 groszy)

Orders

Method Description
sendOrder(array $orderData) Create a new shipment order
getOrder(int $orderId) Get details of a single order
getOrders(int $page = 1, int $limit = 10) List orders with pagination (max 25 per page)
cancelOrder(int $orderId) Cancel an order

Pickup scheduling

Method Description
getPickupHours(string $postalCode, ?Service $service = null) Get available pickup time windows for a postal code
schedulePickup(int $orderId, string $date, string $hourFrom, string $hourTo) Schedule courier pickup for one order
scheduleBatchPickup(array $orderIds, string $date, string $hourFrom, string $hourTo) Schedule courier pickup for multiple orders

Tracking

Method Description
getTracking(string $waybillNumber) Get tracking events (normalized status, carrier status, place, timestamp) for a waybill

Documents

Method Description
getWaybill(int $orderId) Get shipping label as base64-encoded PDF
getTurnIn(array $orderIds) Get batch turn-in confirmation as base64-encoded PDF
getDispatchCode(int $orderId) Get carrier dispatch/return code for an order

Account (privileged)

These endpoints require dedicated partner privileges on the calling application.

Method Description
registerCustomer(CustomerRegisterRequest\|array $customerData) Register a new customer account; returns provisioned API credentials
checkData(string $vatId) Validate a VAT id (rate-limited to 100 calls/day); throws on an invalid id

Raw request

Method Description
request(string $route, array $params = []) Send a signed request to any API endpoint. Returns a Response object

All client methods are also described by AlsendoClientInterface — type-hint the interface in your application to keep the client mockable in tests.

Tracking webhooks

When you create an order with push_tracking_url, the platform POSTs a signed JSON notification to that URL on every status change. Use PushTrackingWebhook to verify the signature (computed with your own app_secret) and parse the payload:

Notes:

Error handling

The SDK throws exceptions extending AlsendoOne\SDK\Exception\AlsendoException:

The API does not distinguish authentication or validation failures by status code (everything is 400) — inspect the exception message if you need to tell them apart.

Custom HTTP client

The SDK uses Guzzle by default. You can replace it with any HTTP client by implementing HttpClientInterface:

The bundled adapter accepts any Guzzle config options — for example to raise the timeouts (defaults: 30 s request, 10 s connect):

Retry and logging decorators

Two optional decorators wrap any HttpClientInterface implementation:

RetryingHttpClient retries only network failures (ConnectionException), never API error envelopes. Beware: a network failure does not guarantee the request did not reach the server — retrying non-idempotent operations such as sendOrder() may create duplicate orders.

LoggingHttpClient logs the URL, statuses and duration through any PSR-3 logger; request parameters (credentials, signed payload) are never logged.

Sandbox

To test against the sandbox environment, pass AlsendoClient::SANDBOX_URL as the base URL (sandbox credentials are separate from production ones):

Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/my-feature)
  3. Make your changes
  4. Run the test suite and static analysis:

  5. Commit and push your branch
  6. Open a pull request against main

Please follow PSR-12 coding standards.

License

This package is open-source software licensed under the MIT License.


All versions of alsendo-one-sdk with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
ext-json Version *
composer-runtime-api Version ^2.1
psr/log Version ^1.1 || ^2.0 || ^3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package alsendo/alsendo-one-sdk contains the following files

Loading the files please wait ...