Skip to content

Inventory API

jeffsb edited this page Feb 20, 2013 · 21 revisions

##Overview

The Inventory API allows partners to manage inventory on ScoreBig.com in real-time.

Please note that any inventory that is added via the API will get overwritten if a CSV import is performed.

To request access to the Inventory API, please contact ScoreBig.

##Objects

###Object: TicketBlock

Field Type Description
ticket_id string Your unique ID for this ticket
event_id string ScoreBig event ID
section string
row string
quantity string
start_seat string
end_seat string
odd_even bool Indicates odd/even seating (e.g. "1,3,5" or "2,4,6")
electronic bool Indicates whether or not eTickets are available for this TicketBlock
ga bool Indicates whether or not the tickets are general admission
splits string Indicates valid splits for this TicketBlock (up to 8)
face_value decimal Face value of the ticket
price decimal Your price for the ticket
notes string
in_hand_date date Indicates when tickets will be available for delivery
expiration_datetime datetime Indicates when tickets will be taken off ScoreBig

###Object: TicketResult

Field Type Description
ticket_id string Your unique ID for this ticket
success bool Indicates whether or not operation succeeded
message string Message associated with ticket

##Methods

###Method: GetTicketBlock

Method Name GetTicketBlock
Description Returns TicketBlock identified by ticket_id
HTTP Method GET
URI /tickets/:ticket_id
/tickets?ticket_id=:ticket_id
Returns TicketBlock

######Parameters

Name Type Default Required Description
ticket_id string Y Your unique ID for this ticket.

######Sample Request

GET http://developer.api.scorebig.com/1/tickets/12345?api_key=abcde

GET http://developer.api.scorebig.com/1/tickets?api_key=abcde&ticket_id=12345

######Sample Response

{
    "type": "TicketBlock",
    "count": 1,
    "results": [
        {
            "ticket_id": "777",
            "event_id": "00000000-0000-0000-0000-000000000001",
            "section": "MEZ",
            "row": "A",
            "quantity": 4,
            "start_seat": "20",
            "end_seat": "23",
            "odd_even": false,
            "ga": false,
            "electronic": false,
            "splits": "1,2,3,4",
            "price": 21,
            "notes": null,
            "in_hand_date": null,
            "expiration_datetime": "1/1/2020 12:00:00 AM"
        }
    ]
}

###Method: GetTicketBlocksForEvent

Method Name GetTicketBlocksForEvent
Description Gets your inventory for specific Event
HTTP Method GET
URI /tickets/?event_id=:event_id
Returns List of TicketBlock

######Parameters

Name Type Default Required Description
event_id guid Y ScoreBig event ID.

######Sample Request

GET http://developer.api.scorebig.com/1/tickets?api_key=abcde&event_id=2234533

######Sample Response

{
    "type": "TicketBlock",
    "count": 3,
    "results": [
        {
            "ticket_id": "777",
            "event_id": "00000000-0000-0000-0000-000000000001",
            "section": "MEZ",
            "row": "A",
            "quantity": 4,
            "start_seat": "20",
            "end_seat": "23",
            "odd_even": false,
            "ga": false,
            "electronic": false,
            "splits": "1,2,3,4",
            "price": 21,
            "notes": null,
            "in_hand_date": null,
            "expiration_datetime": "1/1/2020 12:00:00 AM"
        },
        {
            "ticket_id": "888",
            "event_id": "00000000-0000-0000-0000-000000000001",
            "section": "MEZ",
            "row": "B",
            "quantity": 6,
            "start_seat": "20",
            "end_seat": "25",
            "odd_even": false,
            "ga": false,
            "electronic": false,
            "splits": "1,2,3,4,5,6",
            "price": 21,
            "notes": null,
            "in_hand_date": null,
            "expiration_datetime": "1/1/2020 12:00:00 AM"
        },
        {
            "ticket_id": "999",
            "event_id": "00000000-0000-0000-0000-000000000001",
            "section": "MEZ",
            "row": "C",
            "quantity": 8,
            "start_seat": "20",
            "end_seat": "27",
            "odd_even": false,
            "ga": false,
            "electronic": false,
            "splits": "1,2,3,4,5,6,7,8",
            "price": 21,
            "notes": null,
            "in_hand_date": null,
            "expiration_datetime": "1/1/2020 12:00:00 AM"
        }
    ]
}

##Methods for Managing Inventory

The following methods allow you to insert or update inventory on ScoreBig.com.

######Event Matching

One of the requirements is that the ticket is matched to an existing event in our system. If an event_id is provided, the system will verify that the event_id exists in our system. If there is no event_id, it will attempt to identify the event based on the event_date_time and the venue. If not suitable match is found based on the information given, then an error will be returned in the response.

This is not a differencing system, so new blocks will be added and existing blocks will be updated. If you delete a block on your side, please make sure to call the Delete Inventory method to remove it from our system so we don't sell it. Merely excluding it from a future import will not remove it from our system.

###Method: InsertOrUpdateTicketBlock

If a ticket, identified by ticket_id, already exists, then this method will update that existing ticket, using just the fields that were passed in the request. If a ticket does not currently exist, then this method will validate that you have supplied all the required fields before inserting it into our system

Method Name InsertOrUpdateTicketBlock
Description Inserts new TicketBlock or updates if it already exists.
HTTP Method PUT
URI /tickets/:ticket_id
Returns TicketResult

######Parameters

