Create access code

Create an access code for a ticket type, with an optional limit.

POST https://cotlet.dev/api/v1/billetto/events/{event_id}/access-codes

write Confirm

Does what Generate access code does under Promotions & Offers > Access Codes: it ties the code to one ticket type. The discount comes from that ticket type's own price, so use a ticket type that list_ticket_types shows with needs_access_code true. limit caps the tickets bought with the code in total, not the number of times the code is used. A code gives access to tickets that cost money, so each call needs your OK by default. By default you confirm each call; you can switch that off for this tool.

Parameters

Parameters: create_access_code
NameTypeDescription
event_id string required string Event ID from list_events.
ticket_type_id string required string Ticket type ID from list_ticket_types.
code string required string The code buyers type in.
limit integer integer Most tickets that can be bought with this code in total.

Request

cURL
curl -X POST https://cotlet.dev/api/v1/billetto/events/event_8c41d2/access-codes \
  -H "Authorization: Bearer $COTLET_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"ticket_type_id":"ticket_type_8c41d2","code":"code"}'
Python
result = client.call("billetto", "create_access_code", {"event_id":"event_8c41d2","ticket_type_id":"ticket_type_8c41d2","code":"code"})
Node.js
const result = await cotlet.call('billetto', 'create_access_code', {"event_id":"event_8c41d2","ticket_type_id":"ticket_type_8c41d2","code":"code"});
CLI
cotlet call billetto create_access_code --data '{"event_id":"event_8c41d2","ticket_type_id":"ticket_type_8c41d2","code":"code"}'

Example response

JSON

{
  "event_id": "1204551",
  "ticket_type_id": "77122",
  "code": "HARBOUR18",
  "limit": 30,
  "status": "created"
}

Sign in once. Your agent does the rest.

Sign up and add the apps you need. Free 7-day trial with 2,000 credits, no card needed.