Skip to main content

The PHP library

Reeds Engineering
Reeds Engineering
Developer platform

The official PHP library is on Packagist as reeds-hq/reeds-sdk.

composer require reeds-hq/reeds-sdk
$reeds = new Reeds\Reeds(); // reads REEDS_CLIENT_ID and REEDS_CLIENT_SECRET
$delivery = $reeds->shipping->deliveries->create(['quote_id' => 'qt_2bX9Wn4K', 'reference' => 'ORDER-10045']);

What it does​

  • Every Shipping API call: coverage, quotes, deliveries (create, list, get, update, book, mark ready, cancel, label), the wallet, invoices and the sandbox.
  • The access token. It fetches the token and refreshes it before it expires.
  • Safe retries. Every POST carries an Idempotency-Key, and a retry reuses it. It retries after 429, 503 and dropped connections, honouring Retry-After.
  • Pages and errors. foreach walks every page of a list. Each kind of failure is its own exception class, carrying the API's errorCode, fields, docUrl and request id.
  • Webhooks. It verifies the Reeds-Signature header (both secrets while you rotate one) and returns the decoded event.
  • Types. Objects are plain arrays with the API's field names, with PHPStan and Psalm types for every one, generated from the OpenAPI file.
  • Laravel. A service provider and a Reeds facade, discovered automatically.

It needs PHP 8.1 or later and Guzzle 7 or 8. See Libraries and plugins and the guide on GitHub.

What you need to change​

Nothing. The API is unchanged, and integrations that call it directly keep working.