Name Type Default Required Description
ticket_id string Y Your unique ID for this ticket.
event_id guid ScoreBig event ID.
event_date_time string Y Local event date time, in the format of MM-dd-yyyy hh:mm zz
venue string Y Venue name.
venue_address string Can improve event matching if provided.
venue_city string Can improve event matching if provided.
venue_state string Can improve event matching if provided.
section string Y
row string Y
quantity int Y
start_seat string Y
end_seat string Y
odd_even bool Specifies if seats are odd/even (e.g. 1,3,5 or 2,4,6). default is FALSE
splits string Comma-separated list of valid splits, i.e. 2,3,4,6,8. Max split is 8.
price decimal Y Your price for the ticket
electronic bool Whether or not e-tickets are available. default is FALSE
in_hand_date string The date the listing can be shipped
notes string Any notes or comments associated with this ticket

NOTE: for update requests, only ticket_id is required

####Example #1 - Insert TicketBlock

######Sample Request (json)

PUT http://developer.api.scorebig.com/1/tickets/222

Content-Type: application/json; charset=utf-8

{
    "ticket_id": "222",
    "event_id": "00000000-0000-0000-0000-000000000001",
    "section": "MEZ",
    "row": "B",
    "quantity": 4,
    "start_seat": "20",
    "end_seat": "23",
    "odd_even": false,
    "price": "21"
}

######Sample Request (alternate)

PUT http://developer.api.scorebig.com/1/tickets/222

Content-Type: application/x-www-form-urlencoded

event_id=00000000-0000-0000-0000-000000000001&section=MEZ&row=B&quantity=4&start_seat=20&end_seat=23&odd_even=false&price=21

######Sample Response

{
    "type" : "TicketResult",
    "count" : 1,
    "results" : [{
            "ticket_id" : "222",
            "success" : true,
            "message" : "New ticket added to queue."
        }
    ]
}

####Example #2 - Update TicketBlock

######Sample Request (json)

PUT http://developer.api.scorebig.com/1/tickets/222

Content-Type: application/json; charset=utf-8

{
    "ticket_id": "222",
    "quantity": 2,
    "start_seat": "20",
    "end_seat": "21",
    "price": "16"
}

######Sample Request (alternate)

PUT http://developer.api.scorebig.com/1/tickets/222

Content-Type: application/x-www-form-urlencoded

quantity=2&start_seat=20&end_seat=21&price=16

######Sample Response

{
    "type" : "TicketResult",
    "count" : 1,
    "results" : [{
            "ticket_id" : "222",
            "success" : true,
            "message" : "Ticket update added to queue."
        }
    ]
}

###Method: BulkInsertOrUpdateTicketBlocks

Method Name BulkInsertOrUpdateTicketBlocks
Description Bulk inserts or updates ticket blocks.
HTTP Method POST
URI /tickets
Returns List of TicketResult

######Parameters

Name Type Default Required Description
tickets array of tickets Y List of JSON objects representing each ticket request.

######Sample Request

POST http://developer.api.scorebig.com/1/tickets

Content-Type: application/json; charset=utf-8

{
    "tickets": [
        {
            "ticket_id": "777",
            "event_id": "00000000-0000-0000-0000-000000000001",
            "event_name": "Test - Developer Testing Event",
            "event_date_time": "1/2/2020 8:00:00 AM",
            "venue": "Staples Center",
            "section": "MEZ",
            "row": "A",
            "quantity": 6,
            "start_seat": "20",
            "end_seat": "25",
            "electronic": false,
            "odd_even": false,
            "price": "22"
        },
        {
            "ticket_id": "666",
            "event_id": "00000000-0000-0000-0000-000000000001",
            "event_name": "Test - Developer Testing Event",
            "event_date_time": "1/2/2020 8:00:00 AM",
            "venue": "Staples Center",
            "section": "MEZ",
            "row": "23",
            "quantity": 1,
            "start_seat": "20",
            "end_seat": "20",
            "electronic": false,
            "odd_even": false,
            "price": "22"
        },
        {
            "ticket_id": "555",
            "event_name": "Test - Developer Testing Event",
            "event_date_time": "1/2/2020 8:00:00 AM",
            "venue": "Staples Center",
            "section": "MEZ",
            "row": "23",
            "quantity": 1,
            "start_seat": "20",
            "end_seat": "20",
            "electronic": false,
            "odd_even": false,
            "price": "22"
        }
    ]
}

######Sample Response

{
    "type" : "TicketResult",
    "count" : 3,
    "results" : [{
            "ticket_id" : "777",
            "success" : true,
            "message" : "New ticket added to queue."
        }, {
            "ticket_id" : "666",
            "success" : true,
            "message" : "New ticket added to queue."
        }, {
            "ticket_id" : "555",
            "success" : false,
            "message" : "More than one event was detected.  Try using an explicit Event ID in your request."
        }
    ]
}

###Method: DeleteTicketBlock

Method Name DeleteTicketBlock
Description Deletes the TicketBlock identified by ticket_id
HTTP Method DELETE
URI /tickets/:ticket_id
Return Result

######Parameters

Name Type Default Required Description
ticket_id string Y ticket_id to be deleted.

######Sample Request

DELETE http://developer.api.scorebig.com/1/tickets/222

######Sample Response

{
    "type" : "Result",
    "count" : 1,
    "results" : ["Successfully deleted 1 of 1 ticket block(s)."]
}

###Method: BulkDeleteTicketBlocks

Method Name BulkDeleteTicketBlocks
Description Deletes TicketBlocks identified by the list of ticket_ids
HTTP Method POST
URI /tickets/delete
Returns Result

######Parameters

Name Type Default Required Description
ticket_id array of string Y list of ticket_ids to be deleted.

######Sample Request

POST http://developer.api.scorebig.com/1/tickets/delete

Content-Type: application/json; charset=utf-8

{
    "ticket_id": [
        "777",
        "888"
    ]
}

######Sample Response

{
    "type" : "Result",
    "count" : 1,
    "results" : ["Successfully deleted 2 of 2 ticket block(s)."]
}

Clone this wiki locally