PHPackages                             sameday-courier/php-sdk - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. sameday-courier/php-sdk

ActiveLibrary[API Development](/categories/api)

sameday-courier/php-sdk
=======================

Sameday Courier SDK for PHP

v2.4.1(1y ago)23166.1k↓29.2%17[8 issues](https://github.com/sameday-courier/php-sdk/issues)[4 PRs](https://github.com/sameday-courier/php-sdk/pulls)1MITPHPPHP ^5.6|^7.0|^8.0CI failing

Since Jan 8Pushed 5mo ago4 watchersCompare

[ Source](https://github.com/sameday-courier/php-sdk)[ Packagist](https://packagist.org/packages/sameday-courier/php-sdk)[ Docs](https://github.com/sameday-courier/php-sdk)[ RSS](/packages/sameday-courier-php-sdk/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (3)Versions (35)Used By (1)

Sameday Courier SDK for PHP
===========================

[](#sameday-courier-sdk-for-php)

[![Build Status](https://github.com/sameday-courier/php-sdk/actions/workflows/tests.yml/badge.svg)](https://github.com/sameday-courier/php-sdk/actions/workflows/tests.yml)[![Latest Stable Version](https://camo.githubusercontent.com/785044cafa12ff0dabba904510e095cda8bce43a3b01c6b1b43bf9634e4650d7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73616d656461792d636f75726965722f7068702d73646b2e737667)](https://packagist.org/packages/sameday-courier/php-sdk)

This repository contains the open source PHP SDK that allows you to access the Sameday Courier Platform from your PHP app. It was inspired by Facebook PHP-SDK.

Installation
------------

[](#installation)

The Sameday PHP SDK can be installed with [Composer](https://getcomposer.org/). Run this command:

```
$ composer require sameday-courier/php-sdk
```

Usage
-----

[](#usage)

> **Note:** This version of the Sameday SDK for PHP requires PHP 5.4 or greater.

Simple example to get available pickup points and services for a client, request a new AWB and download the PDF for it.

```
require_once __DIR__ . '/vendor/autoload.php'; // Change path as needed.

// Initialization. Change user and password as needed for your account. For testing purposes (also implies different user/password) set a third parameter to 'https://sameday-api.demo.zitec.com'.
$samedayClient = new \Sameday\SamedayClient('user', 'password');
$sameday = new \Sameday\Sameday($samedayClient);

// Get list of available pickup points for client.
$pickupPoints = $sameday->getPickupPoints(new \Sameday\Requests\SamedayGetPickupPointsRequest());
// Use first found pickup point id. These ids are different for DEMO and PROD environments. This id can be cached on your application.
$pickupPointId = $pickupPoints->getPickupPoints()[0]->getId();

// Get list of available services for client.
$services = $sameday->getServices(new \Sameday\Requests\SamedayGetServicesRequest());
// Use first service id. These ids are different for DEMO and PROD environments. This id can be cached on your application.
// This is just for example purpose. Choose the right service for your app.
// For instance if requesting with 2H service (delivery in 2 hours) and cities are different (pickup point city and recipient city) then the validation will fail.
$serviceId = $services->getServices()[0]->getId();

try {
    $awb = $sameday->postAwb(new \Sameday\Requests\SamedayPostAwbRequest(
        $pickupPointId,
        null, // Contact person id can be left to NULL and default will be used.
        new \Sameday\Objects\Types\PackageType(\Sameday\Objects\Types\PackageType::PARCEL),
        [
            // This will generate an AWB expedition with 2 parcels (packages). Only the $weight is mandatory.
            new \Sameday\Objects\ParcelDimensionsObject(0.5),
            new \Sameday\Objects\ParcelDimensionsObject(3, 15, 28, 67)
        ],
        $serviceId,
        new \Sameday\Objects\Types\AwbPaymentType(\Sameday\Objects\Types\AwbPaymentType::CLIENT), // Who pays for the AWB. CLIENT is the only allowed value.
        new \Sameday\Objects\PostAwb\Request\AwbRecipientEntityObject('Huedin', 'Cluj', 'str. Otesani', 'Nume Destinatar', '0700111111', 'destinatar.colet@gmail.com', new \Sameday\Objects\PostAwb\Request\CompanyEntityObject('nume companie SRL')), // AWB recipient. Please note that CompanyEntityObject is optional if the recipient is not company.
        0, // Insured value.
        100 // Cash on delivery value. Can be 0 if the payment was made online.
        // Other parameters may follow, see https://github.com/sameday-courier/php-sdk/blob/master/docs/reference/SamedayPostAwbRequest.md
    ));
} catch (\Sameday\Exceptions\SamedayBadRequestException $e) {
    // When request fails validation. Show the list of validation errors.
    var_dump($e->getErrors());
    exit;
} // Other exceptions may be thrown, see https://github.com/sameday-courier/php-sdk/blob/master/docs/reference.md#core-exceptions

$pdf = $sameday->getAwbPdf(new \Sameday\Requests\SamedayGetAwbPdfRequest($awb->getAwbNumber(), new \Sameday\Objects\Types\AwbPdfType(\Sameday\Objects\Types\AwbPdfType::A6)));
echo $pdf->getPdf();
```

Complete documentation, installation instructions, and examples are available [here](docs/).

Tests
-----

[](#tests)

1. [Composer](https://getcomposer.org/) is a prerequisite for running the tests. Install composer globally, then run `composer install` to install required files.
2. The tests can be executed by running this command from the root directory:

```
$ ./vendor/bin/phpunit
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](https://github.com/sameday-courier/php-sdk/blob/master/CONTRIBUTING.md) for details.

License
-------

[](#license)

Please see the [license file](https://github.com/sameday-courier/php-sdk/blob/master/LICENSE) for more information.

###  Health Score

52

—

FairBetter than 96% of packages

Maintenance49

Moderate activity, may be stable

Popularity45

Moderate usage in the ecosystem

Community20

Small or concentrated contributor base

Maturity77

Established project with proven stability

 Bus Factor1

Top contributor holds 79.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~81 days

Recently: every ~60 days

Total

27

Last Release

563d ago

Major Versions

v1.8.3 → v2.0.02021-03-12

PHP version history (3 changes)v1.0.0PHP ^5.4|^7.0

v2.0.0PHP ^5.4|^7.0|^8.0

v2.2.0PHP ^5.6|^7.0|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/dd000a18751b2240fedf9635da90afb41654db2b3a4a1b915a20d06c3741e0e2?d=identicon)[danut007ro](/maintainers/danut007ro)

---

Top Contributors

[![danut007ro](https://avatars.githubusercontent.com/u/1083134?v=4)](https://github.com/danut007ro "danut007ro (80 commits)")[![Soptareanu](https://avatars.githubusercontent.com/u/11008987?v=4)](https://github.com/Soptareanu "Soptareanu (16 commits)")[![pathristikon](https://avatars.githubusercontent.com/u/37498671?v=4)](https://github.com/pathristikon "pathristikon (4 commits)")[![adriangavanescu](https://avatars.githubusercontent.com/u/66299582?v=4)](https://github.com/adriangavanescu "adriangavanescu (1 commits)")

---

Tags

sdkcouriersameday

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/sameday-courier-php-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/sameday-courier-php-sdk/health.svg)](https://phpackages.com/packages/sameday-courier-php-sdk)
```

###  Alternatives

[appwilio/cdek-sdk

CDEK API SDK (cdek.ru)

406.5k](/packages/appwilio-cdek-sdk)[mocking-magician/coinbase-pro-sdk

Library for coinbase pro API calls

223.2k](/packages/mocking-magician-coinbase-pro-sdk)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
