API
API pour développeurs
Vendez des chèques dans votre propre formulaire, encaissez-les depuis votre caisse et lisez vos commandes. Du REST simple en JSON.
Votre propre formulaire
Vendez des chèques dans votre formulaire : montants, designs et paiement.
Vérifier et encaisser des chèques
À la caisse, entièrement ou en partie.
Commandes et webhooks
Récupérez les ventes, ou recevez un message à chaque vente.
Base URL https://dinnergift.be/api/v1
Authentification
- Connectez-vous et allez dans Paramètres → Intégrations → API.
- Créez une clé API. Gardez-la en sécurité : elle donne accès à vos chèques.
- Envoyez-la avec chaque requête : Authorization: Bearer dg_…
Chaque clé appartient à un seul commerce et ne voit que ses chèques. Gardez-la sur votre serveur, jamais dans le navigateur ou une app.
curl https://dinnergift.be/api/v1/business \ -H "Authorization: Bearer dg_xxxxxxxxxxxxxxxx"
Check a voucher
GET/vouchers/{code}
Does the voucher exist, is it yours, what is left on it and until when is it valid? Changes nothing.
Paramètres
codestring · pathobligatoire
The 7 letters on the voucher, e.g. ABCDEFG.
Erreurs possibles
404 INVALID_CODEThis code does not exist.
curl https://dinnergift.be/api/v1/vouchers/RBQLWGF \ -H "Authorization: Bearer $DG_API_KEY"
{
"code": "RBQLWGF",
"amount": 50,
"amountUsed": 0,
"remaining": 50,
"status": "VALID",
"paid": true,
"expiresAt": "2027-12-31T22:59:59.999Z",
"expired": false,
"usedAt": null,
"dealLabel": null,
"buyerName": "An Peeters",
"orderId": "6ad4e3e8b3f82f076a57c6dc",
"oneTimeCollect": true
}Redeem a voucher
POST/vouchers/{code}/redeem
Redeems the whole voucher, or part of it when your business allows partial use. Atomic: a voucher can never be used twice.
Paramètres
codestring · pathobligatoire
The voucher code.
amountnumber · body
Optional. The bill amount; empty = everything left on the voucher.
redeemedBystring · body
Optional. Who of the team redeems the voucher: an id from GET /team.
Erreurs possibles
422 INVALID_REDEEMED_BYThis person is not in your business’s team.422 ALREADY_USEDThe voucher was already fully used.422 EXPIREDThe voucher has expired.422 PARTIAL_NOT_ALLOWEDYour business doesn’t allow partial use.
curl -X POST https://dinnergift.be/api/v1/vouchers/RBQLWGF/redeem \ -H "Authorization: Bearer $DG_API_KEY" \ -H "Content-Type: application/json" \ -d '{"amount": 35}'
{
"code": "RBQLWGF",
"collected": 35,
"remaining": 15,
"status": "PARTIALLY_USED",
"redeemedBy": { "id": "6ad4e3e8b3f82f076a57c6e1", "name": "Sofie Peeters" }
}Your own order form: what can people buy?
GET/catalog
Everything to build your own form: your packages, the amounts (from, to, steps, suggestions), your designs with a preview, and how long a voucher is valid.
Paramètres
langnl | fr | en | de · query
Optional. The language of the names.
curl "https://dinnergift.be/api/v1/catalog?lang=nl" \ -H "Authorization: Bearer $DG_API_KEY"
{
"id": "6ad4e3e8b3f82f076a57c6aa",
"name": "Trattoria Luna",
"currency": "EUR",
"packages": [
{ "id": "6ad4e3e8b3f82f076a57c6ab", "name": "Chef's menu", "price": 120, "persons": 2 }
],
"amounts": { "min": 25, "max": 500, "step": 5, "suggested": [25, 50, 75, 100], "ownAmount": false },
"designs": [
{ "id": "6ad4e3e8b3f82f076a57c6ac", "name": "Classic", "previewUrl": "https://dinnergift.be/api/voucher-preview?business=…&design=…" }
],
"validity": { "months": 12, "until": null, "oneVisit": true },
"processingFee": true
}Get the price
POST/checkout/quote
The real price of a choice: vouchers, processing fee, postage, discount and total. The same calculation as at payment.
Paramètres
linesarray · bodyobligatoire
Per line a package (dealId) or an amount, with count and optionally messages (one per voucher).
discountCodestring · body
Optional. A discount code.
Erreurs possibles
400 INVALID_AMOUNTThis amount isn’t possible at your business.
curl -X POST https://dinnergift.be/api/v1/checkout/quote \ -H "Authorization: Bearer $DG_API_KEY" \ -H "Content-Type: application/json" \ -d '{"lines": [{"amount": 50, "count": 2}]}'
{
"voucherTotal": 100,
"cost": 2.5,
"deliveryCost": 0,
"discount": 0,
"total": 102.5
}Take the payment
POST/checkout
Creates the order and returns the payment page’s address. Send the buyer to checkoutUrl. After paying they get the vouchers by e-mail and on their order page.
Paramètres
linesarray · bodyobligatoire
As for the price.
buyerobject · bodyobligatoire
The buyer’s firstName, lastName and email.
designIdstring · body
Optional. A design from /catalog.
languagenl | fr | en | de · body
Optional. The language of the vouchers and e-mails.
curl -X POST https://dinnergift.be/api/v1/checkout \ -H "Authorization: Bearer $DG_API_KEY" \ -H "Content-Type: application/json" \ -d '{"language": "nl", "lines": [{"amount": 50, "count": 1, "messages": ["Proficiat!"]}], "buyer": {"firstName": "An", "lastName": "Peeters", "email": "[email protected]"}}'
{
"orderId": "6ad4e3e8b3f82f076a57c6dd",
"checkoutUrl": "https://www.mollie.com/checkout/…"
}Your team
GET/team
Everyone of your team, with and without dashboard access. Pass an id as redeemedBy when you redeem.
curl https://dinnergift.be/api/v1/team \ -H "Authorization: Bearer $DG_API_KEY"
{
"members": [
{ "id": "6ad4e3e8b3f82f076a57c6e1", "name": "Sofie Peeters", "role": "Zaal", "access": false }
]
}List orders
GET/orders
Paid orders with their vouchers, newest first, 50 per page. Use since to fetch only new ones.
Paramètres
sincedate-time · query
Optional. Only orders from this moment on.
pageinteger · query
Optional. Defaults to 1.
curl "https://dinnergift.be/api/v1/orders?since=2026-10-01" \ -H "Authorization: Bearer $DG_API_KEY"
{
"total": 23,
"page": 1,
"pageSize": 50,
"items": [
{
"id": "6ad4e3e8b3f82f076a57c6dc",
"createdAt": "2026-10-18T15:21:12.896Z",
"buyerName": "An Peeters",
"buyerEmail": "[email protected]",
"personalMessage": "Proficiat!",
"total": 50,
"vouchers": [
{ "code": "RBQLWGF", "amount": 50, "remaining": 50, "status": "VALID", "expiresAt": "2027-12-31T22:59:59.999Z" }
]
}
]
}Your business
GET/business
The business of this key, the packages you sell and the links to your page and widget.
Paramètres
langnl | fr | en | de · query
Optional. Language of the texts.
curl https://dinnergift.be/api/v1/business \ -H "Authorization: Bearer $DG_API_KEY"
{
"id": "6ad4defa82ef21d01f65a464",
"name": "'t Hofke",
"live": true,
"pageUrl": "https://dinnergift.be/nl/places/t_hofke",
"widgetUrl": "https://dinnergift.be/nl/iplace/t_hofke",
"products": [
{ "id": "6ad4…465", "name": "Diner voor twee", "price": 120, "persons": 2, "image": null }
],
"freeAmount": { "min": 10, "max": 300 }
}Erreurs
En cas d’erreur, vous recevez un statut HTTP et un JSON avec un code d’erreur fixe dans error. Utilisez ce code, pas le texte.
200Réussi.400Il manque quelque chose ou une valeur est incorrecte.401Clé API absente ou invalide.404Introuvable, p. ex. un code qui n’existe pas.422Impossible, p. ex. un chèque déjà utilisé.429Trop de requêtes. Patientez un instant.
{
"error": "ALREADY_USED",
"details": { "usedAt": "2026-10-19T11:10:22.012Z" }
}Webhooks
Ajoutez un webhook dans votre tableau de bord (Paramètres → Intégrations → Webhooks). Nous envoyons un POST JSON à votre adresse dès qu’il se passe quelque chose.
order.paidquelqu’un a acheté des chèques de votre commerce.voucher.redeemedun chèque a été encaissé (caisse, app, API ou boutique en ligne).
Ajoutez un webhook dans votre tableau de bord. Chaque message a un en-tête X-DG-Signature : le HMAC-SHA256 du corps avec votre clé secrète. Vérifiez-le toujours.
{
"event": "voucher.redeemed",
"data": { "code": "RBQLWGF", "collected": 35, "remaining": 15, "status": "PARTIALLY_USED" },
"sentAt": "2026-10-19T11:10:22.012Z"
}// Node.js / Express const crypto = require('crypto'); app.post('/hooks/dinnergift', express.raw({ type: 'application/json' }), (req, res) => { const expected = crypto.createHmac('sha256', process.env.DG_WEBHOOK_SECRET).update(req.body).digest('hex'); const got = Buffer.from(req.get('x-dg-signature') || ''); if (got.length !== 64 || !crypto.timingSafeEqual(Buffer.from(expected), got)) return res.status(401).end(); const { event, data } = JSON.parse(req.body); // "order.paid" or "voucher.redeemed" res.status(200).end(); });
Limites
120 requêtes par minute par adresse. Réponse 429 = patientez un peu.