Skip to content

Fulfillment API

jeffsb edited this page Jun 20, 2013 · 10 revisions

#Fulfillment API

The Fulfillment API will allow you to query for pending orders (as well as closed orders), and confirm the orders with the appropriate delivery information.

##Objects

###Object: Order

Field Type Description Value Constraints
confirmation_number string ScoreBig ID for this order.
order_date_utc datetime UTC date/time when order was created. mm/dd/yyyy hh:mm a
ticket_id string Your unique ID for this ticket.
event_id guid ScoreBig event ID.
event_name string Event name.
event_date_time datetime Event local date/time. mm/dd/yyyy hh:mm a
venue string Venue name.
section string
row string
seats string
quantity int
price decimal Price per ticket
status string The status of this order. open, closed, or cancelled
delivery_info object:deliveryinfo See Object: DeliveryInfo

###Object: DeliveryInfo

Field Type Description Value Constraints
confirmation_number string ScoreBig ID for this order.
delivery_method string How the tickets will be delivered to the customer. none, ship, email, willcall
delivery_date date Expected delivery date of the tickets.
airbill object:airbill See Object: Airbill
e_tickets array of object:eticket See Object: ETicket

###Object: Airbill

Field Type Description Value Constraints
tracking_number string Tracking number for ship orders.
tracking_url string URL for tracking the status of the shipment.
shipping_label_url string URL for the shipping label for ship orders

###Object: ETicket

Field Type Description Value Constraints
section string Section for this ETicket.
row string Row for this ETicket.
seat string Seat for this ETicket.
download_url string URL for downloading the processed PDF from ScoreBig.

##Methods

###Method: GetOrders

######Description

Returns all open orders (by default)

######URI

GET /orders

######Parameters

Name Type Default Required Description
api_key guid Y Your unique API key.
confirmation_number string N ScoreBig-issued confirmation number.
status string open N Filter by order status. Valid values are "open", "closed", "cancelled".
query string N Free-form search string. Searches event name.
from string N Filter by event dates starting from...
to string N Filter by event dates ending on...
page int 1 N current page of results
max_results int 50 N max results per page
sort_by string order_date N property to sort by. Value values are "event_name", "event_date", "status", "order_date"
sort_order string asc N sort direction ("asc" or "desc")

######Sample Request

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

######Sample Response

{
    "type": "OrderResult",
    "count": 2,
    "results": [
        {
            "confirmation_number": "577693309",
            "order_date_utc": "6/9/2013 4:21:56 PM",
            "ticket_id": null,
            "event_id": "00000000-0000-0000-0000-000000000002",
            "event_name": "San Jose Sharks at LA Kings",
            "event_date_time": "1/2/2020 8:00:00 AM",
            "venue": "Staples Center",
            "section": "2",
            "row": "10",
            "quantity": 4,
            "seats": "1-4",
            "price": 77,
            "status": "open"
        },
        {
            "confirmation_number": "967980844",
            "order_date_utc": "6/9/2013 4:21:56 PM",
            "ticket_id": null,
            "event_id": "00000000-0000-0000-0000-000000000005",
            "event_name": "Los Angeles Lakers vs. Los Angeles Clippers",
            "event_date_time": "1/2/2020 8:00:00 AM",
            "venue": "Staples Center",
            "section": "8",
            "row": "10",
            "quantity": 2,
            "seats": "1-2",
            "price": 97,
            "status": "open"
        }
    ]
}

###Method: GetOrder

######Description

Returns single order identified by confirmation_number

######URI

GET /orders/:confirmation_number

######Parameters

Name Type Default Required Description
api_key guid Y Your unique API key.
confirmation_number string Y ScoreBig-issued confirmation number.

######Sample Request

GET http://api.developer.scorebig.com/1/orders/577693309?api_key=12345

######Sample Response

{
    "type": "OrderResult",
    "count": 1,
    "results": [
        {
            "confirmation_number": "577693309",
            "order_date_utc": "6/9/2013 4:21:56 PM",
            "ticket_id": null,
            "event_id": "00000000-0000-0000-0000-000000000002",
            "event_name": "San Jose Sharks at LA Kings",
            "event_date_time": "1/2/2020 8:00:00 AM",
            "venue": "Staples Center",
            "section": "2",
            "row": "10",
            "quantity": 4,
            "seats": "1-4",
            "price": 77,
            "status": "open"
        }
    ]
}

###Method: ConfirmOrder

######Description

Confirms the order, and returns a Result with Message and OrderResult

######URI

POST /orders/:confirmation_number/confirm

######Parameters

Name Type Default Required Description
api_key guid Y Your unique API key.
confirmation_number string Y ScoreBig-issued confirmation number.
email string whatever is defined on your Account N If provided, an order notification will be sent.
seats string Y Comma-delimited list of seats.
ship_now bool Y Indicates if all tickets are ready to ship.
ship_date string N Required if ship_now is false. Indicates when tickets will be ready to ship.
files array of UploadETicketForOrderRequest N If ship_now is true, you can specify the eTickets in this field, otherwise an airbill will be generated
Name Type Default Required Description
seats string Y Comma-delimited list of seats represented in the PDF file.
file_content string Y Base64-encoded string representation of the PDF file.

######Sample Request (eTicket delivery method)

POST http://api.developer.scorebig.com/1/orders/967980844/confirm

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

{
    "api_key": "12345",
    "seats": "1,2,3",
    "ship_now": true,
    "files": [
        {
            "seats": "1",
            "file_content": <base64-encoded string>
        },
        {
            "seats": "2,3",
            "file_content": <base64-encoded string>
        }
    ]
}

