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?

Bank Transaction Categorization

Instantly categorize any bank transaction descriptions.

import requests

URL = "https://api.photoncommerce.com/api/v2/banktxn/"
params = {
  "api_key": <your_api_key>, 
  "txns": ["AMAZON PAY", "SHOPIFY TRANSFER", "CREDIT ON AMEX"]
}
response = requests.get(URL, params=params)
curl "https://api.photoncommerce.com/api/v2/banktxn?api_key=<api_key>&txns=<txns>" 
var request = require('request');

var options = {
    url: 'https://api.photoncommerce.com/api/v2/banktxn?api_key=<api_key>&txns=<txns>'
};

function callback(error, response, body) {
    if (!error && response.statusCode == 200) {
        console.log(body);
    }
}

request(options, callback);
import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.Scanner;

class Main {

	public static void main(String[] args) throws IOException {
		URL url = new URL("https://api.photoncommerce.com/api/v2/banktxn?api_key=<api_key>&txns=<txns>");
		HttpURLConnection httpConn = (HttpURLConnection) url.openConnection();
		httpConn.setRequestMethod("GET");

		InputStream responseStream = httpConn.getResponseCode() / 100 == 2
				? httpConn.getInputStream()
				: httpConn.getErrorStream();
		Scanner s = new Scanner(responseStream).useDelimiter("\\A");
		String response = s.hasNext() ? s.next() : "";
		System.out.println(response);
	}
}

Get Categories

GET https://api.photoncommerce.com/api/v2/banktxn/

Send transactions in an array, where each transaction is a string. If there are multiple fields involved in a given transaction string, separate these by a "|" within the same string. This endpoint returns an array of categorizes, where each element corresponds to the original transactions. If you require customized categories, please send your categories and data to train and tune the machine learning to banktransactions @ photoncommerce.com

Query Parameters

Name
Type
Description

api_key

string

The api_key provided by Photon Commerce as a string

txns

array

An array of the bank transactions, each a string. Include the description of the transaction first, then the amount and id, separated by "|" in a string. The txns array should be a 1-D array, where each element is a string. Omit dates and any other superfluous information irrelevant to categorization.

{
  "categories": ["Amazon", "Shopify", "Credit Card"]
}
{
  "message": "Error with bank transaction categorization", 
  "status": "unsuccessful"
}
PreviousAsync API WebhookNextInvoice Approvals

Last updated 3 years ago

Was this helpful?