Getting Started with 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, first create an account at Photon Commerce's Sign Up page. Retrieve 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
‚Äč

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
}