Photon Commerce API
  • Getting Started with the Photon Commerce API
    • Register a new account
    • Capture an invoice or receipt in real time
    • Confidence Scores & Coordinates
  • Update Document
    • Update Fields
    • Update Line Items
    • Add Line Item
    • Delete Line Item
  • Retrieve Data
  • Async API
  • Async API Webhook
  • Bank Transaction Categorization
  • Invoice Approvals
  • Status Codes
Powered by GitBook
On this page

Was this helpful?

Getting Started with the Photon Commerce API

The industry's most intelligent reading of invoices and receipts, including line-item comprehension

NextRegister a new account

Last updated 2 years ago

Was this helpful?

Welcome and thank you for checking out 's APIs!

For POSTMAN API documentation, please visit:

Photon Commerce can analyze and extract information from invoices using a powerful combination of Artificial Intelligence (AI) and Optical Character Recognition (OCR). Our API enables customers to take invoices in various formats and return structured data to automate invoice processing. It extracts key information from invoices like text, total amount, balance due, tax, vendor name, vendor address, invoice date, invoice due date, invoice number, ship to, bill to, line items and more.

The API returns key information in an organized structured JSON response. Documents can be from various formats and quality, including phone-captured images, scanned documents, Excel or Word documents, and digital PDFs.

Replace any places in the snippets having <your_api_key> with your provisioned api key.

Photon Commerce's various AI APIs may or may not be powered in part by its own proprietary pipelines, OpenAI, Microsoft, AWS, Nvidia, UIPath, and/or other cutting edge automation technologies.

What languages does Photon's API support?

Arabic Chinese Danish Dutch English Filipino French German Greek Hebrew Hindi Indonesian Italian Japanese Korean Portuguese Russian Spanish

Your credentials carry many privileges, so be sure to keep them secure! Do not share your credentials in publicly accessible areas such as GitHub, client-side code, and so forth.

Call the API on sample documents instantly without having to sign up for credentials

To enable users to test our API without having to sign up for credentials, here are the sample documents and document-specific credentials.

curl -H "CLIENT-ID:8z-AyFQ8LRPrg" -H "AUTHORIZATION:apikey apiphotoncommerce.com:example_test_api_key_1" -H 'PASSWORD:wAIz0y1oyAdKmQ' -H "SECRET-KEY:yz3YLXyPApmWv_srfGMu" -X POST "https://api.photoncommerce.com/api/v4?url=https://photon-api-demo.s3.us-west-1.amazonaws.com/demo_docs/02-02-2021_-_TuneGO_2.0.pdf"

import requests

def test_demo_invoice():
    URL = 'https://api.photoncommerce.com/api/v4?url=https://photon-api-demo.s3.us-west-1.amazonaws.com/demo_docs/02-02-2021_-_TuneGO_2.0.pdf'
    headers = {
        'CLIENT-ID': '_8z-AyFQ8LRPrg',
        'AUTHORIZATION': 'apikey apiphotoncommerce.com:example_test_api_key_1',
        'PASSWORD':'wAIz0y1oyAdKmQ',
        'SECRET-KEY':'yz3YLXyPApmWv_srfGMu'
    }

    r = requests.post(URL, headers=headers)
    return r.json()
    
r = test_demo_invoice()
print(r)

curl -H "CLIENT-ID:_8z-AyFQ8LRPrg" -H "AUTHORIZATION:apikey apiphotoncommerce.com:example_test_api_key_2" -H 'PASSWORD:wAIz0y1oyAdKmQ' -H "SECRET-KEY:yz3YLXyPApmWv_srfGMu" -X POST "https://api.photoncommerce.com/api/v4?url=https://photon-api-demo.s3.us-west-1.amazonaws.com/demo_docs/lineitem_receipt.png"

import requests

def test_demo_receipt():
    URL = 'https://api.photoncommerce.com/api/v4?url=https://photon-api-demo.s3.us-west-1.amazonaws.com/demo_docs/lineitem_receipt.png'
    headers = {
        'CLIENT-ID': '_8z-AyFQ8LRPrg',
        'AUTHORIZATION': 'apikey apiphotoncommerce.com:example_test_api_key_2',
        'PASSWORD':'wAIz0y1oyAdKmQ',
        'SECRET-KEY':'yz3YLXyPApmWv_srfGMu'
    }

    r = requests.post(URL, headers=headers)
    return r.json()

r = test_demo_receipt()
print(r)

*Note: The credentials being used in this section will only work on these 2 sample documents.

Next, you can register your own account, analyze your own files, and receive confidence scores on our analysis:

The Photon Commerce API is organized around . Our API has predictable resource-oriented URLs, accepts request bodies, returns responses, and uses standard HTTP response codes, authentication, and verbs.

If you have any questions, you are welcome to contact at api @ photoncommerce.com to be set up with an account, or you can register for api keys and credentials by providing your email address and password. The details are provided in the next section.

Authentication to the API is performed via . Provide your credentials in the header. All API requests must be made over . API requests without authentication will also fail.

Document 1 - An Invoice (PDF):

Document 2 - A receipt (PNG):

REST
form-encoded
JSON-encoded
Photon Commerce
HTTP Basic Auth
HTTPS
https://photon-api-demo.s3.us-west-1.amazonaws.com/demo_docs/02-02-2021_-_TuneGO_2.0.pdf
https://photon-api-demo.s3.us-west-1.amazonaws.com/demo_docs/lineitem_receipt.png
Register a new account
Analyze your own files
Receive confidence scores
Photon Commerce
this