Skip to main content
POST
/
reservations
Set the reservation for a specific voucher
curl --request POST \
  --url https://vouchers.api.jtl-software.com/v1/reservations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "amount": "10.53",
  "currency": "EUR",
  "code": "test",
  "pin": "test"
}
'
{
  "id": "da39a3ee5eb28b7392ef5",
  "voucher_id": "da39a3ee4528b7392ef5",
  "voucher_taxable": false,
  "voucher_tax_rate": null,
  "client_id": "cff8784e5eb28b9b04860",
  "amount": "10.53",
  "valid_until": "2017-07-21T17:32:28+00:00",
  "created_at": "2017-07-21T17:32:28+00:00",
  "updated_at": "2017-07-21T17:32:28+00:00"
}

Authorizations

Authorization
string
header
required

This API uses OAuth 2 with Client Credentials Flow (see: https://www.oauth.com/oauth2-servers/access-tokens/client-credentials).

You can request only a subset of specific scopes for your client, however the available scopes for each client are defined through the client groups in the UI.

Within your token request, you can also send the optional parameter client_type (string with a max length of 32 chars). This value is only used for internal statistics.

Body

application/json

Voucher reservation request body

amount
string
required

Amount in the currency of this voucher. Must be send as string in the following pattern:

  • Up to five digits before the decimal point
  • The decimal point (.)
  • Exactly two digits after the decimal point
Required string length: 4 - 9
Pattern: ^\d+\.\d{2}$
Example:

"10.53"

currency
string
required

The three-character ISO-4217 currency code - https://en.wikipedia.org/wiki/ISO_4217#Active_codes (must match the currency of the voucher)

Required string length: 3
Example:

"EUR"

code
string
required

A code that must be entered during the ordering process to receive the savings indidcated on the assiciated voucher.

Maximum string length: 255
Example:

"test"

pin
string

An additional security feature on printed vouchers

Maximum string length: 255
Example:

"test"

Response

OK

id
string
read-only

Primary identification key - will be used in voucher-reservation calls

Example:

"da39a3ee5eb28b7392ef5"

voucher_id
string
read-only

Voucher primary identification key (see voucher -> id)

Example:

"da39a3ee4528b7392ef5"

voucher_taxable
boolean

Defines if this voucher is a taxable multi purpose voucher

Example:

false

voucher_tax_rate
string

The tax rate for this voucher (only needed when taxable is true, can also be null)

Example:

null

client_id
string
read-only

Client primary identification key (see client -> id)

Example:

"cff8784e5eb28b9b04860"

amount
string

Amount in the currency of this voucher. Must be send as string in the following pattern:

  • Up to five digits before the decimal point
  • The decimal point (.)
  • Exactly two digits after the decimal point
Required string length: 4 - 9
Pattern: ^\d+\.\d{2}$
Example:

"10.53"

valid_until
string<RFC3339>

valid_until - datetime in RFC3339 format, see https://tools.ietf.org/html/rfc3339

Example:

"2017-07-21T17:32:28+00:00"

created_at
string<RFC3339>
read-only

created_at - datetime in RFC3339 format, see https://tools.ietf.org/html/rfc3339

Example:

"2017-07-21T17:32:28+00:00"

updated_at
string<RFC3339>
read-only

updated_at - datetime in RFC3339 format, see https://tools.ietf.org/html/rfc3339

Example:

"2017-07-21T17:32:28+00:00"