acomodo-Ticketshop GraphQL API

API documentation.

API Endpoints
https://stage-api.acomodo.de/graphql
Version

0.6.0

Authorization

The Client Authorization works via an HTTP Header, as an long-term access-token. The access-tokens will be generated from codekeepers only on request

HTTP Header
Authorization: <access-token>

Changelog

Versions

0.6.0

  • update non-null and add explizit "optional" to the description.

0.5.0

  • add order to ticket_sold mutation
  • add order query endpoint

0.4.1

  • add info about the ticket category price array to the documentation.

0.4.0

  • add mutation tickets_free: remove the block from tickets before they expire.

0.1

  • initial release

Sort-Directive

Arguments
Name Description
fields - [Sort!]
Field directive
@sort(fields: [{field: "location_id", asc: true}])
            
            

Queries

category

Response

Returns a Category

Arguments
Name Description
category_id - Int

Example

Query
query category($category_id: Int) {
  category(category_id: $category_id) {
    category_id
    name
  }
}
Variables
{"category_id": 987}
Response
{
  "data": {
    "category": {
      "category_id": 987,
      "name": "xyz789"
    }
  }
}

event

Response

Returns an Event

Arguments
Name Description
event_id - Int
client_id - Int
search - String
location_id - Int
date_from - String
date_to - String
state - String

Example

Query
query event(
  $event_id: Int,
  $client_id: Int,
  $search: String,
  $location_id: Int,
  $date_from: String,
  $date_to: String,
  $state: String
) {
  event(
    event_id: $event_id,
    client_id: $client_id,
    search: $search,
    location_id: $location_id,
    date_from: $date_from,
    date_to: $date_to,
    state: $state
  ) {
    event_id
    title
    client_id
    location_id
    location {
      ...EventLocationFragment
    }
    subtitle
    description
    entry_info
    more_info
    start_date
    start_time
    end_date
    end_time
    advanced_sales_end_time
    external_url
    categories {
      ...CategoryFragment
    }
    images {
      ...EventImageFragment
    }
    tickets {
      ...EventTicketInfoFragment
    }
    tickets_sold {
      ...TicketSoldFragment
    }
    tickets_available
    tickets_contingent
  }
}
Variables
{
  "event_id": 123,
  "client_id": 123,
  "search": "abc123",
  "location_id": 987,
  "date_from": "xyz789",
  "date_to": "abc123",
  "state": "xyz789"
}
Response
{
  "data": {
    "event": {
      "event_id": 987,
      "title": "xyz789",
      "client_id": 123,
      "location_id": 987,
      "location": EventLocation,
      "subtitle": "xyz789",
      "description": "abc123",
      "entry_info": "abc123",
      "more_info": "xyz789",
      "start_date": "xyz789",
      "start_time": "xyz789",
      "end_date": "xyz789",
      "end_time": "xyz789",
      "advanced_sales_end_time": "abc123",
      "external_url": "abc123",
      "categories": [Category],
      "images": [EventImage],
      "tickets": [EventTicketInfo],
      "tickets_sold": [TicketSold],
      "tickets_available": 987,
      "tickets_contingent": 123
    }
  }
}

events

Response

Returns an EventPagination

Arguments
Name Description
first - Int
offset - Int

Example

Query
query events(
  $first: Int,
  $offset: Int
) {
  events(
    first: $first,
    offset: $offset
  ) {
    totalCount
    edges {
      ...EventFragment
    }
    pageInfo {
      ...pageInfoFragment
    }
  }
}
Variables
{"first": 123, "offset": 123}
Response
{
  "data": {
    "events": {
      "totalCount": 123,
      "edges": [Event],
      "pageInfo": pageInfo
    }
  }
}

locations

Response

Returns [EventLocation]

Arguments
Name Description
client_id - Int
state - String Filter all location by event with state:
available (only tickets with more than 1 for sale),
shop (also sold-out tickets),
all

Example

