Koppel Valucher aan je eigen systemen
Zapier, je kassasysteem of maatwerk — met de REST API geef je kaarten uit en boek je credits af vanuit elke tool. In zeven stappen live.
1API-sleutel aanmaken
Ga naar Account › API-sleutels en maak een nieuwe sleutel aan. Geef hem een naam die aangeeft waar hij voor wordt gebruikt (bijv. "Zapier" of "Kassasysteem"). De sleutel wordt precies één keer getoond — sla hem op voordat je het venster sluit.
2Authenticatie
Voeg bij elk API-verzoek de sleutel toe als Authorization-header:
Authorization: Bearer <jouw-api-sleutel>
Test of de sleutel werkt door je profiel op te vragen:
curl https://valucher.com/api/v1/me \
-H "Authorization: Bearer <jouw-api-sleutel>"
Een succesvolle respons heeft HTTP 200 met je gebruikersgegevens en de lijst van organisaties waarbij je bent aangesloten.
3Organisatie-ID ophalen
Het aanmaken en oplijsten van kaarten vereist een X-Organisation-Id-header, zodat de API weet onder welke organisatie de kaart hoort. Acties op een bestaande kaart (uitgeven, inwisselen, opvragen) hebben de header niet nodig — de kaart is al aan een organisatie gekoppeld. Je vindt je organisatie-ID's in de respons van GET /me:
curl https://valucher.com/api/v1/me \
-H "Authorization: Bearer <jouw-api-sleutel>" \
| jq '.data.organisations[] | {id, name}'
Sla het ID op voor stap 4. In de onderstaande voorbeelden staat 42 als voorbeeld.
4Kaart aanmaken
Een Valucher wordt aangemaakt als concept (issued: false). Je bepaalt zelf wanneer je hem uitgeeft (stap 5), zodat je hem eerst kunt controleren of de klantgegevens kunt koppelen.
| Veld | Type | Beschrijving |
|---|---|---|
name | string | Naam van de kaart (bijv. "10 lessen Yoga — Jan de Vries") |
unit_name | string | Naam van één strip (bijv. "les", "behandeling", "beurt") |
unit_amount | integer ≥ 1 | Totaal aantal strippen |
unit_value | decimal ≥ 0.01 | Waarde per strip in euro |
reference | string (optioneel) | Jouw interne referentie (klantnummer, ordernummer) |
expire_date | YYYY-MM-DD (optioneel) | Vervaldatum |
issue | boolean (optioneel) | Stuur true om de kaart direct uit te geven |
curl -X POST https://valucher.com/api/v1/vouchers \
-H "Authorization: Bearer <jouw-api-sleutel>" \
-H "X-Organisation-Id: 42" \
-H "Content-Type: application/json" \
-d '{
"name": "10 lessen Yoga — Jan de Vries",
"unit_name": "les",
"unit_amount": 10,
"unit_value": 9.50,
"reference": "KLANT-1234"
}'
De respons bevat de nieuwe kaart met zijn unieke code (8 tekens, bijv. TGD596BC). Die code heb je nodig voor stappen 5, 6 en 7.
5Kaart uitgeven
Uitgeven activeert de kaart en trekt credits af van je saldo (kosten = unit_amount × unit_value in euro's). Na het uitgeven is de kaart zichtbaar op valucher.com/code/<code> en kan hij worden ingewisseld. De organisatie wordt automatisch bepaald vanuit de kaart — geen header nodig.
curl -X POST https://valucher.com/api/v1/vouchers/TGD596BC/issue \
-H "Authorization: Bearer <jouw-api-sleutel>"
"issue": true toe aan het verzoek van stap 4.
6Strip inwisselen
Wissel één of meer strippen in wanneer de klant gebruik maakt van de kaart. De description verschijnt in de gebruikshistorie op de kaart. De organisatie wordt automatisch bepaald vanuit de kaart — geen header nodig.
| Veld | Type | Beschrijving |
|---|---|---|
units | integer ≥ 1 | Aantal in te wisselen strippen |
description | string | Omschrijving (bijv. "Les dinsdag 01-07-2026") |
curl -X POST https://valucher.com/api/v1/vouchers/TGD596BC/redeem \
-H "Authorization: Bearer <jouw-api-sleutel>" \
-H "Content-Type: application/json" \
-d '{
"units": 1,
"description": "Les dinsdag 01-07-2026"
}'
7Kaart opvragen
Haal de actuele stand van een kaart op, inclusief gebruikshistorie en resterende strippen. De organisatie wordt automatisch bepaald vanuit de kaart — geen header nodig.
curl https://valucher.com/api/v1/vouchers/TGD596BC \
-H "Authorization: Bearer <jouw-api-sleutel>"
Relevante velden in de respons:
| Veld | Beschrijving |
|---|---|
status | draft · active · depleted · expired · archived |
remaining | Resterend aantal strippen |
used | Aantal ingewisselde strippen |
uses | Array van inwisselingen met datum en omschrijving |
Foutcodes
Alle foutresponsen hebben HTTP 4xx en bevatten een error.code-veld:
| HTTP | code | Betekenis |
|---|---|---|
| 401 | unauthorized | Ongeldige of verlopen API-sleutel |
| 403 | forbidden | Geen lid van de opgegeven organisatie, of onvoldoende rechten |
| 404 | not_found | Kaart bestaat niet |
| 409 | insufficient_credits | Onvoldoende credits om de kaart uit te geven |
| 422 | invalid_state | Actie niet mogelijk in de huidige kaartstatus (bijv. al uitgegeven) |
| 422 | validation | Verplicht veld ontbreekt of heeft een ongeldige waarde |
Nog geen account?
Maak gratis een account aan en krijg direct 1.000 credits cadeau — goed voor €1.000 aan strippenkaarten.
Gratis beginnenConnect Valucher to your own systems
Zapier, your POS or a custom build — the REST API lets you issue cards and redeem credits from any tool. Live in seven steps.
1Create an API key
Go to Account › API keys and create a new key. Give it a name that describes its purpose (e.g. "Zapier" or "POS system"). The key is shown exactly once — copy it before closing the dialog.
2Authentication
Include your key in every request as an Authorization header:
Authorization: Bearer <your-api-key>
Verify the key works by fetching your profile:
curl https://valucher.com/api/v1/me \
-H "Authorization: Bearer <your-api-key>"
A successful response is HTTP 200 with your user details and the list of organisations you belong to.
3Get your organisation ID
Creating and listing cards requires an X-Organisation-Id header so the API knows which organisation the card belongs to. Actions on an existing card (issue, redeem, view) do not need it — the card is already tied to an organisation. Find your organisation IDs in the GET /me response:
curl https://valucher.com/api/v1/me \
-H "Authorization: Bearer <your-api-key>" \
| jq '.data.organisations[] | {id, name}'
Save the ID for step 4. The examples use 42 as a placeholder.
4Create a card
A Valucher is created as a draft (issued: false). You control when to issue it (step 5), so you can review it or attach customer details first.
| Field | Type | Description |
|---|---|---|
name | string | Card name (e.g. "10 Yoga lessons — Jane Smith") |
unit_name | string | Name of one unit (e.g. "lesson", "treatment", "session") |
unit_amount | integer ≥ 1 | Total number of units on the card |
unit_value | decimal ≥ 0.01 | Value per unit in euros |
reference | string (optional) | Your internal reference (customer number, order ID) |
expire_date | YYYY-MM-DD (optional) | Expiry date |
issue | boolean (optional) | Send true to issue the card immediately |
curl -X POST https://valucher.com/api/v1/vouchers \
-H "Authorization: Bearer <your-api-key>" \
-H "X-Organisation-Id: 42" \
-H "Content-Type: application/json" \
-d '{
"name": "10 Yoga lessons — Jane Smith",
"unit_name": "lesson",
"unit_amount": 10,
"unit_value": 9.50,
"reference": "CUSTOMER-1234"
}'
The response contains the new card including its unique code (8 characters, e.g. TGD596BC). You need this code for steps 5, 6, and 7.
5Issue a card
Issuing activates the card and deducts credits from your balance (cost = unit_amount × unit_value in euros). Once issued, the card is accessible at valucher.com/code/<code> and can be redeemed. The organisation is resolved from the card — no header needed.
curl -X POST https://valucher.com/api/v1/vouchers/TGD596BC/issue \
-H "Authorization: Bearer <your-api-key>"
"issue": true to the step 4 request body.
6Redeem a unit
Redeem one or more units when the customer uses their card. The description appears in the usage history on the card. The organisation is resolved from the card — no header needed.
| Field | Type | Description |
|---|---|---|
units | integer ≥ 1 | Number of units to redeem |
description | string | Description (e.g. "Lesson Tuesday 01-07-2026") |
curl -X POST https://valucher.com/api/v1/vouchers/TGD596BC/redeem \
-H "Authorization: Bearer <your-api-key>" \
-H "Content-Type: application/json" \
-d '{
"units": 1,
"description": "Lesson Tuesday 01-07-2026"
}'
7View a card
Fetch the current state of a card, including its usage history and remaining units. The organisation is resolved from the card — no header needed.
curl https://valucher.com/api/v1/vouchers/TGD596BC \
-H "Authorization: Bearer <your-api-key>"
Key fields in the response:
| Field | Description |
|---|---|
status | draft · active · depleted · expired · archived |
remaining | Units remaining on the card |
used | Units already redeemed |
uses | Array of individual redemptions with date and description |
Error codes
All error responses are HTTP 4xx and include an error.code field:
| HTTP | code | Meaning |
|---|---|---|
| 401 | unauthorized | Invalid or expired API key |
| 403 | forbidden | Not a member of the given organisation, or insufficient permissions |
| 404 | not_found | Card does not exist |
| 409 | insufficient_credits | Not enough credits to issue the card |
| 422 | invalid_state | Action not possible in the card's current state (e.g. already issued) |
| 422 | validation | Required field missing or invalid value |
Don't have an account yet?
Sign up for free and get 1,000 credits instantly — enough for €1,000 worth of punch cards.
Get started free