API · v1 · stable
CODEMETA OSDeveloper Center
FR
Ouvrir la console
Entité · course_vouchers

Course Voucher Schema

ID du schéma
course_voucher
Collection
course_vouchers
Autorisations
  • Lirecourse_voucher_view
  • Créercourse_voucher_create
  • Modifiercourse_voucher_edit
  • Supprimercourse_voucher_delete
Relations

Champs

Course Voucher Schema

course_vouchers4 autorisations

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

codestringobligatoire

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

4–32 caractèresMotiflecture seule
courseIduuidobligatoire→ course
shareIduuidobligatoire

course_shares row this voucher is bound to.

consumerTenantIdstringfacultatif
MotifPar défaut : nullnullable
discountModestringfacultatif
freefixed_off_centspercent_off
Par défaut : "free"
discountValueintegerfacultatif

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

≥ 0Par défaut : 0
maxRedemptionsintegerobligatoire

Total times the code may be redeemed across all users.

≥ 1Par défaut : 1
redemptionsintegerfacultatif
≥ 0Par défaut : 0lecture seule
redeemedByobject[]facultatif
Par défaut : []lecture seule
userIduuidobligatoire
tenantIduuidobligatoire
lecture seule
redeemedAtdatetimeobligatoire
enrollmentIduuidobligatoire
validFromdatetimefacultatif
Par défaut : nullnullable
validUntildatetimefacultatif
Par défaut : nullnullable
statusstringfacultatif
activedepletedexpiredrevoked
Par défaut : "active"
notesstringfacultatif
max. 2000 caractèresnullable

Endpoints standard

Cette ressource suit le contrat CRUD générique de la plateforme. Lisez les conventions pour la pagination, l'idempotence, le verrouillage optimiste et l'audit. Les endpoints principaux :

  • GET /api/v1/course_vouchers — Liste, paginée et filtrable
  • GET /api/v1/course_vouchers/<id> — Une entité
  • POST /api/v1/course_vouchers — Créer
  • PATCH /api/v1/course_vouchers/<id> — Mise à jour partielle
  • DELETE /api/v1/course_vouchers/<id> — Suppression logique
  • GET /api/v1/course_vouchers/<id>/timeline — Audit et activités

Recherche