Query
query locations(
  $client_id: Int,
  $state: String
) {
  locations(
    client_id: $client_id,
    state: $state
  ) {
    location_id
    name
    client_id
  }
}
Variables
{"client_id": 123, "state": "abc123"}
Response
{
  "data": {
    "locations": [
      {
        "location_id": 123,
        "name": "abc123",
        "client_id": 123
      }
    ]
  }
}

order

Description

returns details of an order. Restricted to users with role: VIEW_ORDER

Response

Returns an Order

Arguments
Name Description
order_id - Int

Example

Query
query order($order_id: Int) {
  order(order_id: $order_id) {
    order_id
    state
    firstname
    lastname
    country
    postal_code
    city
    street
    email
    phone
    timestamp
    access_token
    tickets {
      ...OrderTicketFragment
    }
  }
}
Variables
{"order_id": 123}
Response
{
  "data": {
    "order": {
      "order_id": 987,
      "state": "xyz789",
      "firstname": "abc123",
      "lastname": "abc123",
      "country": "xyz789",
      "postal_code": "xyz789",
      "city": "xyz789",
      "street": "xyz789",
      "email": "xyz789",
      "phone": "xyz789",
      "timestamp": "abc123",
      "access_token": "abc123",
      "tickets": [OrderTicket]
    }
  }
}

timestamp

Description

the current server unix timestamp. Relevant for the ticket-block expire timestamp.

Response

Returns an Int

Example

Query
query timestamp {
  timestamp
}
Response
{"data": {"timestamp": 123}}

Mutations

order

Response

Returns an Int

Arguments
Name Description
tickets - [OrderTicketInput!]
order - OrderInput!

Example

Query
mutation order(
  $tickets: [OrderTicketInput!],
  $order: OrderInput!
) {
  order(
    tickets: $tickets,
    order: $order
  )
}
Variables
{
  "tickets": [OrderTicketInput],
  "order": OrderInput
}
Response
{"data": {"order": 987}}

order_cancel

Response

Returns a Boolean!

Arguments
Name Description
order_id - Int!
access_token - String!
ticket_ids - [Int!]
mail - Boolean optional, default true
refund_reason - String optional

Example

Query
mutation order_cancel(
  $order_id: Int!,
  $access_token: String!,
  $ticket_ids: [Int!],
  $mail: Boolean,
  $refund_reason: String
) {
  order_cancel(
    order_id: $order_id,
    access_token: $access_token,
    ticket_ids: $ticket_ids,
    mail: $mail,
    refund_reason: $refund_reason
  )
}
Variables
{
  "order_id": 987,
  "access_token": "xyz789",
  "ticket_ids": [987],
  "mail": false,
  "refund_reason": "abc123"
}
Response
{"data": {"order_cancel": false}}

order_payment

Response

Returns a Boolean!

Arguments
Name Description
order_id - Int!
psp_reference - String!
payment_method - String!

Example

Query
mutation order_payment(
  $order_id: Int!,
  $psp_reference: String!,
  $payment_method: String!
) {
  order_payment(
    order_id: $order_id,
    psp_reference: $psp_reference,
    payment_method: $payment_method
  )
}
Variables
{
  "order_id": 987,
  "psp_reference": "abc123",
  "payment_method": "abc123"
}
Response
{"data": {"order_payment": false}}

ticket_storno

Response

Returns a Boolean

Arguments
Name Description
ticket_uuid - String!
reason - String optional

Example

Query
mutation ticket_storno(
  $ticket_uuid: String!,
  $reason: String
) {
  ticket_storno(
    ticket_uuid: $ticket_uuid,
    reason: $reason
  )
}
Variables
{
  "ticket_uuid": "xyz789",
  "reason": "xyz789"
}
Response
{"data": {"ticket_storno": false}}

ticket_verify

Response

Returns an EventTicket

Arguments
Name Description
ticket_uuid - String!
invalidation - Boolean optional, default false

Example

Query
mutation ticket_verify(
  $ticket_uuid: String!,
  $invalidation: Boolean
) {
  ticket_verify(
    ticket_uuid: $ticket_uuid,
    invalidation: $invalidation
  ) {
    ticket_id
    event_id
    uuid
    state
    category
    price
    reason
    invalid
  }
}
Variables
{
  "ticket_uuid": "abc123",
  "invalidation": false
}
Response
{
  "data": {
    "ticket_verify": {
      "ticket_id": 123,
      "event_id": 123,
      "uuid": "abc123",
      "state": "abc123",
      "category": "xyz789",
      "price": "abc123",
      "reason": "abc123",
      "invalid": true
    }
  }
}

