rabattcodes.aendern
Changes a discount code (id) with all fields (code, art, wert, limits, aktiv). Without an actual change nothing is written (geaendert=false); otherwise an audit log entry is created with the value before and after. Owner only. Changes data. Mutation — changes data.
Input parameters
| Field | Type | Required | Notes |
|---|---|---|---|
id | string | yes | |
felder | object | yes | |
felder.code | string | yes | |
felder.art | enum | yes | One of: prozent, betrag |
felder.wert | integer | yes | |
felder.minNaechte | integer · nullable | yes | |
felder.aufenthaltVon | string · nullable | yes | |
felder.aufenthaltBis | string · nullable | yes | |
felder.buchbarVon | string · nullable | yes | |
felder.buchbarBis | string · nullable | yes | |
felder.maxEinloesungen | integer · nullable | yes | |
felder.aktiv | boolean | yes |
Output fields
| Field | Type | Required | Notes |
|---|---|---|---|
id | string | yes | |
geaendert | boolean | yes |
rabattcodes.anlegen
Creates a discount code for the direct booking page: code, art (prozent or betrag), wert, optionally minNaechte, stay and booking period, maxEinloesungen, aktiv. The code is normalized; a code that is already taken returns CONFLICT. Owner only. Changes data and writes an audit log entry. Mutation — changes data.
Input parameters
| Field | Type | Required | Notes |
|---|---|---|---|
code | string | yes | |
art | enum | yes | One of: prozent, betrag |
wert | integer | yes | |
minNaechte | integer · nullable | yes | |
aufenthaltVon | string · nullable | yes | |
aufenthaltBis | string · nullable | yes | |
buchbarVon | string · nullable | yes | |
buchbarBis | string · nullable | yes | |
maxEinloesungen | integer · nullable | yes | |
aktiv | boolean | yes |
Output fields
| Field | Type | Required | Notes |
|---|---|---|---|
id | string | yes | |
code | string | yes |
rabattcodes.liste
All codes of the property with redemptions x/max, newest first. Read-only query.
Input parameters
Returns object.
Output fields
Returns array of object. Fields of each element:
| Field | Type | Required | Notes |
|---|---|---|---|
id | string | yes | |
code | string | yes | |
art | enum | yes | One of: prozent, betrag |
wert | number | yes | |
minNaechte | number · nullable | yes | |
aufenthaltVon | string · nullable | yes | |
aufenthaltBis | string · nullable | yes | |
buchbarVon | string · nullable | yes | |
buchbarBis | string · nullable | yes | |
maxEinloesungen | number · nullable | yes | |
aktiv | boolean | yes | |
erstelltAm | string | yes | |
eingeloest | number | yes | |
vorgemerkt | number | yes | |
rabattSummeCents | number | yes | |
loeschbar | boolean | yes |
rabattcodes.loeschen
Delete a discount code that has NEVER been used (no redemption, no pending Stripe checkout). A used code cannot be deleted — deactivate it with rabattcodes.setzeAktiv instead. Irreversible. Requires confirmation.
Input parameters
| Field | Type | Required | Notes |
|---|---|---|---|
id | string | yes |
Output fields
| Field | Type | Required | Notes |
|---|---|---|---|
id | string | yes |
rabattcodes.setzeAktiv
Deactivate (and reactivate again) — the way to handle codes that have been used. Mutation — changes data.
Input parameters
| Field | Type | Required | Notes |
|---|---|---|---|
id | string | yes | |
aktiv | boolean | yes |
Output fields
| Field | Type | Required | Notes |
|---|---|---|---|
id | string | yes | |
aktiv | boolean | yes | |
geaendert | boolean | yes |