Skip to content

Create Ticket

POST/tickets

Create a new ticket.

Attributes

AttributeTypeDescription
eventId *number
ticketBatchIdnumberRequired for ticket events
firstNamestring
lastNamestring
email *string
status *stringattending, invited
phonestringMobile phone number with country code. Example: +46701234567
companystring
commentstring
sendEmailConfirmation *booleanIf set to true, an email confirmation will be sent to the attendee / invitee.

Fields marked with * are required.

Request

js
import Confetti from 'confetti'

const confetti = new Confetti({ apiKey: 'your-key' })

const ticket = await confetti.tickets.create({
  eventId: 1,
  firstName: 'Jane',
  lastName: 'Doe',
  email: 'jane@example.com',
  status: 'attending',
  phone: '+46701234567',
  comment: 'A note',
  sendEmailConfirmation: true,
})
sh
curl -X POST "https://api.confetti.events/tickets" \
  -H "Content-Type: application/json" \
  -H "Authorization: apikey your-key" \
  -d '{
  "data": {
    "type": "ticket",
    "attributes": {
      "eventId": 1,
      "firstName": "Jane",
      "lastName": "Doe",
      "email": "jane@example.com",
      "status": "attending",
      "phone": "+46701234567",
      "comment": "A note",
      "sendEmailConfirmation": true
    }
  }
}'