Create and delete ticket definitions
Add a ticket option to an existing publication event, or remove a definition that has no passes. A ticket definition is configuration; an issued pass is a separate record. These operations do not issue passes or create reader memberships.
| Task | Operation | Normal response |
|---|---|---|
| Create a definition under an event | POST /api/v1/admin/ti-event/ticket | HTTP 201, root ticket with stored discounts |
| Remove a definition with no passes | DELETE /api/v1/admin/ti-event/ticket/{id} | HTTP 200, Boolean result |
Before you start
Use an existing token authorized for the selected publication with an admin or partner role; root is also permitted. The caller must be active and authorized there. Service-account credentials are not supported. Keep these privileged calls in trusted server code. For authentication and permission failures, see shared credential errors with these write roles.
| Header | Type / requirement | Meaning |
|---|---|---|
resource | Required string | Publication public key, supplied as RESOURCE_KEY. |
token | Required string | Existing eligible staff token, supplied as ADMIN_TOKEN. |
Content-Type | Required for the create example | Use application/json for the create body. Deletion has no body. |
Find an existing event and its ticket IDs through event discovery. Optional discount entries need a Plan in the same publication; use catalog discovery. A Plan defines access rules, a subscription is a catalog choice within it, and a membership links a reader to that choice. A discount reference does not create any of them.
The examples use separate fixtures:
| Task | Event | Ticket definition | Starting state |
|---|---|---|---|
| Create | 5001 | New ticket 5101 | Event 5001 and Plan 5301 already exist. Discount record 5201 is returned with the created ticket. |
| Delete | 8001 | Existing ticket 8101 | Ticket 8101 already has no passes. This example does not delete ticket 5101. |
Examples use cURL, Node.js 18+ built-in fetch in an ES module (.mjs), and Python 3 urllib. Set WALLKIT_API_BASE to scheme and host only, plus RESOURCE_KEY and ADMIN_TOKEN. See example conventions. All examples are synthetic and unexecuted.
Create inputs
Send a JSON object with an event ID, title, slug, price, currency and numeric quantity. Use explicit JSON booleans for activity/privacy settings and positive integer counts and order limits. Omitted or null optional fields are not set by this request. Do not assume what value will be stored. Supply active as an explicit JSON boolean.
| Body field | Requirement / handling |
|---|---|
ti_event_id | Required integer event ID in the selected publication. |
title | Required string, 3–250 characters; must remain nonempty after sanitation/trimming. |
slug | Required string, 3–64 characters. Use letters/digits; stored value is normalized to lowercase alphanumeric text. |
price | Required; use an integer amount under your agreed currency convention. The example uses USD cents. |
currency | Required string; stored uppercase. Example: USD. |
quantity | Numeric; use a positive integer count. |
min_quantity_order | Optional positive integer count. |
max_quantity_order | Optional positive integer count. |
active | Send an explicit JSON boolean; no default is assumed in this workflow. |
is_private | Optional JSON boolean; supply explicitly when the setting matters. |
is_applied_vat | Optional boolean VAT setting. |
vat_percent | Optional numeric configured percentage value. |
description | Optional string, minimum 3 characters when supplied; content stored as supplied. |
status | Optional nonempty string, minimum 3 characters; a complete enum is unspecified here. |
start_date, end_date | Optional nonempty date/time strings. |
extra | Optional whole JSON configuration object. Basic examples omit it. |
plan_discounts | Optional array of complete discount entries. |
Choose coherent quantities and dates for your application. Supplied dates are formatted for storage as Y-m-d H:i:s; there is no separate ticket timezone input. These fields describe configuration, not a reservation or an evaluated sale window.
The money example uses USD integer cents, following the Admin convention: price 2500 represents $25.00. This is guidance for this USD example, not a promise about arbitrary decimal inputs or every currency. Percentage values and counts are integers without monetary conversion. VAT settings do not calculate tax or establish a checkout total.
Extra configuration
Supply extra as a whole JSON configuration object, not a metadata merge or patch. If extra is omitted or null, it is left unassigned. Other workflows can consume these settings. The basic example omits extra. This creation request does not itself issue passes or create reader memberships.
Optional Plan discounts
For creation, omitted, null or empty plan_discounts adds no discounts. Each entry refers to an existing Plan in the selected publication. Supply each intended entry as a complete configuration; omitted entry fields use the defaults below. The example supplies all entry fields explicitly.
| Entry field | Type / requirement / default | Meaning |
|---|---|---|
plan_id | Required integer Plan ID | Existing Plan in this publication, distinct from the event, ticket or discount-row ID. |
discount | Integer value; default 0 | For percent, use an integer percentage from 0 to 100. For amount, use the agreed integer amount convention and do not exceed the configured ticket price. No effective discount is calculated by this write. |
discount_type | percent or amount; default percent | Select the stored discount kind. |
currency | Optional configured currency string; default null | Stored discount currency. Supply a supported configured value such as USD when needed. |
active | Boolean; default false | Stored discount activity. Defaults to false when omitted from an entry. |
Discount configuration does not create a subscription, mutate a Plan, determine reader eligibility or guarantee a financial effect.
Returned ticket and discounts
Creation returns the ticket at the root, including plan_discounts. Use the shared ticket-definition fields for the exact 18 ticket fields and seven discount fields. Their field names are the same here; they are not nested under an event's tickets array in this response.
| Returned fields | Type / presence | Meaning |
|---|---|---|
| Ticket fields | Root fields | ID/parent event, text, quantity/order settings, price/currency, status/dates, private/active/VAT settings and extra configuration. Stored scalar representations are not uniformly converted. |
plan_discounts | Always an array | Stored discount records, including inactive records; [] when none. Each has id, ticket ID, Plan ID, discount/type/currency and active setting. |
No items, data or paginator wrapper is added. This response does not expand passes, owners, invitations, authentication tokens, parent-event objects or computed available stock. Active flags and stored quantities do not establish sale availability, eligibility, a checkout total, tax or admission.
Create a ticket definition
POST /api/v1/admin/ti-event/ticket
Create a definition under an existing publication event. Have the event ID and any referenced Plan ID ready; this is not a purchase or pass-issuance request.
Example: Create ticket 5101 under event 5001
Send explicit flags and positive integer counts. Plan 5301 already belongs to the publication. The request stores a 10-percent discount setting; it does not apply that discount to a purchase.
curl -X POST "${WALLKIT_API_BASE}/api/v1/admin/ti-event/ticket" \
-H "resource: ${RESOURCE_KEY}" \
-H "token: ${ADMIN_TOKEN}" \
-H "Content-Type: application/json" \
--data '{
"ti_event_id": 5001,
"title": "General admission",
"slug": "generaladmission",
"price": 2500,
"currency": "USD",
"quantity": 100,
"min_quantity_order": 1,
"max_quantity_order": 4,
"active": false,
"is_private": false,
"is_applied_vat": false,
"vat_percent": 0,
"plan_discounts": [
{
"plan_id": 5301,
"discount": 10,
"discount_type": "percent",
"currency": "USD",
"active": true
}
]
}'
const response = await fetch(`${process.env.WALLKIT_API_BASE}/api/v1/admin/ti-event/ticket`, {
method: "POST",
headers: {resource: process.env.RESOURCE_KEY, token: process.env.ADMIN_TOKEN, "Content-Type": "application/json"},
body: JSON.stringify({
"ti_event_id": 5001,
"title": "General admission",
"slug": "generaladmission",
"price": 2500,
"currency": "USD",
"quantity": 100,
"min_quantity_order": 1,
"max_quantity_order": 4,
"active": false,
"is_private": false,
"is_applied_vat": false,
"vat_percent": 0,
"plan_discounts": [
{
"plan_id": 5301,
"discount": 10,
"discount_type": "percent",
"currency": "USD",
"active": true
}
]
})
});
console.log(response.status, await response.json());
import os, json
from urllib.request import Request, urlopen
from urllib.error import HTTPError
payload = {
"ti_event_id": 5001,
"title": "General admission",
"slug": "generaladmission",
"price": 2500,
"currency": "USD",
"quantity": 100,
"min_quantity_order": 1,
"max_quantity_order": 4,
"active": False,
"is_private": False,
"is_applied_vat": False,
"vat_percent": 0,
"plan_discounts": [
{
"plan_id": 5301,
"discount": 10,
"discount_type": "percent",
"currency": "USD",
"active": True
}
]
}
request = Request(os.environ["WALLKIT_API_BASE"] + "/api/v1/admin/ti-event/ticket",
data=json.dumps(payload).encode("utf-8"),
headers={"resource": os.environ["RESOURCE_KEY"], "token": os.environ["ADMIN_TOKEN"], "Content-Type": "application/json"},
method="POST")
try:
with urlopen(request) as response:
print(response.status, json.load(response))
except HTTPError as error:
print(error.code, json.load(error))
Synthetic HTTP 201 excerpt; only selected configured fields and the new record IDs are shown:
{
"id": 5101,
"ti_event_id": 5001,
"title": "General admission",
"price": 2500,
"currency": "USD",
"quantity": 100,
"active": false,
"is_private": false,
"plan_discounts": [
{"id": 5201, "ti_event_ticket_id": 5101, "plan_id": 5301, "discount": 10, "discount_type": "percent", "currency": "USD", "active": true}
]
}
Use ticket ID 5101 to read its saved configuration; event ID 5001 is its parent. Discount ID 5201 identifies the stored discount record; write entries select their referenced Plan with plan_id.
Discount validation and recovery
A referenced Plan that cannot be found in the relevant publication returns HTTP 409. Synthetic error excerpt:
{"error": "ticket_plan_discount", "error_description": "Plan not found"}
| HTTP status | API code / shape | Cause | Next action |
|---|---|---|---|
| 409 | incorrect_data or invalid_<field> | Body or event/title/slug/price/currency/quantity validation failed. | Check required inputs and the selected publication/event. |
| 409 | ticket_plan_discount, description | Plan reference or discount type/value/currency could not be accepted. | Use a valid same-publication Plan and the discount input table. |
| 412 | exception, description and request reference | Creation could not complete normally. | Inspect the event's ticket definitions before another write; a record may already exist. |
| Varies / no complete response | Failed or incomplete response | Creation or its response could not be completed normally. | Retain any request reference and inspect stored state before deciding to retry. |
Next, read ticket 5101 to confirm its saved configuration.
Delete a ticket definition with no passes
DELETE /api/v1/admin/ti-event/ticket/{id}
Use an existing ticket-definition ID in the selected publication. Any user pass blocks deletion, including inactive or unassigned passes. This deletes ticket configuration, not purchased-pass records.
Associated ticket discounts and configuration links can be removed. Review access rules that reference the ticket before deletion. The parent event and shared Plan/promotion objects are distinct from the links being removed; this operation does not delete the parent event.
This is not a refund, pass-cancellation or complete access-revocation workflow. A successful response does not guarantee notification delivery or every broader business outcome.
| Input | Location / type | Requirement and meaning |
|---|---|---|
id | Path, decimal ticket ID | Required definition such as 8101, under event 8001 in this example. It is not an event, pass or reader ID. |
Example: Delete ticket 8101
Ticket 8101 already has no user passes. Send only the path ID and shared headers.
curl -X DELETE "${WALLKIT_API_BASE}/api/v1/admin/ti-event/ticket/8101" \
-H "resource: ${RESOURCE_KEY}" \
-H "token: ${ADMIN_TOKEN}"
const response = await fetch(`${process.env.WALLKIT_API_BASE}/api/v1/admin/ti-event/ticket/8101`, {
method: "DELETE",
headers: {resource: process.env.RESOURCE_KEY, token: process.env.ADMIN_TOKEN}
});
console.log(response.status, await response.json());
import os, json
from urllib.request import Request, urlopen
from urllib.error import HTTPError
request = Request(os.environ["WALLKIT_API_BASE"] + "/api/v1/admin/ti-event/ticket/8101",
headers={"resource": os.environ["RESOURCE_KEY"], "token": os.environ["ADMIN_TOKEN"]},
method="DELETE")
try:
with urlopen(request) as response:
print(response.status, json.load(response))
except HTTPError as error:
print(error.code, json.load(error))
Synthetic HTTP 200 success excerpt:
{"result": true}
| Field | Type / presence | Meaning |
|---|---|---|
result | Boolean on the normal HTTP 200 response | true reports successful ticket deletion. false does not report success. No ticket/event, items or data wrapper is added. |
False result and blocked deletion
A normal HTTP 200 response can instead be:
{"result": false}
A false result reports failure; some settings may already have changed. Inspect the ticket and event before another write.
A ticket with user passes returns the caught guard as HTTP 500. Synthetic error excerpt:
{"error": "exception", "error_description": "Cannot be deleted while it has user passes"}
| HTTP status | API code / shape | Cause | Next action |
|---|---|---|---|
| 200 | result: false | Deletion did not report success. | Inspect the definition and its parent event; contact the integration operator if unclear. |
| 409 | invalid_ticket, description | Ticket or parent-event lookup/validation failed, including the wrong publication. | Verify the selected publication and ticket ID through discovery/detail. |
| 500 | exception; Cannot be deleted while it has user passes | At least one pass belongs to the ticket. | Stop this deletion workflow and review the record with the publication administrator. |
| 500 or no complete response | exception or failed/incomplete response | Deletion or its response could not complete normally. | Inspect saved state before deciding on another request; retain any request reference. |
Next, check event 8001's remaining ticket definitions.
Check uncertain outcomes
If creation or deletion fails, the response is lost, or deletion returns false, inspect saved state before sending another write. For creation, check the event's ticket definitions and read the saved definition. For deletion, inspect the intended event and ticket state; an unsuccessful response does not prove every prior setting is unchanged. If the outcome remains unclear, retain the request reference and ask the integration operator.