######Sample Response (eTicket delivery method)

{
    "type" : "Result",
    "count" : 1,
    "results" : [{
            "message" : "Successfully confirmed order.",
            "data" : [{
                    "confirmation_number" : "967980844",
                    "order_date_utc": "6/9/2013 4:21:56 PM",
                    "ticket_id" : null,
                    "event_id" : "00000000-0000-0000-0000-000000000005",
                    "event_name" : "Lakers vs. Clippers",
                    "event_date_time" : "1/2/2020 8:00:00 AM",
                    "venue" : "Staples Center",
                    "section" : "8",
                    "row" : "10",
                    "quantity" : 3,
                    "seats" : "1,2,3",
                    "price" : 97.00,
                    "status" : "closed",
                    "delivery_info" : {
                        "confirmation_number" : "967980844",
                        "delivery_method" : "email",
                        "delivery_date" : null,
                        "airbill" : null,
                        "e_tickets" : [
                            {
                                "section": "8",
                                "row": "10",
                                "seat": "1",
                                "download_url": "<some download url>"
                            },
                            {
                                "section": "8",
                                "row": "10",
                                "seat": "2",
                                "download_url": "<some download url>"
                            },
                            {
                                "section": "8",
                                "row": "10",
                                "seat": "3",
                                "download_url": "<some download url>"
                            }
                        ]
                    }
                }
            ]
        }
    ]
}

######Sample Request (ship delivery method)

POST http://api.developer.scorebig.com/1/orders/967980844/confirm

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

{
    "api_key": "12345",
    "seats": "1,2",
    "ship_now": true,
    "files": null
}

######Sample Response (ship delivery method)

{
    "type" : "Result",
    "count" : 1,
    "results" : [{
            "message" : "Successfully confirmed order.",
            "data" : [{
                    "confirmation_number" : "967980844",
                    "order_date_utc": "6/9/2013 4:21:56 PM",
                    "ticket_id" : null,
                    "event_id" : "00000000-0000-0000-0000-000000000005",
                    "event_name" : "Lakers vs. Clippers",
                    "event_date_time" : "1/2/2020 8:00:00 AM",
                    "venue" : "Staples Center",
                    "section" : "8",
                    "row" : "10",
                    "quantity" : 2,
                    "seats" : "1,2",
                    "price" : 97.00,
                    "status" : "closed",
                    "delivery_info" : {
                        "confirmation_number" : "967980844",
                        "delivery_method" : "ship",
                        "delivery_date" : "3/15/2013",
                        "airbill" : {
                            "tracking_number" : "799296771899",
                            "tracking_url" : "<some fedex url>",
                            "shipping_label_url" : "<some fedex url>"
                        },
                        "e_tickets" : []
                    }
                }
            ]
        }
    ]
}

###Method: RejectOrder

######Description

Rejects the order, in case you can't fulfill it. Returns a Result with message.

######URI

POST /orders/:confirmation_number/reject

######Parameters

Name Type Default Required Description
api_key guid Y Your unique API key.
confirmation_number string Y ScoreBig-issued confirmation number.

######Sample Request

POST http://api.developer.scorebig.com/1/orders/961322005/reject

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

{
    "api_key": "12345"
}

######Sample Response

{
    "type" : "Result",
    "count" : 1,
    "results" : ["Successfully rejected order number 961322005."]
}

###Method: GetDeliveryInfo

######Description

Returns the delivery info for the given order

######URI

GET /orders/:confirmation_number/delivery

######Parameters

Name Type Default Required Description
api_key guid Y Your unique API key.
confirmation_number string Y ScoreBig ID for this order.

######Sample Request

GET http://api.developer.scorebig.com/1/orders/577693309/delivery?api_key=12345

######Sample Response

{
    "type": "DeliveryResult",
    "count": 1,
    "results": [
        {
            "confirmation_number": "577693309",
            "delivery_method": "ship",
            "delivery_date": "3/15/2013",
            "airbill": {
                "tracking_number": "799296771899",
                "tracking_url": "<some fedex url>",
                "shipping_label_url": "<some fedex url>"
            },
            "e_tickets": [ ]
        }
    ]
}

###Method: GetETickets

######Description

Returns an array of ETicket objects for the given order.

######URI

GET /orders/:confirmation_number/etickets

######Parameters

Name Type Default Required Description
api_key guid Y Your unique API key.
confirmation_number string Y ScoreBig ID for this order.

######Sample Request

GET http://api.developer.scorebig.com/1/orders/577693309/etickets?api_key=12345

######Sample Response

{   
    "type" : "ETicketResult",
    "count" : 2,
    "results" : [
        {
            "section" : "301",
            "row" : "16",
            "seats" : "5",
            "download_url" : "<some download url>"
        },
        {
            "section" : "301",
            "row" : "16",
            "seats" : "6",
            "download_url" : "<some download url>"
        }
    ]    
}

###Method: CreateAirbill (in development)

###Method: GetAirbill

######Description

Returns an AirbillResult object for the given order.

######URI

GET /orders/:confirmation_number/airbill

######Parameters

Name Type Default Required Description
api_key guid Y Your unique API key.
confirmation_number string Y ScoreBig ID for this order.

######Sample Request

GET http://api.developer.scorebig.com/1/orders/577693309/airbill?api_key=12345

######Sample Response

{   
    "type" : "AirbillResult",
    "count" : 1,
    "results" : [{
            "tracking_number" : "794866203161",
            "tracking_url" : "<some fedex url>",
            "shipping_label_url" : "<some fedex url>"
        }
    ]    
}

Clone this wiki locally