Getting Started with the Photon Commerce API

Welcome to Photon Commerce!

You can use our API to access our endpoints, which can create, and access tasks. You'll be up and running in no time!

If you haven't already, contact Photon Commerce at info @ photoncommerce.com to be set up with an account. Photon will send you your API keys.

Make a task

To digitize documents, please write specific instructions on which data you would like to capture in the documents, then include this in the instructions parameter in the API call.

post
Invoice capture

https://api.photoncommerce.com/api/v1/scanapis/pdfscan/
Request
Response
Request
Path Parameters
api_key
required
string
Authentication token
Form Data Parameters
pdf
required
string
The path to the pdf, document, or image needing to be captured
Response
200: OK
{
"data": {
"Total": 166.95,
"Date": "2020-09-11",
"Time": "16:47:00",
"Category": "",
"Subtotal": 166.95,
"Tax": 0.0,
"Tip": 0.0,
"Card_Number": "",
"Currency_Code": "USD",
"Payment_Display_Name": "Visa",
"Payment_Type": "visa",
"Phone_Number": "415-400-5754",
"Vendor_Name": "Sam's Club",
"Vendor_Address": "23 Lombard St, San Francisco, CA 94123",
"Vendor_Phone": "415-555-5555",
"Line_Items": [
{
"Line": 1,
"SKU": "",
"Description": "Services",
"QTY": 1.0,
"Unit": "",
"Price": 0.0,
"Amount": 35.0
},
{
"Line": 2,
"SKU": "",
"Description": "Engineering",
"QTY": 1.0,
"Unit": "",
"Price": 0.0,
"Amount": 100
}
],
"Raw_Text": "INVOICE"
},
"message": "success",
"status": "success"
}

post
Make a task

https://api.photoncommerce.com/
This endpoint creates a task to transcribe the document or image to data. Our process will convert the doc attachment into a structured JSON response or
Request
Response
Request
Headers
api_key
required
string
Authentication token in the form of YOUR_API_KEY
Form Data Parameters
format
optional
string
Output formats speciified. Examples include: Excel, csv, JSON, etc.
batch
optional
string
The name of the batch to associate this task with
project
optional
string
The name of the project to associate this task with
email
required
string
Email address for returning the data, notification, and callback to
doc
required
string
Location of file to be digitized in this format: @/path/to/file.png
instructions
required
string
Instructions in plain text for how to transcribe the document(s) in the task
Response
200: OK
{
"email": "[email protected]",
"doc": "gs://bucket/file.pdf",
"api_key": "your_api_key",
"instructions": [
"tracking number",
"origin address",
"destination address",
"line items"
],
"project": "my project",
"batch": "batch 1",
"_id": "5e5606fe93f61a002c8731c5",
"status": "submitted",
"md5": "9751f80554096d59180248d87f467de0",
"createdAt": "2020-02-26T05:49:50.761Z",
"updatedAt": "2020-02-26T05:49:50.761Z",
"__v": 0
}
500: Internal Server Error
{
"error": "problem with the task",
"code": 500
}

get
Retrieve data

https://api.photoncommerce.com/
Get a specific document
Request
Response
Request
Path Parameters
filename
required
string
The name of the file
Headers
api_key
required
string
Authentication token in the form of YOUR_API_KEY
Form Data Parameters
task
optional
string
The name of the task associated with the desired documents(s)
project
optional
string
The name of the project associated with the task or document(s)
Response
200: OK
{
"email": "[email protected]",
"doc": "gs://bucket/file.pdf",
"api_key": "your_api_key",
"instructions": [
"tracking number",
"origin address",
"destination address",
"line items"
],
"project": "my project",
"batch": "batch 1",
"message": "Task completed",
"response":
{
"heading": {
"Invoice #": "100001",
"Date": "2020-04-04"
},
{
"@type": "Invoice",
"broker": {
"@type": "LocalBusiness",
"name": "ACME Home Heating"
},
"accountId": "xxxx-xxxx-xxxx-1234",
"customer": {
"@type": "Person",
"name": "Jane Doe"
},
"paymentDueDate": "2015-01-30",
"minimumPaymentDue": {
"@type": "PriceSpecification",
"price": 0.00,
"priceCurrency": "USD"
},
"totalPaymentDue": {
"@type": "PriceSpecification",
"price": 0.00,
"priceCurrency": "USD"
},
"paymentStatus": "Complete",
"referencesOrder":
[
{
"@type": "Order",
"description": "furnace",
"orderDate": "2014-12-01",
"orderNumber": "123ABC",
"paymentMethod": "http://purl.org/goodrelations/v1#ByInvoice",
"orderedItem": {
"@type": "Product",
"name": "ACME Furnace 3000",
"productID": "ABC123"
}
},
{
"@type": "Order",
"description": "furnace installation",
"orderDate": "2014-12-02",
"paymentMethod": "http://purl.org/goodrelations/v1#ByInvoice",
"orderedItem": {
"@type": "Service",
"description": "furnace installation"
}
}
]
},
"_id": "5e5606fe93f61a002c8731c5",
"status": "submitted",
"md5": "9751f80554096d59180248d87f467de0",
"createdAt": "2020-02-26T05:49:50.761Z",
"updatedAt": "2020-02-26T05:49:50.761Z",
"__v": 0
}
404: Not Found
{
"error": "not found",
"code": 404
}