TABLE OF CONTENTS
Summary
This architecture leverages the optionality of barcodes that don't always get used, to reduce stress on our system, and doesn't create an order or ticket until the barcode is scanned.
Assigning a collaborator to a venue will include creating an org and tenant user in the venue with the tenant user being assigned an api key. The name of the org and tenant user will match the name of the collaborator.
Each API call will be for a specific tenant and include the api key assigned to that user.
List barcodes
Get v2/b2b/barcodes
Parameters
- createdAfter ISO8601 date that you want barcodes created after
- createdBefore ISO8601 date that you want barcodes created before
- updatedAfter ISO8601 date that you want barcodes updated after
- updatedBefore ISO8601 date that you want barcodes updated before
- usedAfter ISO8601 date that you want barcodes scanned after - USEAGE NOT YET WORKING
- usedBefore ISO8601 date that you want barcodes scanned before - USEAGE NOT YET WORKING
- eventTemplateId The id of the event template you want barcodes of
- eventId The id of the event you want barcodes of
- ticketTypeId The ticket type id you want barcodes of
- status The status that you want barcodes of (converted, new, voided, error) - USEAGE NOT YET WORKING
- customerEmail The email of the customer you want the barcodes for
- customerId The id of the customer you want the barcodes for
- externalOrderNumber The external order number, if provided.
- pageSize The number of barcodes you want returned, default 100
- page The page you want the barcodes for
- sortDirection Either 'asc' or 'desc'
- sortField What to sort the barcodes on (createdOn, updatedOn, usedOn, barcode, externalOrderNumber, eventTemplateId).
Returns
A paginated list of Barcode JSON objects
Examples
GET /v2/b2b/barcodes?createdAfter=2019-04-18T00:00:00Z&createdBefore=2019-04-19T00:00:00Z -H "x-acme-api-key:[key]"
returns a page of up to 100 barcodes for April 18th, 2019 for the specified tenant.
GET /v2/b2b/barcodes?externalOrderNumber=123 -H "x-acme-api-key:[key]"
returns a page of 1 barcodes with the external order number 123
Get a barcode
Get v2/b2b/barcodes/{barcode}
Returns
A Barcode JSON object
Examples
GET /v2/b2b/barcodes/123 -H "x-acme-api-key:[key]"
returns a single barcode JSON object with the corresponding barcode. Will return 404 if the barcode does not exist.
Add barcodes
POST v2/b2b/barcodes
Body
A list of Barcode JSON objects being added into the ACME system.
Field | Notes |
---|---|
collaboratorId | Required - Assigned by ACME |
eventTemplateId | Required if eventId is not provided |
eventId | Required if eventTemplateId is not provided |
ticketTypeId | Required |
barcode | Required |
externalOrderNumber | Required |
customerId | Optional |
customerFirstName | Optional |
customerLastName | Optional |
customerEmail | Optional |
Returns
The resulting list of Barcode JSON objects with the id and created time filled in.
POST Examples
Add three barcodes
[ { "collaboratorId" : 9 , "eventTemplateId" : "1234-1234-12345" , "eventId" : "678-678-6789" , "ticketTypeId" : "567-567-5678" , "email" : "mickey@acmeticketing.com" , "firstName" : "Micky" , "lastName" : "Bell" , "barcode" : "567-1230-0001" , "externalOrderNumber" : "10001" }, { "collaboratorId" : 9 , "eventTemplateId" : "1234-1234-12345" , "eventId" : "678-678-6789" , "ticketTypeId" : "567-567-5678" , "barcode" : "567-1230-0002" , "externalOrderNumber" : "10002" }, { "collaboratorId" : 9 , "eventTemplateId" : "1234-1234-12345" , "eventId" : "678-678-6789" , "ticketTypeId" : "567-567-5678" , "barcode" : "567-1230-0003" , "externalOrderNumber" : "10003" } ] |
Update barcodes
PUT v2/b2b/barcodes
Body
This API takes a single barcode object: it is recommended that you modify an object returned from a POST or GET. Ensure that the "id" comes from an existing barcode object.
Returns
When successful, the API will return a 200 and the barcode object as updated.
Example
PUT /v2/b2b/barcodes -H "x-acme-api-key:[key]"
{
"id": :1234-1234-12345",
"collaboratorId": 9,
"eventTemplateId": "1234-1234-12345",
"eventId": "678-678-6789",
"ticketTypeId": "567-567-5678",
"email": "mickey@acmeticketing.com",
"firstName": "Modified",
"lastName": "Name",
"barcode": "567-1230-0002",
"externalOrderNumber": "10002"
}
Deactivate barcodes
Put v2/b2b/barcodes/deactivations
Body
A list of barcodes to be removed
Field | Description | Notes |
---|---|---|
barcode | The barcode to be deactivated | required |
code | Any numeric value between 0 and 3000. | optional |
message | A message about why the barcode is being deactivated which may be presented to the customer when they try to use the barcode. If not provided then a general message will be presented. | optional varchar(2048) |
Returns
The Barcode JSON objects that were deleted
Example
Delete three barcodes
[ { "barcode" : "567-1230-0001" , "code" : 1 , "message" : "Order was cancelled. Call 555-555-5555." }, { "barcode" : "567-1230-0002" , "code" : 2 , "message" : "Barcode was used on 1-12-2019." }, { "barcode" : "567-1230-0003" , "code" : 999 , "message" : "Something went wrong with this barcode. Call 555-555-5555 for more information." } ] |
JSON Objects
Barcode Object
Field | Description |
---|---|
id | Unique id for this barcode |
tenantId | Id of the tenant this barcode is good for |
collaboratorId | Id of the collaborator |
eventTemplateId | id of the event template |
eventId | id of the event |
ticketTypeId | id of the ticket type |
customerId | id of the customer this barcode is for |
customerFirstName | first name of the customer |
customerLastName | last name of the customer |
customerEmail | email of the customer |
barcode | The text of the barcode |
externalOrderNumber | External order id of the barcode for the collaborator's records |
status | Status of the barcode (converted, voided, new, error...) |
active | True if the barcode is active, false otherwise. Might be changed to deleted |
orgId | The id of the org for this collaborator |
orderNumber | The order number |
createdOn | The date that the barcode was created |
createdBy | The id of the tenant user that created the barcode |
updatedOn | The date that the barcode was last updated |
updatedBy | The tenant id of the user that last updated the barcode |
usedOn | The time and date that the barcode was used |
Barcode List
Field | Description |
---|---|
Array of event and customer information, used to create the barcodes | |
[x].id | Id of the tenant |
[x].eventTemplateId | Event template that all of the barcodes will be assigned to |
[x].eventId | Event id that all of the barcodes will be assigned to |
[x].ticketTypeId | The ticket type associated with this barcode (Child, Adult...) |
[x].email | Email address associated with this barcode |
[x].firstName | The first name of the person this barcode is for |
[x].lastName | The last name of the person this barcode is for |
[x].barcode | The barcode |
[x].orderNumber | The external order number associated with this barcode |
[x].createdOn | The time that the barcode was created |
[x].usedOn | The time that the barcode was used |