Vouchers (Tegoedbonnen)

Current version: 0.1.1

Global Overview (Globaal overzicht)

Vouchers (Tegoedbonnen) can be redeemed when making online bookings. This documentation describes the online purchase of vouchers.

To quickly integrate the sale of vouchers, you can also use our Javascript-library.

Voucher Templates (Tegoedbon-templates)

GET /api2/voucher_templates

Via this endpoint, the “Voucher Templates” (Tegoedbon-templates) that can be purchased online can be requested. A voucher is created based on a Voucher Template.

Example request:

GET /api2/voucher_templates HTTP/1.1
Host: demo.recras.nl
Accept: application/json

Example response:

HTTP/1.1 200 OK
Content-Type: application/json

[
  {
    "id": 1,
    "name": "Klimmen", // (Climbing)
    "product_amount": 1,
    "price": 10,
    "expire_days": 365,
    "internal_reference": "online_voucher",
    "pdf_template_id": 12,
    "confirmation_mail_subject": "Uw tegoedbon", // (Your voucher)
    "confirmation_mail_body": "<p>In de bijlage zit uw tegoedbon.</p>", // (<p>Your voucher is attached.</p>)
    "contactform_id": 2,
    "company_id": 5,
    "products": [
      104,
      105
    ]
  }
]
Status Codes:

Buy Voucher (Tegoedbon kopen)

POST /api2/vouchers/buy

With this endpoint, it is possible to buy a voucher (tegoedbon)

Example request:

POST /api2/vouchers/buy HTTP/1.1
Host: demo.recras.nl
Content-Type: application/json

{
   "voucher_template_id":1,
   "number_of_vouchers":3,
   "contact_form": {
      "contactpersoon.voornaam": "Voor", // (contact_person.first_name: "First")
      "contactpersoon.achternaam": "Naampie", // (contact_person.last_name: "Namey")
      "contactpersoon.email1": "api@recras.nl",
      "contactpersoon.telefoon1": "050-2112212" // (contact_person.phone1)
    }
 }
JSON Parameters:
  • voucher_template_id (int) – Required The id field of the Voucher Template (Tegoedbon-template) to buy.

  • number_of_vouchers (int) – Required The number of vouchers (tegoedbonnen) to buy. Maximum is 100.

  • producten (array) – Required A list of booking lines (boekingsregels) to book, each element is a combination of an arrangementsregel_id (package_line_id) and a quantity (aantal).

  • contact_form (object) – Required Completed contact form (contactformulier) belonging to this voucher template. For more information, see the documentation for _ContactformulierenSubmit <Contactformulieren opslaan> (Save Contact Forms).

  • redirect_url (URL) – A URL to which the customer is redirected after payment, regardless of the payment status. It is therefore up to the server to which redirect_url refers to check the status of the booking.

Example response:

HTTP/1.1 200 OK
Content-Type: application/json

{
   "payment_url":"https://mollie.com/some_payment_url",
   "transaction_id":"tr_189481",
   "redirect_url":"https://mywebsite.nl/voucher_thankyou.html"
}
JSON Parameters:
  • payment_url (uri) – The URL where the voucher (tegoedbon) can be paid; the user must be sent to this page.

  • redirect_url (uri) – The URL where the user will be sent after the payment is completed.

  • transaction_id (string) – A unique transaction ID.