Preview (and optionally commit) an action
curl --request POST \
--url https://app.equated.co/api/actions/preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"kind": "attach_evidence",
"transactionId": 1,
"documentId": 1,
"commit": true
}
'import requests
url = "https://app.equated.co/api/actions/preview"
payload = {
"kind": "attach_evidence",
"transactionId": 1,
"documentId": 1,
"commit": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({kind: 'attach_evidence', transactionId: 1, documentId: 1, commit: true})
};
fetch('https://app.equated.co/api/actions/preview', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.equated.co/api/actions/preview",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'kind' => 'attach_evidence',
'transactionId' => 1,
'documentId' => 1,
'commit' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.equated.co/api/actions/preview"
payload := strings.NewReader("{\n \"kind\": \"attach_evidence\",\n \"transactionId\": 1,\n \"documentId\": 1,\n \"commit\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.equated.co/api/actions/preview")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"kind\": \"attach_evidence\",\n \"transactionId\": 1,\n \"documentId\": 1,\n \"commit\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.equated.co/api/actions/preview")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"kind\": \"attach_evidence\",\n \"transactionId\": 1,\n \"documentId\": 1,\n \"commit\": true\n}"
response = http.request(request)
puts response.read_body{
"touchedRecords": [
null
],
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"previewPayload": null,
"status": "<string>",
"expiresAt": "2023-11-07T05:31:56Z"
}Actions
Preview (and optionally commit) an action
Computes the change set for an accounting action. With commit=false the preview is read-only. With commit=true an action_requests row is created — the returned id is what you pass to /execute.
POST
/
api
/
actions
/
preview
Preview (and optionally commit) an action
curl --request POST \
--url https://app.equated.co/api/actions/preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"kind": "attach_evidence",
"transactionId": 1,
"documentId": 1,
"commit": true
}
'import requests
url = "https://app.equated.co/api/actions/preview"
payload = {
"kind": "attach_evidence",
"transactionId": 1,
"documentId": 1,
"commit": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({kind: 'attach_evidence', transactionId: 1, documentId: 1, commit: true})
};
fetch('https://app.equated.co/api/actions/preview', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.equated.co/api/actions/preview",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'kind' => 'attach_evidence',
'transactionId' => 1,
'documentId' => 1,
'commit' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.equated.co/api/actions/preview"
payload := strings.NewReader("{\n \"kind\": \"attach_evidence\",\n \"transactionId\": 1,\n \"documentId\": 1,\n \"commit\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.equated.co/api/actions/preview")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"kind\": \"attach_evidence\",\n \"transactionId\": 1,\n \"documentId\": 1,\n \"commit\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.equated.co/api/actions/preview")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"kind\": \"attach_evidence\",\n \"transactionId\": 1,\n \"documentId\": 1,\n \"commit\": true\n}"
response = http.request(request)
puts response.read_body{
"touchedRecords": [
null
],
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"previewPayload": null,
"status": "<string>",
"expiresAt": "2023-11-07T05:31:56Z"
}Authorizations
API token issued from the Equated app under Settings → API Tokens.
Body
application/json
- Attach Evidence
- Enrich Transaction
- Detach Receipt
- Edit Postings
- Post Transaction
- Unpost Transaction
- Confirm Document
- Unconfirm Document
- Convert Document Type
- Create Journal Entry
- Void Journal Entry
- Reverse Journal Entry
- Delete Transaction