API · v1 · stable
CODEMETA OSDeveloper Center
EN
Open console
Entity · course_vouchers

Course Voucher Schema

Schema ID
course_voucher
Collection
course_vouchers
Permissions
  • Readcourse_voucher_view
  • Createcourse_voucher_create
  • Editcourse_voucher_edit
  • Deletecourse_voucher_delete
Relationships

Fields

Course Voucher Schema

course_vouchers4 permissions

Single-use or limited-use voucher granting course access (ADR 0066b Phase 4)

codestringrequired

Voucher code (uppercased ASCII alnum + dash/underscore).

4–32 charactersPatternread-only
courseIduuidrequired→ course
shareIduuidrequired

course_shares row this voucher is bound to.

consumerTenantIdstringoptional
PatternDefault: nullnullable
discountModestringoptional
freefixed_off_centspercent_off
Default: "free"
discountValueintegeroptional

For fixed_off_cents: cents to subtract. For percent_off: 0..100. Ignored for free.

≥ 0Default: 0
maxRedemptionsintegerrequired

Total times the code may be redeemed across all users.

≥ 1Default: 1
redemptionsintegeroptional
≥ 0Default: 0read-only
redeemedByobject[]optional
Default: []read-only
userIduuidrequired
tenantIduuidrequired
read-only
redeemedAtdatetimerequired
enrollmentIduuidrequired
validFromdatetimeoptional
Default: nullnullable
validUntildatetimeoptional
Default: nullnullable
statusstringoptional
activedepletedexpiredrevoked
Default: "active"
notesstringoptional
max 2000 charactersnullable

Standard endpoints

This resource follows the platform's generic CRUD contract. Read the conventions for pagination, idempotency, optimistic locking and audit. The most important endpoints:

  • GET /api/v1/course_vouchers — List, paginated + filterable
  • GET /api/v1/course_vouchers/<id> — Single entity
  • POST /api/v1/course_vouchers — Create
  • PATCH /api/v1/course_vouchers/<id> — Partial update
  • DELETE /api/v1/course_vouchers/<id> — Soft delete
  • GET /api/v1/course_vouchers/<id>/timeline — Audit + activities

Search