Installation
This page is for a Laravel application. For a project without Laravel see Without Laravel.
Requirements
- PHP 8.2+
- Laravel 11, 12 or 13
- A SnelStart client key and a subscription key for the B2B API
- An
APP_KEYand a cache store that persists, if you want the access token to be cached (a new Laravel application has both)
1. Install the package
composer require darvis/snelstart
Laravel registers the service provider and the Snelstart facade by itself (package discovery). There is nothing to add to bootstrap/providers.php, and the package has no migrations.
2. Get the two keys
The package needs two values, and SnelStart issues both:
| Key | What the package does with it |
|---|---|
| Client key | Exchanges it for an access token: it is posted to the token endpoint as clientkey, with grant_type=clientkey. It belongs to one administration. Required for every call to the API. |
| Subscription key | Sends it in the Ocp-Apim-Subscription-Key header of every call. Without it the header is left out. |
The two keys come from two different places, and that is where most people get stuck. What follows is how the SnelStart developer portal and SnelStart Web describe it in October 2026; SnelStart issues both keys and can change the procedure.
The subscription key: the developer portal
- Create an account on the SnelStart developer portal. The portal calls it a free temporary account; it gives access to the API documentation.
- Open Products and choose Ontwikkeling & Test. Give the subscription a name, tick the terms of use and click Subscribe. The portal says a subscription is required.
- Open Profile. Under Subscriptions the subscription has a primary key and a secondary key, hidden behind Show. The primary key is your
SNELSTART_SUBSCRIPTION_KEY.
The portal states that this development key is valid for 90 days and limited in the number of calls, and that a new test key can be made for free after those 90 days. The products Maatwerk and Productie give a permanent key, and the portal only hands one out after it has certified your integration (see below).
The client key: SnelStart Web
The client key (“koppelsleutel”, also spelled “koppelingssleutel”) belongs to one administration and is made by a user of that administration, not in the developer portal:
- Log in on SnelStart Web and pick the administration you want to talk to.
- Open Koppelingen and search for the tile Maatwerk, published by SnelStart Software B.V.
- Generate the key on that tile and copy it straight into
.envasSNELSTART_CLIENT_KEY.
Three things the tile says that are worth knowing before you click:
- The key is shown once. The tile of an active coupling shows the date the coupling was activated and the parts of the administration it may read and write, but not the key. The only buttons are “Genereer nieuwe sleutel” and “Koppeling uitschakelen”. A key you lost has to be generated again.
- A new key replaces the old one. The tile warns that generating a new key invalidates the previous one, so every application that still uses it stops working at that moment.
- One maatwerk coupling per administration, for the SnelStart packages inZicht and inControle.
An application that serves many SnelStart customers does not collect client keys by hand: SnelStart posts them to your webhook when a customer activates the coupling. See the activation link and the webhook.
Later: certification
The development subscription is for building. For a permanent subscription key the portal asks you to have the integration certified, and it describes two routes (October 2026):
- Maatwerk, an integration for one SnelStart customer: a mail to partner@snelstart.nl with the relation number of that customer, the e-mail address you log in to the portal with (the permanent key is added to that account) and an address for the invoice. SnelStart tests the integration for at least a week. The portal names a one-off fee of 250 euro per key, and requires an inZicht or inControle licence on the customer’s side.
- Productie, an integration for many customers: the certification form on snelstart.nl/api, plus a webhook URL, which the portal calls a requirement. After certification SnelStart issues a permanent production key, again at 250 euro per key, and the integration gets a tile in SnelStart Web.
Both keys open a bookkeeping. Keep them in .env, never in the repository.
3. Put them in .env
SNELSTART_CLIENT_KEY=your-client-key
SNELSTART_SUBSCRIPTION_KEY=your-subscription-key
When your application caches its config (php artisan config:cache, usual in production), run php artisan config:clear or cache it again after changing .env. Otherwise the old values stay in use.
That is all you need to start. Continue with Check that it works.
Does your application talk to more than one administration? Put one client key in .env, or none at all, and pick the key per call with Snelstart::withClientKey($key); see How it works.
4. Optional: the other settings
| Config key | Environment variable | Default | What it is |
|---|---|---|---|
base_url | SNELSTART_BASE_URL | https://b2bapi.snelstart.nl/v2 | Where the API calls go. A trailing slash is removed. |
client_key | SNELSTART_CLIENT_KEY | none | See above. |
connect_timeout | SNELSTART_CONNECT_TIMEOUT | 10 | Seconds to wait for the connection. |
echo_url | SNELSTART_ECHO_URL | https://b2bapi.snelstart.nl/echo | The Echo API, which snelstart:test uses to check the subscription key. |
subscription_key | SNELSTART_SUBSCRIPTION_KEY | none | See above. |
timeout | SNELSTART_TIMEOUT | 30 | Seconds to wait for a whole request, the token request included. |
token_cache.enabled | SNELSTART_TOKEN_CACHE | true | Keep the access token in Laravel’s cache, encrypted with your APP_KEY. |
token_cache.store | SNELSTART_TOKEN_CACHE_STORE | none | A store from config/cache.php. None means the default store. |
token_url | SNELSTART_TOKEN_URL | https://auth.snelstart.nl/b2b/token | Where the token is fetched. |
A value that is empty, or a timeout that is not a positive number, gives the default. What the token cache does is explained in How it works.
You only need the config file in your application when an environment variable is not enough:
php artisan vendor:publish --tag=snelstart-config
This writes config/snelstart.php. A file you published with an older version keeps working without the newer keys: Laravel merges the package file underneath yours, so the defaults and the environment variables above still apply.
In your own code, read the settings from the client: Snelstart::config() gives a Darvis\Snelstart\Config with baseUrl, clientKey, timeout and the rest as properties.
Check that it works
php artisan snelstart:test
The command makes two calls: one to the Echo API, which only needs the subscription key, and one to /companyInfo, which needs the client key too. When everything is right it exits with code 0 and prints this, with the name of your administration:
Testing Snelstart API connection...
✓ Subscription key accepted.
✓ Client key accepted.
Connection successful! Administration: Your Company B.V.
When something is wrong it exits with code 1 and prints one of these. The part after Response: is what SnelStart answered; a key or a token in it is replaced by [redacted].
| You see | What it means |
|---|---|
✗ Subscription key check failed: Snelstart API call failed. HTTP status: 401. Response: ... | The Echo API refused the subscription key, or SNELSTART_SUBSCRIPTION_KEY is empty. |
✗ Client key check failed: Snelstart config is incomplete: the client key is empty. | SNELSTART_CLIENT_KEY is empty, or the config is cached with the old value. |
✗ Client key check failed: Failed to retrieve access_token from Snelstart. HTTP status: 400. Response: ... (or 401) | The token endpoint refused the client key. |
✗ Client key check failed: Snelstart API call failed. HTTP status: 401. Response: ... (or 403) | The token was accepted, the call to /companyInfo was not. |
✗ Subscription key check failed: Snelstart API call failed. No response: ..., for example with cURL error 28 | SnelStart could not be reached (cURL error 6, the host name did not resolve) or did not answer within the timeout (cURL error 28). |
There are no commands defined in the "snelstart" namespace. | Laravel has not discovered the package: run php artisan package:discover. |
Each of these has its cause and its fix on the Troubleshooting page. The command never prints a key, the token or anything from the bookkeeping but the name of the administration.
Next: the Quick start.