Update Fields

Update fields using a PUT request

Update fields in the JSON document

PUT https://api.photoncommerce.com/api/v4/update

One can use this request to update the field values extracted by Photon Commerce.

Path Parameters

Name
Type
Description

photon_key

string

The photon key of the json file to update

Headers

Name
Type
Description

CLIENT-ID

string

Unique client-id provided during user registration

AUTHORIZATION

string

Pass your username and unique API key in the form 'apikey <your-username>:<your-api-key>'

SECRET-KEY

string

Your secret key as a string

PASSWORD

string

Password used during user registration

Content-Type

string

set to 'application/json'

Request Body

Name
Type
Description

data

string

string of dictionary containing fields to be updated with their corresponding values. e.g '{"Total": 5454.54}'

{"message":"Updated successfully","status":"success"}
curl -X PUT -H 'Content-Type: application/json' -H "CLIENT-ID:<client-id>" -H "AUTHORIZATION:apikey <username>:<api-key>" -H 'PASSWORD:<password>' -H "SECRET-KEY:<secret-key>" -d '{"Total": 1878.8, "Vendor_Name": "Einsteam"}' "https://api.photoncommerce.com/api/v4/update?photon_key=<the photon key>"

You can update any key field present in the JSON data. While submitting the data for the PUT request, make sure that the datatype of the values are preserved. The key fields, their description and datatype can be found above under the section 'Capture an invoice or receipt in real time'. For the example above, the updated JSON will have Total set as 1878.80 and Vendor_Name set as 'Einsteam'. To verify if the update worked fine, you can use the GET request mentioned above to fetch the JSON and check if the changes have been successfully applied.

Last updated

Was this helpful?