Skip to content

Client Libraries

StrawBlond is committed to delivering a feature-rich developer experience. Part of this effort is through providing high-quality libraries you can use to access the API. The official libraries available are listed below, and more are in development. If you don't see what you need, please let us know at info@strawblond.com.

PHP

Checkout the full documentation at https://github.com/strawblond/strawblond-php-sdk.

Installation (Composer)

sh
composer require strawblond/strawblond-php-sdk

Example usage

php
// Create a new instance of the SDK client
$api = new \StrawBlond\StrawBlond('YOUR_API_KEY');

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

// Create an invoice for this contact
$invoice = $api->invoice()->create([
    'contact_id' => $contact['id'],
    'name' => 'Monatsabo April 2024',
])->json();

// Add a line item to the invoice
$api->invoice()->lineItems($invoice['id'])->create([
    'name' => 'Mitgliederbeitrag',
    'amount' => 39.50,
]);

// Send the invoice
$api->invoice()->send($invoice['id'], recipients: ['max@muster.com']);