The POST /stream
endpoint allows you to register actions on your events/tickets alongside all of their relevant metadata within OPEN Ticketing and propagate this data to the blockchain.
The accepted actions are:
newEvent
updateEvent
soldTicket
updateTicket
resoldTicket
scannedTicket
checkedInTicket
claimedTicket
invalidatedTicket
An event must first be registered before any ticket action be accepted within that event.
Per action, the following fields are accepted:
- Required Fields: all specified must be sent
- Exclusive Fields: 1 required but no more than 1 accepted
- Optional Fields: all can be omitted, defaults will be used (see
Data Field Types
table for defaults)
action | required fields | exclusive fields | optional fields |
---|---|---|---|
newEvent | eventId currency | - | eventName shopUrl coverImageUrl coverMediaUrl defaultNftImageUrl defaultNftMediaUrl latitude longitude startTime endTime callbackUrl |
updateEvent | eventId | - | eventName currency shopUrl coverImageUrl coverMediaUrl defaultNftImageUrl defaultNftMediaUrl latitude longitude startTime endTime callbackUrl |
soldTicket | eventId ticketId userId price | - | imageUrl mediaUrl orderTime to metadataAttributes name description |
updateTicket | - | ticketId nftId | imageUrl mediaUrl metadataAttributes |
resoldTicket | userId price | ticketId nftId | orderTime to |
scannedTicket | - | ticketId nftId | orderTime |
checkedInTicket | - | ticketId nftId | orderTime |
claimedTicket | to or userId (both also accepted) | ticketId nftId | orderTime |
invalidatedTicket | - | ticketId nftId | orderTime |
Note: On resoldTicket
actions, the userId
should represent the user that has just bought the ticket. It must be a different user identifier from the user that held the ticket previous to the resale (sent in the previous soldTicket
or resoldTicket
action for that ticket)
Data Field Types
data field | type | validation | default value | on blockchain? |
---|---|---|---|---|
eventId | string | up to 255 chars | - | no |
eventName | string | up to 255 chars | blank string | yes |
currency | string | ISO 4217, exactly 3 chars - see supported currencies | - | yes |
shopUrl | string | http/https url, up to 255 chars | blank string | yes |
coverImageUrl | string | http/https url, up to 255 chars | blank string | yes |
coverMediaUrl | string | http/https url, up to 255 chars | blank string | no |
defaultNftImageUrl | string | http/https url, up to 255 chars | blank string | no |
defaultNftMediaUrl | string | http/https url, up to 255 chars | blank string | no |
latitude | float | latitude | 0.0 | yes |
longitude | float | longitude | 0.0 | yes |
startTime | integer | unsigned integer 64 | 0 | yes |
endTime | integer | unsigned integer 64 | 0 | yes |
callbackUrl | string | http/https url, up to 255 chars | - | no |
ticketId | string | up to 255 chars | - | yes, sha256(ticketId ) |
userId | string | up to 255 chars | - | no |
nftId | string | valid GETProtocol NFT Id (e.g. POLYGON-123-123) | - | no |
imageUrl | string | http/https url, up to 255 chars | blank string | no |
mediaUrl | string | http/https url, up to 255 chars | blank string | no |
price | string | valid price string represented | - | yes |
orderTime | integer | unsigned integer 64 | now unix timestamp | yes |
to | string | blockchain wallet address | - | yes |
metadataAttributes | json | Opensea metadata attributes standard | - | yes |
metadataTemplateId | string | uuid | - | no |
name | string | up to 128 chars | {eventname}-{tokenid} | yes |
description | string | up to 10240 chars | Event Collectible #{tokenId} Issued for {eventname}{shopUrl}) by {intergratorName}. Powered by OPEN TIcketing. | yes |
Null vs Empty
On event and tickets updates with
eventUpdate
orticketUpdate
actions respectively, you can send the default value from the table above on non required fields to have them cleared.You can also send the
json null
value i.e."imageUrl": null
or completely omit fields that are not intended to be updated.
Data Field Details
data field | detail |
---|---|
eventId | Event ID reference, created by the api caller, to indicate how this event is referenced in all stream requests where it is required. For example, if you send a newEvent request with the field eventId="test-event" , then a soldTicket request with the field eventId="test-event will mint tickets on that newly created event. This field must be unique per api caller. |
eventName | The name of the event, created by the api caller. This name will be publicly available. |
currency | The main currency used to sell the tickets for this event. All price fields sent will be assumed to be in this currency. |
shopUrl | The url for the main shop/page where tickets where sold from. |
coverImageUrl | The main cover image url for the event. E.g. a .jpg url |
coverMediaUrl | The main cover media url for the event. E.g. a youtube.com or .mp4 url |
defaultNftImageUrl | The image url to use on all tickets minted for the event, if the ticket itself doesn't specify one. |
defaultNftMediaUrl | The media url to use on all tickets minted for the event, if the ticket itself doesn't specify one. |
latitude | The latitude where the event will take place. |
longitude | The longitude where the event will take place. |
startTime | The unix timestamp of when the event will start. |
endTime | The unix timestamp of when the event will end. |
callbackUrl | The url where GETProtocol should send callbacks to. This url must be publicly reachable without authentication and should return a 200 OK on successful processing of a callback. See Callbacks for more detail on the sent callbacks and their data. |
ticketId | Ticket ID reference, created by the api caller, to indicate how this ticket is referenced in all stream requests where it is required. For example, if you send a soldTicket request with the field ticketId="test-ticket" , then an invalidateTicket request with the field ticketId="test-ticket" will invalidate the newly created ticket. This field must be unique per api caller. |
userId | User Id reference, created by the api caller, to indicate to which user the ticket refers to. |
nftId | GETProtocol generated NFT Id. This field can be used, as an alternative to ticketId , to identify the ticket the request refers to in the case that the api caller doesn't have the ticketId available. This field is generated by GETProtocol and is publicly available on the blockchain. |
imageUrl | The main image url for the ticket. E.g. a .jpg url. |
mediaUrl | The main media url for the ticket. E.g. a youtube.com or .mp4 url. |
price | The price the ticket was sold for. |
orderTime | The unix timestamp of when the ticket was sold. |
to | The user owned custom wallet address. This field should only be used whenever the api caller knows the wallet address of the user the ticket was sold or resold to. In case the api caller wants to let the tickets be minted to a new user wallet, this field should not be sent. |
metadataAttributes | Additional metadata attributes of the ticket. For more details on how these metadata attributes should be constructed for proper display in OpenSea, please check this page. |
metadataTemplateId | The id for a metadate template created within the NFT studio. Attributes specified within metadataAttributes will override attributes generated from a specified template |
name | The name of the ticket, created by the api caller. This name will be publicly available. |
description | The description of the event, created by the api caller. This name will be publicly available |
Next you can find an example payload for an event with a single ticket that went through all the possible states until being claimed by/to a ticket buyer account:
[
{
"action": "newEvent",
"data": {
"eventId": "1b15b541-7d60-4ae8-b41f-aca6b981a6e7",
"eventName": "porro ut autem",
"currency": "EUR",
"shopUrl": "http://roberto.net",
"coverImageUrl": "https://placeimg.com/640/480/nature",
"coverMediaUrl": "",
"defaultNftImageUrl": "https://assets.onopen.xyz/open-default-collectible-image.png",
"defaultNftMediaUrl": "https://www.youtube.com/watch?v=cjXSeElvbss",
"startTime": 1652285087,
"endTime": 1652285087,
"latitude": -24.2066,
"longitude": -159.3224,
"callbackUrl": "http://callback.url/callback"
}
},
{
"action": "soldTicket",
"data": {
"eventId": "1b15b541-7d60-4ae8-b41f-aca6b981a6e7",
"ticketId": "10cd5d96-ecc1-43ae-b1bc-b248da171c92",
"userId": "48d68f38-1376-4eb4-96a3-6bd65efce492",
"name": "ticket abc",
"description": "the description for ticket abc",
"price": "136.91",
"imageUrl": "http://placeimg.com/640/480",
"mediaUrl": "https://www.youtube.com/watch?v=cjXSeElvbss",
"metadataAttributes": "[{\"trait_type\":\"Ticket Type\", \"value\":\"Early bird\"},{\"display_type\":\"boost_number\", \"trait_type\":\"Ticket power\", \"value\":\"3\"}]"
}
},
{
"action": "soldTicket",
"data": {
"eventId": "1b15b541-7d60-4ae8-b41f-aca6b981a6e7",
"ticketId": "719cf724-75c0-4fb4-ba4e-2f6cd67a328e",
"price": "15.00"
}
},
{
"action": "soldTicket",
"data": {
"eventId": "1b15b541-7d60-4ae8-b41f-aca6b981a6e7",
"ticketId": "4c5bb3f1-d281-4774-a08a-b34813126f03",
"price": "10.00"
}
},
{
"action": "updateTicket",
"data": {
"ticketId": "10cd5d96-ecc1-43ae-b1bc-b248da171c92",
"name": "ticket abc",
"description": "the description for ticket abc",
"imageUrl": "http://updated.image.com/",
"mediaUrl": "http://updated.video.com/",
"metadataAttributes": "[{\"trait_type\":\"Ticket Type\", \"value\":\"Early bird\"},{\"display_type\":\"boost_number\", \"trait_type\":\"Ticket power\", \"value\":\"4\"}]"
}
},
{
"action": "resoldTicket",
"data": {
"nftId": "POLYGON-123-123",
"userId": "54c28708-9406-4bc6-b609-bee17e051173",
"price": "466.25"
}
},
{
"action": "scannedTicket",
"data": {
"ticketId": "1b15b541-7d60-4ae8-b41f-aca6b981a6e7",
}
},
{
"action": "updateEvent",
"data": {
"eventId": "1b15b541-7d60-4ae8-b41f-aca6b981a6e7",
"imageUrl": "https://placeimg.com/640/480/tech",
"defaultNftImageUrl": "https://assets.onopen.xyz/open-default-collectible-image.png"
}
},
{
"action": "checkedInTicket",
"data": {
"nftId": "POLYGON-123-123",
}
},
{
"action": "claimedTicket",
"data": {
"ticketId": "1b15b541-7d60-4ae8-b41f-aca6b981a6e7",
"to": "0x72e5c6e078001644b15c3b8d56a019c8f551adc4"
}
},
{
"action": "claimedTicket",
"data": {
"ticketId": "719cf724-75c0-4fb4-ba4e-2f6cd67a328e",
"userId": "138b694b-7d77-4117-a337-4c11f0723573"
}
},
{
"action": "claimedTicket",
"data": {
"ticketId": "1b15b541-7d60-4ae8-b41f-aca6b981a6e7",
"userId": "25685833-604d-4b98-9f25-067aed6912fe",
"to": "0x3d712EE26e407DC383a451466B7a93a42094dBA1"
}
}
]
Limits & Ordering
Each request can include up to 5000 actions. Actions are processed and their result returned in the order they are sent in the request.
A request with the previous payload should yield a response similar to:
{
"status": "success",
"data": [
{
"status": "success",
"action": "newEvent",
"eventId": "1b15b541-7d60-4ae8-b41f-aca6b981a6e7",
"actionPromise": "a58b6a0c-2e59-4bb0-8b19-9a3f77c934b3"
},
{
"status": "success",
"action": "soldTicket",
"eventId": "1b15b541-7d60-4ae8-b41f-aca6b981a6e7",
"ticketId": "10cd5d96-ecc1-43ae-b1bc-b248da171c92",
"actionPromise": "22709bf7-59a8-4751-82f1-06184b9dcf22"
},
{
"status": "success",
"action": "updateTicket",
"ticketId": "10cd5d96-ecc1-43ae-b1bc-b248da171c92",
"actionPromise": "3280fc95-d8fa-4b77-a375-9216f27f1df3"
},
{
"status": "success",
"action": "resoldTicket",
"nftId": "POLYGON-123-123",
"actionPromise": "d31dc1c8-641c-4c3b-a2d1-78963f9c8590"
},
{
"status": "success",
"action": "scannedTicket",
"ticketId": "1b15b541-7d60-4ae8-b41f-aca6b981a6e7",
"actionPromise": "c9d73b07-8a85-4198-af4d-f6e3fd7a4b8f"
},
{
"status": "success",
"action": "updateEvent",
"eventId": "1b15b541-7d60-4ae8-b41f-aca6b981a6e7",
"actionPromise": "a487b584-03a9-45fc-995e-badb42250c25"
},
{
"status": "success",
"action": "checkedInTicket",
"nftId": "POLYGON-123-123",
"actionPromise": "c545e395-e13e-4969-9b50-52c14ed782f6"
},
{
"status": "success",
"action": "claimedTicket",
"ticketId": "1b15b541-7d60-4ae8-b41f-aca6b981a6e7",
"actionPromise": "c2e8df23-6411-46e0-8ec2-61cb0a29f6af"
}
]
}
Save the promise
Each successful action request will return you an
actionPromise
. Save it on your data model such that you can use it later to query for each action request status.