Upload a PDF to order
Upload a PDF to order
Description
Use this API to upload a PDF file or information about the PDF file for each ticket that a seller includes in a listing. This API provides two options:
-
Upload a PDF file to the ticket seat for an order.
NOTE: You can upload a single PDF file or multiple PDF files. For a single PDF file, the PDF size limit for uploading is 1 MB. For up to 10 PDF files, the total file size limit must not exceed 10 MB.
The API tries to upload as many PDFs that are associated with the ticket order. If a PDF fails to upload, the upload operation continues to fulfill the remainder of the ticket order but it reports an error in the response payload.
-
Upload the identifier for the PDF file to the ticket seat for an order.
This option only uploads the associated identifier for the PDF file.
API Host
https://api.stubhub.com
API Entry Points
/fulfillment/pdf/v1/order/
/fulfillment/pdf/v1/order/fileInfo
Transport
- HTTP Method: POST
- Scenario 1
For uploading single or multiple PDF files for a ticket order
- URL:
http://api.stubhub.com/fulfillment/pdf/v1/order/ - Query Parameters: see table below
- Scenario 2
For uploading only the identifier for the PDF file associated with the ticket order.
- URL:
http://api.stubhub.com/fulfillment/pdf/v1/order/fileInfo - Query Parameters: see table below
Request Headers
Scenario 1
This example shows the proper HTTP request header for uploading PDF files with the request.
POST http://api.stubhub.com/fulfillment/pdf/v1/order/
HTTP/1.1
Content-Type: multipart/form-data;boundary=--------------------------- SH612367567
User-Agent: Mozilla/5.0
Host: api.stubhub.com
Content-Length: **
Scenario 2
This example shows the proper HTTP request header for uploading only the file info id for the PDF files with the request.
POST http://api.stubhub.com/fulfillment/pdf/v1/order/fileInfo
HTTP/1.1
Content-Type: application/json
User-Agent: Mozilla/5.0
Host: api.stubhub.com
Content-Length: **
Request Payload
|
Parameter |
Description |
|---|---|
|
orderId |
orderId |
|
validationFlag |
(optional) Int 1 means Sync validation, 2 means No validation, default =1 |
|
ticketSeat |
This node represents the ticket seat, which is composed of all the elements that are needed for uploading a PDF file. |
|
row |
Ticket row if available. "GA" if it is General Admission ticket. (GA tickets do not have a specific row or seat associated with each ticket). |
|
seatType |
Ticket seat Type for example "Ticket" or "Parking Pass". This is optional for now, default to "Ticket" |
|
seat |
Ticket seat number if available |
|
name |
Attach file name. Use this parameter only if you upload a PDF file for an order. |
|
fileInfoId |
Already uploaded the file info id. Use this parameter only if you upload the fileInfoId for an order |
Scenario 1 Example
This example shows that for two ticket seats that are not General Admission tickets (in other words, the tickets have unique row/seat numbers), two PDF files are uploaded for this order.
Content-Type: multipart/form-data
Content-ID:root
{
"orderId": 12345,
"ticketSeat": [
{
"row": "A",
"seat": 12,
"seatType": "Ticket"
"name": "file1"
},
{
"row": "A",
"seat": 13,
"name": "file2"
}
]
}
-----------------------------SH612367567
Content-Disposition: attachment;name=file1 filename=File1.pdf
Content-Type: application/pdf
Content-ID:pdf1
(Binary data ....)
-----------------------------SH612367567
Content-Disposition: attachment;name=file2 filename=File2.pdf
Content-Type: application/pdf
Content-ID:pdf1
(Binary data ....)
Scenario 2 Example
This example shows that for two ticket seats that are not General Admission tickets, two file info IDs (one for each PDF file) are uploaded for this order.
Content-Type: application/json
Content-ID:root
{
"AddPDFToOrderRequest":
{
"orderId": 12345,
"ticketSeat": [
{
"row": "A",
"seat": 12,
"seatType": "Ticket"
"fileInfoId": "157829662"
},
{
"row": "A",
"seat": 13,
"fileInfoId": "157829664"
}
]
}
}
Response Payload
|
Element |
Description |
|---|---|
|
orderId |
Order ID |
|
pdfFulfillmentStatus |
FULFILLED |UNFULFILLED if all seats are fulfilled ,this value will be "FULFILLED",otherwise it is "UNFULFILLED" |
|
SeatStatus |
array of all seat status |
|
seatId |
ticket seat id |
|
row |
row number |
|
seat |
seat number |
|
fulfillmentStatus |
seat fulfill status,FULFILLED or UNFULFILLED |
|
reason |
Details of why the seat has not been fulfilled. The reasons why a ticket can not be fulfilled are listed in the reason code table below. |
Response Example
returnhttpcode=200
{"AddPDFToOrderResponse":{
"orderId": 123,
"pdfFulfillmentStatus": "UNFULFILLED",
"SeatStatus":[
{
seatId:123,
row:"A"
seatNumber:"abc"
fulfillmentStatus:"FULFILLED"
},
{
seatId:321,
row:"A"
seatNumber:"abcd"
fulfillmentStatus:"UNFULFILLED"
reason:"fulfillment.pdf.file.virusDetected"
}
]
}}
Error Example
HTTP/1.1 400
Date: Thu, 24 May 2012 07:26:10 GMT
Server: Apache
X-Powered-By: Servlet 2.4; JBoss-4.2.2.GA (build: SVNTag=JBoss_4_2_2_GA date=200710221139)/Tomcat-5.5
com-stubhub-dye-path: ff82#b94
com-stubhub-dye: ff82#b94
Content-Length: 157
Content-Type: application/xml
<AddPDFToOrderResponse>
<code>fulfillment.pdf.file.invalidOrder</code>
<description>order ID is invalid</message>
<requestId>some-guid-for-troubleshooting</requestId>
<data>
<entry>
<key>orderId</key>
<value>12345</value>
</entry>
</data>
</AddPDFToOrderResponse>
Error Codes
|
HTTPCODE |
NAME |
ERROR_CODE |
ERROR_Detail |
|---|---|---|---|
|
404 |
NOT FOUND |
fulfillment.pdf.file.invalidOrder |
Order ID is invalid. |
|
401 |
UNAUTHORIZED |
fulfillment.pdf.file.wrongSeller |
Order does not belong to this seller. |
|
400 |
BAD_REQUEST |
fulfillment.pdf.file.notPDF |
File is not a PDF ticket. |
|
400 |
BAD_REQUEST |
fulfillment.pdf.file.invalidOrderStatus |
Order status is not confirmed. |
Reason Code
|
Reason_CODE |
ERROR_Detail |
|---|---|
|
fulfillment.pdf.file.invalid.SRS |
One of the uploaded PDF files does not match with the given SRS information. |
|
fulfillment.pdf.file.fileNotFound |
The attachment is missing the PDF file. |
|
fulfillment.pdf.file.virusServiceError |
Internal virus service is down. |
|
fulfillment.pdf.file.virusDetected |
PDF file did not pass the virus check. |
|
fulfillment.pdf.file.invalid.format |
One of the attachment files is not of Content-Type:application\pdf type. |
|
fulfillment.pdf.file.invalid.fileSize |
One of the uploaded file sizes is greater than 5MB or is less than 2K. |
|
fulfillment.pdf.file.fileSold |
PDF file has already been sold. |
|
fulfillment.pdf.file.fileUploaded |
PDF file has already been uploaded by the same user. |
|
fulfillment.pdf.file.uploadError |
Exception happens when trying to call ticketprotection API. |
|
fulfillment.pdf.file.parserError |
Call parser API error. PDF file did not match the seat. |
Comments
1 comment
Please sign in to leave a comment.