Skip to main content
The Storefront API Vouchers allows voucher codes to be redeemed and removed in the storefront. The API automatically checks whether a code is valid and, after redemption, returns the updated shopping cart values (e.g. discounts and totals) as well as notices/error messages if needed.

Supported methods

List of all supported methods.
CommandEndpointsGETPUTPOSTDELETE
Read voucher datavoucher/get
Redeem vouchervoucher/redeem
Delete vouchervoucher/delete

Methods for vouchers

These methods allow you to check, redeem, and remove vouchers directly in the shopping cart or checkout.

GET voucher/get

This call reads master data for a voucher code (e.g. value, currency, minimum order value). This information can be used in the shopping cart and checkout to check a voucher before redeeming it and to display info such as amount and conditions. Example call for the voucher with the voucher number 7G3M-L2UU-CK1B-A2J2:
GET https://<your-shop>.de/api/v1/voucher/get?id=7G3M-L2UU-CK1B-A2J2

Parameter overview

Body parameters

ParameterTypeDescription
idStringRequired field
Voucher code to be queried.

Example response

{
  "currency": "EUR",
  "id": "7G3M-L2UU-CK1B-A2J2",
  "minOrderValue": 0,
  "taxId": "19",
  "value": 10.5
}

POST voucher/redeem

This call redeems a voucher code for the current shopping cart and returns information about the redeemed voucher and the remaining value. This command can be used in the shopping cart or checkout to offset the voucher or to display the redeemed amount and, if applicable, the remaining value. Example call for redeeming the voucher 7G3M-L2UU-CK1B-A2J2:
POST https://<your-shop>.de/api/v1/voucher/redeem

Example request

{
  "id": "7G3M-L2UU-CK1B-A2J2"
}

Parameter overview

Header parameters

ParameterDescription
x-sessionRequired field
ID of the current session.
More information: Storefront API Basics

Body parameters

ParameterTypeDescription
idstringRequired field
Voucher code to be redeemed.

Example response

{
  "info": {
    "totalUsedValue": 0,
    "totalValue": 10.5,
    "vouchers": [
      {
        "currency": "EUR",
        "id": "7G3M-L2UU-CK1B-A2J2",
        "taxId": "19",
        "usedValue": 0,
        "value": 10.5
      }
    ]
  }
}

Error codes

Error codeDescription
invalidVoucherIdThe specified ID is not a valid voucher code.
deactivatedThe voucher has been deactivated.
expiredThe voucher has expired.
notYetValidThe voucher is not yet valid.
maxCountExceededThe maximum number of redeemable vouchers per order has been reached.
valueSpentThe total value of the voucher has already been spent.
currencyMismatchThe voucher currency does not match the shop currency.
invalidCustomerThe voucher may not be redeemed by this customer.
invalidSubshopThe voucher may not be redeemed in this subshop.

DELETE voucher/delete

This call removes a redeemed voucher code from the current shopping cart and updates the voucher overview. This command can be used in the shopping cart or checkout to undo an accidentally redeemed or unwanted voucher application. Example call for removing the voucher with the code 7G3M-L2UU-CK1B-A2J2:
DELETE https://<your-shop>.de/api/v1/voucher/delete

Example request

{
  "id": "7G3M-L2UU-CK1B-A2J2"
}

Parameter overview

Header parameters

ParameterDescription
x-sessionRequired field
ID of the current session.
More information: Storefront API Basics

Body parameters

ParameterTypeDescription
idStringRequired field
Voucher code to be removed.

Example response

{
  "info": {
    "totalUsedValue": 0,
    "totalValue": 0,
    "vouchers": []
  }
}

Error codes

Error codeDescription
invalidVoucherIdThe specified ID is not a valid voucher code.