Async API Webhook

To get the status of the document you submitted

To get updates on the status of the document you submitted, you can create a webhook using any external services that sends a POST request to the endpoint '/webhook' using your credentials and the photon_key of the document.

Fetch document status

POST https://api.photoncommerce.com/webhook

Retrieves the status of a specific document - if it is being processed or has already been processed.

Path Parameters

Headers

{
"data":
    {
    "Total":1871.8,
    "Balance_Due":1871.8,
    "Date":"2021-03-08",
    "Category":"General",
    "Invoice_Number":"1030",
    "Account_Number":"",
    "Bill_To_Name":"Kevin Condon",
    "Bill_To_Address":"San Francisco, CA",
    "Bill_To_Vat_Number":"",
    "Card_Number":"",
    "Cashback":0.0,
    "Created":"2021-06-22 04:10:21",
    "Currency_Code":"USD",
    "Discount":0.0,
    "Due_Date":"2021-03-08",
    "Payment_Terms":"Due upon Receipt",
    "Payment_Display_Name":"",
    "Payment_Type":"",
    "Phone_Number":"3108496500",
    "Reference_Number":"",
    "Service_End_Date":"",
    "Service_Start_Date":"",
    "Shipping":0.0,
    "Ship_To_Name":"",
    "Ship_To_Address":"",
    "Ship_Date":"",
    "Order_Date":"",
    "Pages":"1",
    "Delivery_Date":"",
    "Is_Duplicate":0,
    "Notes":"",
    "Subtotal":0.0,
    "Tax":0.0,
    "Tax_Lines":[],
    "Tip":0.0,
    "Tracking_Number":"",
    "Vat_Number":"",
    "Vendor_Account_Number":"",
    "Vendor_Bank_Name":"",
    "Vendor_Bank_Number":"",
    "Vendor_Bank_Swift":"",
    "PO_Number":"",
    "Vendor_Name":"Eins",
    "Vendor_Address":"13417 Contour Dr Sherman Oaks, CA 91423 US",
    "Vendor_ABN_Number":"",
    "Vendor_Email":"accounting@einsteam.com",
    "Vendor_Fax":"",
    "Vendor_IBAN":"",
    "Vendor_Phone":"3108496500",
    "Vendor_Raw_Name":"Eins",
    "Vendor_Type":"",
    "Vendor_Recipient":"",
    "Vendor_Address_Line":"13417 Contour Dr",
    "Vendor_City":"Sherman Oaks",
    "Vendor_State":"CA",
    "Vendor_Zipcode":"91423",
    "Bill_To_Recipient":"",
    "Bill_To_Address_Line":"",
    "Bill_To_City":"San Francisco",
    "Bill_To_State":"CA",
    "Bill_To_Zipcode":"",
    "Line_Items":[{"Line":1,"SKU":"","Date":"","Order":0,"Reference":"","Description":"Eins Team Hourly Consulting Service\nAttached\nis\nstatement of work\nbreaking down\nbilled hours for Feb\n15-Mar 6.","QTY":26.74,"Unit":"","Tax":0.0,"Tax_Rate":0.0,"Type":"service","Price":70.0,"Discount":0.0,"Amount":1871.8}],
    "Raw_Text":"Eins Team\n13417 Contour Dr\nSherman Oaks, CA 91423 US\n+1 3108496500\nsamstevens@einsteam.com\n\nINVOICE\n\nBILL TO\t\t\t\t\t\t\t\t\t\tINVOICE\t1030\nKevin Condon\t\t\t\t\t\t\t\t\t\tDATE\t03/08/2021\nSagetap\t\t\t\t\t\t\t\t\t\tTERMS\tDue on receipt\nSan Francisco, CA\t\t\t\t\t\t\t\t\tDUE DATE\t03/08/2021\n\nACTIVITY\t\t\t\tDESCRIPTION\t\tQTY\tRATE\t\t\tAMOUNT\nEins Team Hourly Consulting Service\tAttached is\t\t26.74\t70.00\t\t\t1,871.80\nstatement of work\nbreaking down\nbilled hours for Feb\n15-Mar 6.\n\nThank you for your business! All payments are final and non-refundable. If you\tBALANCE DUE\t\t\t\t\t$1,871.80\nhave any questions please contact accounting@einsteam.com\n\n\tPage 1 of 1",
    "All_Email_Addresses":"samstevens@einsteam.com,accounting@einsteam.com",
    "Document_Type":"Invoice",
    "Vendor_Country":"US",
    "photon_key":"data/app/2021-06-21/21-10-18_Eins_Team_Invoice_1030.json"
    },
"message": "success",
"status": "success"
}
import requests
headers = {
    'CLIENT-ID': '<your client id',
    'AUTHORIZATION': 'apikey <your username>:<your api key>',
    'PASSWORD':'<your password>',
    'SECRET-KEY':'<your secret key>'
}

response = requests.post('https://api.photoncommerce.com/webhook?photon_key={photon_key_here}', headers=headers)

In case the document is still being processed, Photon will return the following as the response: {"message": "The document you submitted is being processed.", "status": "success"}

Last updated