tickets_block

Response

Returns a TicketBlock

Arguments
Name Description
event_id - Int!
tickets - [TicketInput!]

Example

Query
mutation tickets_block(
  $event_id: Int!,
  $tickets: [TicketInput!]
) {
  tickets_block(
    event_id: $event_id,
    tickets: $tickets
  ) {
    expire
    ticket_ids
  }
}
Variables
{"event_id": 987, "tickets": [TicketInput]}
Response
{
  "data": {
    "tickets_block": {
      "expire": "abc123",
      "ticket_ids": [123]
    }
  }
}

tickets_block_free

Response

Returns a Boolean!

Arguments
Name Description
ticket_ids - [Int!]

Example

Query
mutation tickets_block_free($ticket_ids: [Int!]) {
  tickets_block_free(ticket_ids: $ticket_ids)
}
Variables
{"ticket_ids": [987]}
Response
{"data": {"tickets_block_free": true}}

tickets_sold

Response

Returns [TicketSold]

Arguments
Name Description
ticket_ids - [Int!]
status - String! free, blocked, pre-pay, payed, storno
order_id - Int optional, reference to the returned id from the order mutation

Example

Query
mutation tickets_sold(
  $ticket_ids: [Int!],
  $status: String!,
  $order_id: Int
) {
  tickets_sold(
    ticket_ids: $ticket_ids,
    status: $status,
    order_id: $order_id
  ) {
    ticket_id
    ticket_uuid
    timestamp
    state
    reason
  }
}
Variables
{
  "ticket_ids": [987],
  "status": "abc123",
  "order_id": 987
}
Response
{
  "data": {
    "tickets_sold": [
      {
        "ticket_id": 987,
        "ticket_uuid": "xyz789",
        "timestamp": 987,
        "state": "abc123",
        "reason": "abc123"
      }
    ]
  }
}

Types

Boolean

Description

The Boolean scalar type represents true or false.

Example
true

Category

Fields
Field Name Description
category_id - Int
name - String
Example
{"category_id": 123, "name": "xyz789"}

Event

Description

Event Type

Fields
Field Name Description
event_id - Int unique eventID
title - String
client_id - Int
location_id - Int
location - EventLocation the event location
Arguments
client_id - Int
state - String

Filter all location by event with state:
available (only tickets with more than 1 for sale),
shop (also sold-out tickets),
all

subtitle - String
description - String
entry_info - String
more_info - String
start_date - String format: "yyyy-mm-dd"
start_time - String format: "hh:mm:ss"
end_date - String format: "yyyy-mm-dd"
end_time - String format: "hh:mm:ss"
advanced_sales_end_time - String
external_url - String
categories - [Category]
Arguments
category_id - Int
images - [EventImage]
tickets - [EventTicketInfo]
tickets_sold - [TicketSold]
tickets_available - Int
tickets_contingent - Int
Example
{
  "event_id": 987,
  "title": "xyz789",
  "client_id": 987,
  "location_id": 123,
  "location": EventLocation,
  "subtitle": "abc123",
  "description": "xyz789",
  "entry_info": "xyz789",
  "more_info": "xyz789",
  "start_date": "abc123",
  "start_time": "xyz789",
  "end_date": "abc123",
  "end_time": "xyz789",
  "advanced_sales_end_time": "abc123",
  "external_url": "xyz789",
  "categories": [Category],
  "images": [EventImage],
  "tickets": [EventTicketInfo],
  "tickets_sold": [TicketSold],
  "tickets_available": 123,
  "tickets_contingent": 987
}

EventImage

Fields
Field Name Description
path - String
copyright - String
Example
{
  "path": "abc123",
  "copyright": "xyz789"
}

EventLocation

