The Gift Collection

API

API for developers

Sell vouchers in your own order form, redeem them from your till and read your orders. Simple REST with JSON.

Your own order form

Sell vouchers in your own form: amounts, designs and payment.

Check and redeem vouchers

At the till, fully or partly.

Orders and webhooks

Fetch your sales, or get a message on every sale.

Base URL https://thegiftcollection.be/api/v1

Authentication

  1. Log in and go to Settings → Integrations → API.
  2. Create an API key. Keep it safe: it gives access to your vouchers.
  3. Send it with every request: Authorization: Bearer dg_…

Every key belongs to one business and only sees that business’s vouchers. Keep it on your server, never in a browser or app.

Example
curl https://thegiftcollection.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.

Parameters

  • codestring · pathrequired

    The 7 letters on the voucher, e.g. ABCDEFG.

Possible errors

  • 404 INVALID_CODEThis code does not exist.
curl https://thegiftcollection.be/api/v1/vouchers/RBQLWGF \
  -H "Authorization: Bearer $DG_API_KEY"
Response
{
  "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.

Parameters

  • codestring · pathrequired

    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.

Possible errors

  • 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://thegiftcollection.be/api/v1/vouchers/RBQLWGF/redeem \
  -H "Authorization: Bearer $DG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"amount": 35}'
Response
{
  "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.

Parameters

  • langnl | fr | en | de · query

    Optional. The language of the names.

curl "https://thegiftcollection.be/api/v1/catalog?lang=nl" \
  -H "Authorization: Bearer $DG_API_KEY"
Response
{
  "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://thegiftcollection.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.

Parameters

  • linesarray · bodyrequired

    Per line a package (dealId) or an amount, with count and optionally messages (one per voucher).

  • discountCodestring · body

    Optional. A discount code.

Possible errors

  • 400 INVALID_AMOUNTThis amount isn’t possible at your business.
curl -X POST https://thegiftcollection.be/api/v1/checkout/quote \
  -H "Authorization: Bearer $DG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"lines": [{"amount": 50, "count": 2}]}'
Response
{
  "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.

Parameters

  • linesarray · bodyrequired

    As for the price.

  • buyerobject · bodyrequired

    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://thegiftcollection.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]"}}'
Response
{
  "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://thegiftcollection.be/api/v1/team \
  -H "Authorization: Bearer $DG_API_KEY"
Response
{
  "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.

Parameters

  • sincedate-time · query

    Optional. Only orders from this moment on.

  • pageinteger · query

    Optional. Defaults to 1.

curl "https://thegiftcollection.be/api/v1/orders?since=2026-10-01" \
  -H "Authorization: Bearer $DG_API_KEY"
Response
{
  "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.

Parameters

  • langnl | fr | en | de · query

    Optional. Language of the texts.

curl https://thegiftcollection.be/api/v1/business \
  -H "Authorization: Bearer $DG_API_KEY"
Response
{
  "id": "6ad4defa82ef21d01f65a464",
  "name": "'t Hofke",
  "live": true,
  "pageUrl": "https://thegiftcollection.be/nl/places/t_hofke",
  "widgetUrl": "https://thegiftcollection.be/nl/iplace/t_hofke",
  "products": [
    { "id": "6ad4…465", "name": "Diner voor twee", "price": 120, "persons": 2, "image": null }
  ],
  "freeAmount": { "min": 10, "max": 300 }
}

Errors

On an error you get an HTTP status and JSON with a fixed error code in error. Use that code in your software, not the text.

  • 200Success.
  • 400Something is missing or wrong in your request.
  • 401No or an invalid API key.
  • 404Not found, e.g. a code that doesn’t exist.
  • 422Not possible, e.g. a voucher that was already used.
  • 429Too many requests. Wait a moment and retry.
Error
{
  "error": "ALREADY_USED",
  "details": { "usedAt": "2026-10-19T11:10:22.012Z" }
}

Webhooks

Add a webhook in your dashboard (Settings → Integrations → Webhooks). We then POST JSON to your address as soon as something happens.

  • order.paidsomeone bought vouchers of your business.
  • voucher.redeemeda voucher was redeemed (at the till, in the app, via the API or in your webshop).

Add a webhook in your dashboard. Every message has an X-DG-Signature header: the HMAC-SHA256 of the body with your secret key. Always check it.

Payload
{
  "event": "voucher.redeemed",
  "data": { "code": "RBQLWGF", "collected": 35, "remaining": 15, "status": "PARTIALLY_USED" },
  "sentAt": "2026-10-19T11:10:22.012Z"
}
Verify the signature
// 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();
});

Limits

120 requests per minute per address. Answer 429 = wait a moment.