acomodo-Ticketshop GraphQL API
API documentation.
API Endpoints
https://stage-api.acomodo.de/graphql
Version
0.8.2
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.8.2
- add error codes for order cancelation.
0.8.1
- fix tickets_sold.sales_channel: it is required but was described as optional.
- add descriptions to the mutations.
0.8.0
- add event relation to EventTicket
- fix the field category in EventTicket and rename it to category_id
- add category (with name) to EventTicket
0.7.2
- add error code to documentation
- add event field online_sales_end
0.7.1
- fix EventTicket.price value type to float
0.7.0
- add a "valid" field to event_ticket
- add a "ticket" query endpoint for ticket details
- add sales_reference and sales_channel to tickets_sold and TicketSold
- add SalesChannel enum
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
Error Codes
| Code | Description |
|---|---|
FORBIDDEN |
Not allowed to execute query |
TICKET-ALREADY-CANCELLED |
The ticket is already in cancelled state |
TICKET-INVALIDATED |
The ticket was already invalidated through the ticket_verfiy mutation |
TICKET-NOT-CANCELABLE |
The ticket is not cancelale, e.g. it's in the wrong state |
PRE-SALE-ENDED |
The pre sale for the event ended |
TICKET-NOT-AVAILABLE |
The ticket available to block for selling |
TICKET-NOT-FOUND |
No Ticket found |
TICKET-STATE-NOT-PAYED |
Ticket is in wrong state |
TICKET-STATE-NOT-PRE-PAY |
Ticket is in wrong state |
TICKET-STATE-NOT-BLOCKED |
Ticket is in wrong state |
TICKET-EXPIRED |
Ticket block is expired |
REFUND-NOT-POSSIBLE |
The refund of the order is currently not possible |
TICKETS-ALREADY-REFUNDED |
The requested tickets are already refunded |
Sort-Directive
Arguments
| Name | Description |
|---|---|
fields - [Sort!] |
Field directive
@sort(fields: [{field: "location_id", asc: true}])
Queries
category
event
Response
Returns an Event
Example
Query
query event(
$event_id: Int,
$client_id: Int,
$client_ids: [Int!],
$search: String,
$location_id: Int,
$date_from: String,
$date_to: String,
$state: String
) {
event(
event_id: $event_id,
client_id: $client_id,
client_ids: $client_ids,
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
online_sales_end
external_url
categories {
...CategoryFragment
}
images {
...EventImageFragment
}
tickets {
...EventTicketInfoFragment
}
tickets_sold {
...TicketSoldFragment
}
tickets_available
tickets_contingent
}
}
Variables
{
"event_id": 987,
"client_id": 987,
"client_ids": [123],
"search": "xyz789",
"location_id": 123,
"date_from": "abc123",
"date_to": "xyz789",
"state": "xyz789"
}
Response
{
"data": {
"event": {
"event_id": 987,
"title": "abc123",
"client_id": 987,
"location_id": 987,
"location": EventLocation,
"subtitle": "abc123",
"description": "abc123",
"entry_info": "xyz789",
"more_info": "abc123",
"start_date": "xyz789",
"start_time": "abc123",
"end_date": "abc123",
"end_time": "xyz789",
"advanced_sales_end_time": "abc123",
"online_sales_end": "abc123",
"external_url": "xyz789",
"categories": [Category],
"images": [EventImage],
"tickets": [EventTicketInfo],
"tickets_sold": [TicketSold],
"tickets_available": 987,
"tickets_contingent": 123
}
}
}
events
Response
Returns an EventPagination
Example
Query
query events(
$first: Int,
$offset: Int
) {
events(
first: $first,
offset: $offset
) {
totalCount
edges {
...EventFragment
}
pageInfo {
...pageInfoFragment
}
}
}
Variables
{"first": 987, "offset": 987}
Response
{
"data": {
"events": {
"totalCount": 987,
"edges": [Event],
"pageInfo": pageInfo
}
}
}
locations
Response
Returns [EventLocation]
Example
Query
query locations(
$client_id: Int,
$client_ids: [Int!],
$state: String
) {
locations(
client_id: $client_id,
client_ids: $client_ids,
state: $state
) {
location_id
name
client_id
}
}
Variables
{
"client_id": 123,
"client_ids": [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
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": 987}
Response
{
"data": {
"order": {
"order_id": 123,
"state": "xyz789",
"firstname": "xyz789",
"lastname": "abc123",
"country": "xyz789",
"postal_code": "abc123",
"city": "xyz789",
"street": "xyz789",
"email": "abc123",
"phone": "abc123",
"timestamp": "xyz789",
"access_token": "xyz789",
"tickets": [OrderTicket]
}
}
}
ticket
Description
returns details of an event ticket.
Response
Returns an EventTicket
Example
Query
query ticket(
$ticket_id: Int,
$uuid: String
) {
ticket(
ticket_id: $ticket_id,
uuid: $uuid
) {
ticket_id
event_id
uuid
state
category_id
price
reason
sales_reference
sales_channel
valid
invalid
event {
...EventFragment
}
category
timestamp
}
}
Variables
{"ticket_id": 123, "uuid": "abc123"}
Response
{
"data": {
"ticket": {
"ticket_id": 987,
"event_id": 123,
"uuid": "abc123",
"state": "abc123",
"category_id": 987,
"price": 123.45,
"reason": "abc123",
"sales_reference": 987,
"sales_channel": "abc123",
"valid": true,
"invalid": false,
"event": Event,
"category": "abc123",
"timestamp": "xyz789"
}
}
}
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
Description
Save a new order from the webshop.
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": 123}}
order_cancel
Description
Cancel the order (partial or full) and refund the payment via adyen.
Response
Returns a Boolean!
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": true,
"refund_reason": "abc123"
}
Response
{"data": {"order_cancel": false}}
order_payment
Description
Update the order payment status.
Response
Returns a Boolean!
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": 123,
"psp_reference": "xyz789",
"payment_method": "abc123"
}
Response
{"data": {"order_payment": true}}
ticket_storno
Description
Cancel the ticket and return the ticket to the pool.
Response
Returns a Boolean
Example
Query
mutation ticket_storno(
$ticket_uuid: String!,
$reason: String
) {
ticket_storno(
ticket_uuid: $ticket_uuid,
reason: $reason
)
}
Variables
{
"ticket_uuid": "xyz789",
"reason": "abc123"
}
Response
{"data": {"ticket_storno": false}}
ticket_verify
Description
Verify the sold state of ticket and could be invalidated to prevent further usage.
Response
Returns an EventTicket
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_id
price
reason
sales_reference
sales_channel
valid
invalid
event {
...EventFragment
}
category
timestamp
}
}
Variables
{
"ticket_uuid": "abc123",
"invalidation": false
}
Response
{
"data": {
"ticket_verify": {
"ticket_id": 987,
"event_id": 123,
"uuid": "xyz789",
"state": "abc123",
"category_id": 123,
"price": 987.65,
"reason": "xyz789",
"sales_reference": 123,
"sales_channel": "abc123",
"valid": true,
"invalid": true,
"event": Event,
"category": "abc123",
"timestamp": "xyz789"
}
}
}
tickets_block
Description
The tickets will be blocked for 15min.
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": 123, "tickets": [TicketInput]}
Response
{
"data": {
"tickets_block": {
"expire": "abc123",
"ticket_ids": [123]
}
}
}
tickets_block_free
Description
The block from the ticket will be removed.
tickets_sold
Description
Mark the tickets as sold, the state can be pre-payed or payed.
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 |
sales_reference - Int
|
optional, reference number for sells without a webshop order |
sales_channel - SalesChannel!
|
the sales channel of the ticket sale |
Example
Query
mutation tickets_sold(
$ticket_ids: [Int!],
$status: String!,
$order_id: Int,
$sales_reference: Int,
$sales_channel: SalesChannel!
) {
tickets_sold(
ticket_ids: $ticket_ids,
status: $status,
order_id: $order_id,
sales_reference: $sales_reference,
sales_channel: $sales_channel
) {
ticket_id
ticket_uuid
timestamp
state
reason
}
}
Variables
{
"ticket_ids": [123],
"status": "xyz789",
"order_id": 987,
"sales_reference": 987,
"sales_channel": "WEBSHOP"
}
Response
{
"data": {
"tickets_sold": [
{
"ticket_id": 123,
"ticket_uuid": "xyz789",
"timestamp": 987,
"state": "abc123",
"reason": "abc123"
}
]
}
}
Types
Boolean
Description
The Boolean scalar type represents true or false.
Category
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 |
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
|
|
online_sales_end - String
|
|
external_url - String
|
|
categories - [Category]
|
|
Arguments
|
|
images - [EventImage]
|
|
tickets - [EventTicketInfo]
|
|
tickets_sold - [TicketSold]
|
|
tickets_available - Int
|
|
tickets_contingent - Int
|
|
Example
{
"event_id": 987,
"title": "abc123",
"client_id": 123,
"location_id": 987,
"location": EventLocation,
"subtitle": "xyz789",
"description": "xyz789",
"entry_info": "abc123",
"more_info": "abc123",
"start_date": "xyz789",
"start_time": "xyz789",
"end_date": "abc123",
"end_time": "abc123",
"advanced_sales_end_time": "abc123",
"online_sales_end": "xyz789",
"external_url": "xyz789",
"categories": [Category],
"images": [EventImage],
"tickets": [EventTicketInfo],
"tickets_sold": [TicketSold],
"tickets_available": 987,
"tickets_contingent": 123
}
EventImage
EventLocation
EventPagination
EventTicket
Fields
| Field Name | Description |
|---|---|
ticket_id - Int
|
|
event_id - Int
|
|
uuid - String
|
|
state - String
|
free, blocked, pre-pay, payed, storno |
category_id - Int
|
|
price - Float
|
|
reason - String
|
|
sales_reference - Int
|
|
sales_channel - String
|
|
valid - Boolean
|
|
invalid - Boolean
|
|
event - Event
|
|
category - String
|
|
timestamp - String
|
|
Example
{
"ticket_id": 123,
"event_id": 987,
"uuid": "xyz789",
"state": "xyz789",
"category_id": 123,
"price": 987.65,
"reason": "xyz789",
"sales_reference": 987,
"sales_channel": "xyz789",
"valid": false,
"invalid": true,
"event": Event,
"category": "abc123",
"timestamp": "abc123"
}
EventTicketInfo
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
123
Order
Description
Order Type
Example
{
"order_id": 987,
"state": "abc123",
"firstname": "xyz789",
"lastname": "xyz789",
"country": "xyz789",
"postal_code": "abc123",
"city": "abc123",
"street": "xyz789",
"email": "xyz789",
"phone": "xyz789",
"timestamp": "abc123",
"access_token": "abc123",
"tickets": [OrderTicket]
}
OrderInput
Example
{
"adyen_reference": "xyz789",
"firstname": "abc123",
"lastname": "abc123",
"country": "abc123",
"postal_code": "abc123",
"city": "abc123",
"street": "xyz789",
"street_additional": "abc123",
"email": "xyz789",
"phone": "abc123"
}
OrderTicket
Description
Order Ticket Type
Example
{
"order_ticket_id": 987,
"order_id": 123,
"ticket_id": 987,
"ticket": EventTicket,
"meta_price": 987.65,
"meta_category_id": 123.45
}
OrderTicketInput
SalesChannel
Values
| Enum Value | Description |
|---|---|
|
|
online sold tickets |
|
|
cash register |
Example
"WEBSHOP"
Sort
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"