API Reference

Vouchers

Issue, validate, and redeem voucher codes and gift cards. Vouchers support both fixed-value and percentage types, optional usage caps, and configurable validity windows.

List Vouchers

Retrieve all vouchers for the current restaurant.

GET/api/vouchersAdmin Only

Returns an array of all vouchers, including redeemed and expired ones.

bash
curl https://api.possfer.com/api/vouchers \
  -H "Authorization: Bearer <token>"
json
{
  __PH0__: [
    {
      __PH1__: "v1a2b3c4-5678-90ab-cdef-222222222222",
      __PH3__: "WELCOME25",
      __PH5__: "percentage",
      __PH7__: 25,
      __PH8__: 25,
      __PH9__: 20.00,
      __PH10__: 100,
      __PH11__: 14,
      __PH12__: "2026-01-01T00:00:00Z",
      __PH14__: "2026-06-30T23:59:59Z",
      __PH16__: true,
      __PH17__: "2026-01-01T10:00:00Z",
      __PH19__: "2026-02-10T08:15:00Z"
    }
  ]
}

Get Voucher

Retrieve a single voucher by its unique identifier.

GET/api/vouchers/:idAdmin Only

Returns the full voucher object including redemption statistics.

Path Parameters

NameTypeRequiredDescription
idstring (UUID)RequiredUnique identifier of the voucher.
bash
curl https://api.possfer.com/api/vouchers/v1a2b3c4-5678-90ab-cdef-222222222222 \
  -H "Authorization: Bearer <token>"

Create Voucher

Issue a new voucher code for your restaurant.

POST/api/vouchersAdmin Only

Creates a new voucher and returns the full object with its generated ID.

Request Body

NameTypeRequiredDescription
codestringRequiredUnique alphanumeric voucher code customers will enter at checkout.
voucher_type"percentage" | "fixed"RequiredWhether the voucher grants a percentage off or a fixed EUR credit.
original_valuenumberRequiredFace value. Percentage (0-100) or fixed amount in EUR.
min_order_amountnumberOptionalMinimum order total (EUR) required to use this voucher.
max_usesintegerOptionalMaximum total redemptions allowed. Null means unlimited.
valid_fromstring (ISO 8601)OptionalStart of the validity window. Defaults to now.
valid_untilstring (ISO 8601)OptionalEnd of the validity window. Null means no expiry.
bash
curl -X POST https://api.possfer.com/api/vouchers \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "code": "WELCOME25",
    "voucher_type": "percentage",
    "original_value": 25,
    "min_order_amount": 20.00,
    "max_uses": 100,
    "valid_from": "2026-01-01T00:00:00Z",
    "valid_until": "2026-06-30T23:59:59Z"
  }'

Update Voucher

Update select fields of an existing voucher.

PUT/api/vouchers/:idAdmin Only

Applies a partial update to the voucher and returns the updated object.

Path Parameters

NameTypeRequiredDescription
idstring (UUID)RequiredUnique identifier of the voucher.

Request Body

NameTypeRequiredDescription
is_activebooleanOptionalEnable or disable the voucher.
valid_untilstring (ISO 8601)OptionalExtend or shorten the validity window.
max_usesintegerOptionalAdjust the maximum number of redemptions.
bash
curl -X PUT https://api.possfer.com/api/vouchers/v1a2b3c4-5678-90ab-cdef-222222222222 \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "is_active": false,
    "valid_until": "2026-03-31T23:59:59Z"
  }'

Delete Voucher

Permanently remove a voucher. This action cannot be undone.

DELETE/api/vouchers/:idAdmin Only

Deletes the voucher and returns 204 No Content on success.

Path Parameters

NameTypeRequiredDescription
idstring (UUID)RequiredUnique identifier of the voucher to delete.
bash
curl -X DELETE https://api.possfer.com/api/vouchers/v1a2b3c4-5678-90ab-cdef-222222222222 \
  -H "Authorization: Bearer <token>"

Validate Voucher Code

Check whether a voucher code is valid and eligible for redemption without actually consuming a use.

GET/api/vouchers/validate?code=Admin Only

Returns the voucher details and validity status.

Query Parameters

NameTypeRequiredDescription
codestringRequiredThe voucher code to validate.
bash
curl __PH1__Authorization: Bearer <token>"
json
{
  __PH0__: true,
  __PH1__: {
    __PH2__: "v1a2b3c4-5678-90ab-cdef-222222222222",
    __PH4__: "WELCOME25",
    __PH6__: "percentage",
    __PH8__: 25,
    __PH9__: 25,
    __PH10__: true
  },
  __PH11__: null
}

Redeem Voucher

Apply a voucher to an order. This increments the usage counter and, for fixed-value vouchers, reduces the remaining balance.

POST/api/vouchers/redeemAdmin Only

Redeems the voucher against the specified order and returns the applied discount amount.

Request Body

NameTypeRequiredDescription
codestringRequiredThe voucher code to redeem.
order_idstring (UUID)RequiredThe order to apply the voucher to.
bash
curl -X POST https://api.possfer.com/api/vouchers/redeem \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "code": "WELCOME25",
    "order_id": "o9f8e7d6-5432-10ab-cdef-333333333333"
  }'
json
{
  __PH0__: true,
  __PH1__: 12.50,
  __PH2__: {
    __PH3__: "v1a2b3c4-5678-90ab-cdef-222222222222",
    __PH5__: "WELCOME25",
    __PH7__: 25,
    __PH8__: 15
  }
}