Fields
Field Name Description
location_id - Int
name - String
client_id - Int
Example
{
  "location_id": 123,
  "name": "abc123",
  "client_id": 123
}

EventPagination

Fields
Field Name Description
totalCount - Int
edges - [Event]
Arguments
event_id - Int
client_id - Int
search - String
location_id - Int
date_from - String
date_to - String
state - String
pageInfo - pageInfo
Example
{
  "totalCount": 987,
  "edges": [Event],
  "pageInfo": pageInfo
}

EventTicket

Fields
Field Name Description
ticket_id - Int
event_id - Int
uuid - String
state - String free, blocked, pre-pay, payed, storno
category - String
price - String
reason - String
invalid - Boolean
Example
{
  "ticket_id": 123,
  "event_id": 987,
  "uuid": "abc123",
  "state": "abc123",
  "category": "xyz789",
  "price": "abc123",
  "reason": "abc123",
  "invalid": false
}

EventTicketInfo

Fields
Field Name Description
name - String
price - [Float] array_index to price mapping:
0: Pre sale
1: Box office
2: Online: Box office + Online fee
category_id - Int
Example
{
  "name": "abc123",
  "price": [987.65],
  "category_id": 987
}

Float

Description

The Float scalar type represents signed double-precision fractional values as specified by IEEE 754.

Example
123.45

Int

Description

The Int scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.

Example
987

Order

Description

Order Type

Fields
Field Name Description
order_id - Int
state - String
firstname - String
lastname - String
country - String
postal_code - String
city - String
street - String
email - String
phone - String
timestamp - String
access_token - String
tickets - [OrderTicket]
Example
{
  "order_id": 987,
  "state": "xyz789",
  "firstname": "xyz789",
  "lastname": "xyz789",
  "country": "xyz789",
  "postal_code": "xyz789",
  "city": "abc123",
  "street": "abc123",
  "email": "xyz789",
  "phone": "abc123",
  "timestamp": "xyz789",
  "access_token": "abc123",
  "tickets": [OrderTicket]
}

OrderInput

Fields
Input Field Description
adyen_reference - String!
firstname - String!
lastname - String!
country - String!
postal_code - String!
city - String!
street - String!
street_additional - String
email - String!
phone - String!
Example
{
  "adyen_reference": "abc123",
  "firstname": "abc123",
  "lastname": "abc123",
  "country": "abc123",
  "postal_code": "abc123",
  "city": "abc123",
  "street": "xyz789",
  "street_additional": "xyz789",
  "email": "abc123",
  "phone": "xyz789"
}

OrderTicket

Description

Order Ticket Type

Fields
Field Name Description
order_ticket_id - Int
order_id - Int
ticket_id - Int
ticket - EventTicket
meta_price - Float
meta_category_id - Float
Example
{
  "order_ticket_id": 987,
  "order_id": 123,
  "ticket_id": 987,
  "ticket": EventTicket,
  "meta_price": 987.65,
  "meta_category_id": 123.45
}

OrderTicketInput

Fields
Input Field Description
ticket_id - Int!
category_id - Int!
price - Float!
Example
{"ticket_id": 987, "category_id": 123, "price": 987.65}

Sort

Fields
Input Field Description
field - String
asc - Boolean
Example
{"field": "abc123", "asc": false}

String

Description

The String scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.

Example
"abc123"

TicketBlock

Fields
Field Name Description
expire - String
ticket_ids - [Int!]
Example
{"expire": "abc123", "ticket_ids": [987]}

TicketInput

Fields
Input Field Description
category - Int!
amount - Int!
Example
{"category": 123, "amount": 123}

TicketSold

Fields
Field Name Description
ticket_id - Int!
ticket_uuid - String
timestamp - Int unix timestamp, ticket sold time
state - String! free, blocked, pre-pay, payed, storno
reason - String
Example
{
  "ticket_id": 123,
  "ticket_uuid": "abc123",
  "timestamp": 123,
  "state": "xyz789",
  "reason": "xyz789"
}

pageInfo

Fields
Field Name Description
endCursor - Int
hasNextPage - Boolean!
Example
{"endCursor": 987, "hasNextPage": true}