Get Started Selling Tickets

This guide demonstrates how to sell tickets with our Ticketing API.

Objectives

  • Create an event
  • Sell a ticket on your app or website
Visualizing the checkout flow
1. Create Checkout - The user already selected their tickets and begins the checkout process
2. Update Checkout - The user fills out form fields to update ticket information.
3. Authorize Credit Card - The user submits credit card information to Stripe and a card token is received.
4. Make Payment - Pass the card token to the payment endpoint.
5. Confirm Payment - The user confirms purchase and the transaction is complete.

Picatic checkout process

Step 1: Create an Event


Click here to create an event.

If you already have an event, you can skip this step.

Step 2: Create a Ticket


When in the event creator, click on the Tickets button in the sidebar. Next, add tickets to your event.

Create a ticket

If your event already has tickets, you can skip this step.

Step 3: Get Your Event ID


To find the ID for your event, click on the Manage button in the sidebar.

Your event ID is the number at the end of the url - ex: https://www.picatic.com/manage/reports/sales_summary/:eventID.

Step 4: Find Tickets For Your Event


Find all the tickets for a particular event.

Sample Request
```javascript fetch('https://api.picatic.com/v2/ticket_price?filter[event_id]=999&page[limit]=2&page[offset]=0', { method: 'GET', }) .then(function(res) { return res.json() }) .then(function(checkoutObj) { console.log(checkoutObj.data) }) .catch(function(err) { console.log(err) }); ```

Step 5: Create Checkout


Create a checkout order and reserve a ticket for 20 minutes.

Sample Request
```javascript fetch('https://api.picatic.com/v2/checkout', { method: 'POST', body: JSON.stringify({ data: { attributes: { event_id: 999, tickets: [ { ticket_price: { ticket_price_id: 903 } } ] }, type: 'checkout' } }) }) .then(res => res.json()) .then(checkoutObj => console.log(checkoutObj.data)) .catch(err => console.log(err)); ```

Step 6: Update Checkout


Update invoice, tickets and surveys information from an existing checkout.

Sample Request
```javascript fetch('https://api.picatic.com/v2/checkout/2978d285-4dbd-4def-ac49-d8d3df6336b5', { method: 'PATCH', body: JSON.stringify({ data: { attributes: { event_id: 999, invoice: { email: "sofiawilson@test.com", first_name: "Addison", invoice_id: 767, last_name: "White" }, tickets: [ { email: "sofiawilson@test.com", first_name: "Addison", last_name: "White", ticket_id: 441, ticket_price: { ticket_price_id: 903 } } ] }, id: "2978d285-4dbd-4def-ac49-d8d3df6336b5", type: "checkout" } }) }) .then(res => res.json()) .then(checkoutObj => console.log(checkoutObj.data)) .catch(err => console.log(err)); ```

Step 7: Pay for Checkout


To complete the checkout you must get a `card_token` from Stripe.

In most cases, you should create tokens client-side using Stripe's Checkout, Elements or their mobile libraries.

Once you receive the token, you can pass it to the payment endpoint.

Sample Request
```javascript fetch('https://api.picatic.com/v2/checkout/67c79dc0-8ea1-4ef3-afa8-c3e41d9aba86/payment', { method: 'POST', body: JSON.stringify({ data: { attributes: { event_id: 999, payment: { source: { card_token: 'tok_AD82lSq8S7MhJJ', } } }, id: '67c79dc0-8ea1-4ef3-afa8-c3e41d9aba86', type: 'checkout' } }) }) .then(res => res.json()) .then(checkoutObj => console.log(checkoutObj.data)) .catch(err => console.log(err)); ```

Step 8: Confirm Checkout


Confirm, validates and completes the registration/purchase of the ticket.

Sample Request
```javascript fetch('https://api.picatic.com/v2/checkout/67c79dc0-8ea1-4ef3-afa8-c3e41d9aba86/confirm', { method: 'POST', }) .then(res => res.json()) .then(checkoutObj => console.log(checkoutObj.data)) .catch(err => console.log(err)); ```

Congratulations, you just sold your first ticket with the Picatic API!