Booking Flow

Voucher Codes

A VoucherCode is a single issued instance of a VoucherType — the redeemable code, its monetary balance, validity dates, recipient, and delivery metadata. VoucherCodes are produced by the basket pipeline when a voucher is purchased and consumed when the code is presented as payment against a future order.

get/shop/voucher-codes

List VoucherCodes

listVoucherCodes

Returns a paginated list of VoucherCodes. Use the query parameters to narrow the result set by code substring, status, amount, balance, creation date, site, voucher type, expiry window, or fulfilment status. The result is ordered by created_at descending so the newest voucher codes appear first.

This endpoint powers the voucher management screens in the Trybe dashboard and any third-party integration that needs the same view — for example a fulfilment provider polling for vouchers with fulfillment_status=needs_dispatching.

Query parameters

  • pageintegeroptional

    The page to retrieve results from

  • per_pageintegeroptional

    The number of results to return per page

  • site_iduuidoptional

    Filter the list of voucher codes to a single site.

  • codestringoptional

    Partial, case-insensitive substring match on the voucher redemption code.

  • statusstring[]optional

    Filter by voucher code status. Pass multiple statuses as a comma-separated list.

  • amountstringoptional

    Filter by voucher amount. Supports comparison operators (>1000, <5000, >=2500, <=2500, =1000) — values are in the smallest unit of the voucher's currency.

  • balancestringoptional

    Filter by remaining voucher balance. Supports the same comparison operators as amount.

  • created_sincedate-timeoptional

    Filter for voucher codes created on or after this date-time.

  • voucher_type_idstring[]optional

    Filter to voucher codes whose voucher_type_id matches one of the given IDs.

  • expired_range_fromdateoptional

    Filter to voucher codes whose valid_to_date is on or after this date.

  • expired_range_todateoptional

    Filter to voucher codes whose valid_to_date is before this date.

  • fulfillment_statusstringoptional

    Filter by fulfilment status — needs_dispatching for vouchers awaiting physical delivery, dispatched once sent, not_required for digital deliveries.

Responses

  • 200

    Successfully retrieved VoucherCodes.

  • 401

    The user is unauthenticated

  • 403

    The authenticated user does not have permission.

get/shop/voucher-codes/{voucherCodeId}

Retrieve a VoucherCode

getVoucherCode

Retrieves a single VoucherCode by ID, including every redemption recorded against it. Use this when you have a voucher ID from a webhook payload, the listVoucherCodes response, or a customer-service search, and need the canonical record plus full redemption history.

Trashed (soft-deleted) voucher codes are returned by this endpoint with status of revoked, so customer-service flows can inspect revoked codes without a separate lookup.

Path parameters

  • voucherCodeIdobject-idrequired

    The unique identifier of the VoucherCode. Each issued voucher has its own VoucherCode record holding the redemption code, balance, validity window, and fulfilment state.

Responses

  • 200

    The VoucherCode was successfully retrieved.

  • 401

    The user is unauthenticated

  • 403

    The authenticated user does not have permission.

  • 404

    The resource couldn't be found

put/shop/voucher-codes/{voucherCodeId}

Update a VoucherCode

updateVoucherCode

Updates a VoucherCode in place. The two fields most commonly changed are valid_to_date (to extend or shorten the voucher's expiry window) and fulfillment_status (to record physical dispatch).

The voucher's status is recalculated automatically when valid_to_date is changed: pushing the date past today on an expired voucher will move it back to unredeemed (or partially_redeemed if there have been redemptions); setting the date before today on a non-revoked voucher will move it to expired. revoked vouchers are never reactivated by a valid_to_date change.

Path parameters

  • voucherCodeIdobject-idrequired

    The unique identifier of the VoucherCode. Each issued voucher has its own VoucherCode record holding the redemption code, balance, validity window, and fulfilment state.

Request body

  • valid_to_datedate-timeoptional

    Extend or shorten the voucher's expiry. Setting a date in the past on an active voucher will move it to expired; setting a future date on an expired voucher will move it back to unredeemed (or partially_redeemed if there are prior redemptions). Must be an RFC 3339 timestamp.

  • fulfillment_statusstringoptional

    Override the fulfilment status — typically used to mark a physical voucher as dispatched after posting.

Responses

  • 200

    The VoucherCode was successfully updated.

  • 401

    The user is unauthenticated

  • 403

    The authenticated user does not have permission.

  • 404

    The resource couldn't be found

  • 422

    The request didn't pass validation

post/shop/voucher-codes/{voucherCodeId}/revoke

Revoke a VoucherCode

actionRevokeVoucherCode

Revokes a VoucherCode, moving it to status revoked and preventing any further redemptions. Existing redemptions remain on the code's history. Used by customer-service teams when a voucher needs to be cancelled (for example after a chargeback on the purchasing order, or in response to a fraud report).

Revoking a code is permanent — there is no unrevoke. To restore spending power to a customer after a mistaken revoke, issue a fresh voucher.

Path parameters

  • voucherCodeIdobject-idrequired

    The unique identifier of the VoucherCode. Each issued voucher has its own VoucherCode record holding the redemption code, balance, validity window, and fulfilment state.

Responses

  • 200

    The voucher code was successfully revoked.

  • 401

    The user is unauthenticated

  • 403

    The authenticated user does not have permission.

  • 404

    The resource couldn't be found