PHPackages                             strawblond/strawblond-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. strawblond/strawblond-php-sdk

ActiveLibrary[API Development](/categories/api)

strawblond/strawblond-php-sdk
=============================

PHP library for the Blond.swiss API

v2.0.0(1mo ago)27MITPHPPHP ^8.2

Since Dec 14Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/strawblond/strawblond-php-sdk)[ Packagist](https://packagist.org/packages/strawblond/strawblond-php-sdk)[ RSS](/packages/strawblond-strawblond-php-sdk/feed)WikiDiscussions main Synced 2w ago

READMEChangelog (3)Dependencies (2)Versions (5)Used By (0)

Blond PHP SDK
=============

[](#blond-php-sdk)

The Blond PHP SDK provides convenient access to the Blond API for PHP applications.

Requirements
------------

[](#requirements)

- PHP 8.2 and later

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

[](#installation)

You can install the library via Composer:

```
composer require strawblond/strawblond-php-sdk
```

Note

StrawBlond is now [Blond](https://blond.swiss). The package name and the `StrawBlond\` PHP namespace are kept unchanged for backwards compatibility.

Getting started
---------------

[](#getting-started)

Basic usage looks something like this:

```
// Initialize a new SDK client using your API key
$api = new StrawBlond\StrawBlond('YOUR_API_KEY');

// Retrieve an invoice
$invoice = $api->invoice()->get('jDe2KdWYK4')->json();

// Get all paid invoices and include their contact and company relations
$invoices = $api->invoice()->all(
    filters: ['status' => 'paid'],
    include: ['contact.company'],
)->json('data');

// Create a new contact
$contact = $api->contact()->create([
    'firstname' => 'Max',
    'lastname' => 'Muster',
    'email' => 'max@muster.com'
])->json();
```

The Blond API uses personal API keys to authenticate incoming requests. You can view and manage your API keys in the [User Settings](https://app.blond.swiss/user/integrations). Your API keys carry the same permissions as your regular user account, so be sure to keep them secure!

Important

An API key acts as your user in a specific organization. You cannot access multiple organizations with a single key.

Resources
---------

[](#resources)

The SDK gives you access to all resources documented on .

```
$api = new StrawBlond\StrawBlond('YOUR_API_KEY');

// CRUD resources
$api->contact();
$api->company();
$api->project();
$api->timeTracking();
$api->invoice();
$api->offer();
$api->documentElement();
$api->product();
$api->rate();
$api->unit();

// Special resources
$api->user();
$api->member();
$api->webhook();
```

### Available methods

[](#available-methods)

All CRUD resources give you at least following request methods to call:

DescriptionMethodRetrieve a single resource`get(string $id)`Get a list of resources`all(array $filters, array $include, string $sort, int $page, ?int $perPage)`Create a resource`create(array $data)`Update a resource`update(string $id, array $changes)`Delete a resource`delete(string $id)`Some resources support additional shared operations:

DescriptionMethodAvailable onClone a resource`clone(string $id, array $overrides)`contact, product, invoice, offerRestore a soft-deleted resource`restore(string $id)`project, expense, invoice, offerConsult our documentation at  for resources that expose additional methods (like `send()` on invoices and offers).

### Invoices

[](#invoices)

Beyond the CRUD methods, `$api->invoice()` exposes:

DescriptionMethodSend an invoice`send(string $id, array $recipients, ?string $message, bool $increaseDunningLevel, bool $ccToOwner, bool $adjustDates, array $attachments)`Update the status`updateStatus(string $id, string $status, ?string $paidAt, ?float $conversionRate, bool $notifyCustomer)`Mark as paid`markAsPaid(string $id, ?string $paidAt, ?float $conversionRate, bool $notifyCustomer)`Mark as pending`markAsPending(string $id)`Mark as draft`markAsDraft(string $id)`List by status`drafts()`, `pending()`, `paid()`, `open()`, `overdue()`, `dunned()`, `scheduled()`, `readyForDelivery()` (same arguments as `all()`)Line items sub-resource`lineItems(string $invoiceId)`Payments sub-resource`payments(string $invoiceId)` — supports `all()`, `get()`, `create()` and `delete()` (payments cannot be updated)Create next recurring invoice`createNextRecurring(string $id)`Next invoice number info`nextInfo(?string $issuedAt)` — returns the upcoming `sequence` and `number`Add products as line items`addProducts(string $id, array $productIds, ?int $beforeOrder)`Add rates as line items`addRates(string $id, array $rates, ?int $beforeOrder)` — each rate is `['id' => ..., 'quantity' => ...]`Add expenses as line items`addExpenses(string $id, array $expenseIds)````
// Record a payment and mark an invoice as paid
$api->invoice()->payments('jDe2KdWYK4')->create(['amount' => 150.00]);
$api->invoice()->markAsPaid('jDe2KdWYK4', paidAt: '2026-07-15', notifyCustomer: true);
```

### Offers

[](#offers)

Beyond the CRUD methods, `$api->offer()` exposes:

DescriptionMethodSend an offer`send(string $id, array $recipients, ?string $message, bool $ccToOwner, array $attachments)`Archive an offer`archive(string $id, ?string $reason)`Complete billing`completeBilling(string $id, ?string $reason)`Reopen billing`reopenBilling(string $id)`Line items sub-resource`lineItems(string $offerId)`Add products as line items`addProducts(string $id, array $productIds, ?int $beforeOrder)`Add rates as line items`addRates(string $id, array $rates, ?int $beforeOrder)` — each rate is `['id' => ..., 'quantity' => ...]`Usage
-----

[](#usage)

Start by sending a request using one of the methods available on the resource. In this example we're trying to fetch a single invoice given a invoice ID. The `get` method returns a `Response` object.

```
$response = $api->invoice()->get('jDe2KdWYK4');
```

We can now check if the request was successful and use the fetched data in various ways:

```
if ($response->ok()) {
    // Get the response data as an json decoded array
    $invoice = $response->json();

    // Same as `json` but gets a single value from the data
    $dueDate = $response->json('due_at');

    // Get the response data as a Laravel Collection.
    // ! Requires `illuminate/collections` to be installed
    $lineItems = $response->collect('elements');
}
```

Here's another example for creating a new contact:

```
$contact = $api->contact()->create([
    'firstname' => 'Max',
    'lastname' => 'Muster',
    'email' => 'max@muster.com'
])->json();
```

See [Responses](#responses) for more methods on the `Response` object.

### Filtering

[](#filtering)

When calling the `all` method on a resource, you may pass an `filters` array to the method. (See the API reference on  for which filters are allowed on a given resource)

```
$projects = $api->project()->all(
    filters: [
        'status' => 'active',
        'billing_type' => 'flat'
    ],
)->json('data');
```

### Sorting

[](#sorting)

When calling the `all` method on a resource, you may pass a `sort` key to the method. (See the API reference on  for which sort keys are allowed on a given resource)

```
$projects = $api->project()->all(
    sort: 'starts_at'
)->json('data');
```

Sorting is **ascending by default** and can be reversed by adding a hyphen (**-**) to the start of the property name.

```
$projects = $api->project()->all(
    sort: '-starts_at'
)->json('data');
```

### Including relations

[](#including-relations)

When calling the `get` or `all` method on a resource, you may pass an `include` array to include related resources. (See the API reference on  for which resources are allowed to be included in a request)

```
$projects = $api->project()->all(
    include: ['company', 'user']
)->json('data');
```

You may also use the dot notation to include nested relations ()

### Pagination

[](#pagination)

The `all` method on most resources returns a paginated list of objects inside a `data` property. The `links` and `meta` properties contain information useful for retrieving more pages.

You can set the page using the `page` argument.

```
$projects = $api->project()->all(
    page: 2,
)->json('data');
```

Responses
---------

[](#responses)

After sending a request, the Blond SDK resource will return a `Response` class. This response class contains many helpful methods for interacting with your HTTP response like seeing the HTTP status code and retrieving the body.

```
$response = $api->invoice()->get('jDe2KdWYK4');

$response->status() // Returns the response status code
$response->headers() // Returns all response headers
$response->header('X-Something') // Returns a given header
$response->body() // Returns the raw response body as a string
$response->json() // Retrieves a JSON response body and json_decodes it into an array.
$response->collect() // Retrieves a JSON response body and json_decodes it into a Laravel Collection. Requires `illuminate/collections`.
$response->object() // Retrieves a JSON response body and json_decodes it into an object.

// Methods used to determine if a request was successful or not based on status code.
$response->ok();
$response->successful();
$response->redirect();
$response->failed();
$response->clientError();
$response->serverError();

// Will throw an exception if the response is considered "failed".
$response->throw();
```

###  Health Score

45

—

FairBetter than 91% of packages

Maintenance94

Actively maintained with recent releases

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~315 days

Total

4

Last Release

33d ago

Major Versions

v1.2.0 → v2.0.02026-07-15

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/10193428?v=4)[Jonas](/maintainers/jschwendener)[@jschwendener](https://github.com/jschwendener)

---

Top Contributors

[![jschwendener](https://avatars.githubusercontent.com/u/10193428?v=4)](https://github.com/jschwendener "jschwendener (14 commits)")

### Embed Badge

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

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

###  Alternatives

[saloonphp/laravel-plugin

The official Laravel plugin for Saloon

807.6M227](/packages/saloonphp-laravel-plugin)[myoutdeskllc/salesforce-php

salesforce library for php8+

1586.3k](/packages/myoutdeskllc-salesforce-php)[codebar-ag/laravel-docuware

DocuWare integration with Laravel

1125.1k](/packages/codebar-ag-laravel-docuware)[sandorian/moneybird-api-php

Moneybird API client for PHP

148.6k](/packages/sandorian-moneybird-api-php)[codebar-ag/laravel-zammad

Zammad integration with Laravel

107.4k](/packages/codebar-ag-laravel-zammad)[marceloeatworld/falai-php

\#1 PHP client for the fal.ai serverless AI platform, compatible with Laravel and native PHP, built on Saloon v4

106.2k](/packages/marceloeatworld-falai-php)

PHPackages © 2026

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