Skip to main content
POST
/
vouchers
/
recharge
Recharge a voucher
curl --request POST \
  --url https://vouchers.api.jtl-software.com/v1/vouchers/recharge \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "amount": "10.53",
  "currency": "EUR",
  "order_number": "ORDER-62642",
  "code": "test",
  "id": "4ZH83T0ACUUC14CW"
}
'
{
  "id": "cff8784e5eb28b9b04860",
  "voucher_id": "cff8784e34b28b9b04860",
  "client_id": "cff8784e5eb28b81ca02a",
  "type": "recharge",
  "amount": "10.53",
  "order_number": "ORDER-62642",
  "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 recharge 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"

order_number
string
required

Order or invoice number of the transaction for this recharge

Example:

"ORDER-62642"

code
string

The vouchers code you want to recharge (not necessary if id is set)

Maximum string length: 255
Example:

"test"

id
string

The vouchers id you want to recharge (not necessary if code is set)

Maximum string length: 255
Example:

"4ZH83T0ACUUC14CW"

Response

OK

id
string
read-only

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

Example:

"cff8784e5eb28b9b04860"

voucher_id
string
read-only

Voucher primary identification key (see voucher -> id)

Example:

"cff8784e34b28b9b04860"

client_id
string
read-only

Client primary identification key (see client -> id)

Example:

"cff8784e5eb28b81ca02a"

type
enum<string>

Type of this charge. Can either be "charge", "recharge" or "refund"

Available options:
charge,
recharge,
refund
Example:

"recharge"

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"

order_number
string

Order or invoice number of the transaction

Example:

"ORDER-62642"

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"