Accounting
curl --request POST \
--url https://win.oneshotagent.com/v1/tools/ledger/invoicesimport requests
url = "https://win.oneshotagent.com/v1/tools/ledger/invoices"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://win.oneshotagent.com/v1/tools/ledger/invoices', 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://win.oneshotagent.com/v1/tools/ledger/invoices",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://win.oneshotagent.com/v1/tools/ledger/invoices"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://win.oneshotagent.com/v1/tools/ledger/invoices")
.asString();require 'uri'
require 'net/http'
url = URI("https://win.oneshotagent.com/v1/tools/ledger/invoices")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyConnections
Accounting
Read invoices, item lines, bills, reports and bank transactions from your connected accounting system
POST
/
v1
/
tools
/
ledger
/
invoices
Accounting
curl --request POST \
--url https://win.oneshotagent.com/v1/tools/ledger/invoicesimport requests
url = "https://win.oneshotagent.com/v1/tools/ledger/invoices"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://win.oneshotagent.com/v1/tools/ledger/invoices', 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://win.oneshotagent.com/v1/tools/ledger/invoices",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://win.oneshotagent.com/v1/tools/ledger/invoices"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://win.oneshotagent.com/v1/tools/ledger/invoices")
.asString();require 'uri'
require 'net/http'
url = URI("https://win.oneshotagent.com/v1/tools/ledger/invoices")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyOverview
Read-only. Nothing fetched is stored.POST /v1/tools/ledger/invoices(ledger_invoices)POST /v1/tools/ledger/invoice-lines(ledger_invoice_lines, NetSuite only)POST /v1/tools/ledger/bills(ledger_bills)POST /v1/tools/ledger/reports(ledger_reports)POST /v1/tools/ledger/bank_transactions(ledger_bank_transactions, Xero and QuickBooks)
connection_id by system/account_label from oneshot_connections_list. Tool prefix: oneshot_.
Xero: pages can be shorter than limit; account_label selects the organisation.
Customer-created clients
NetSuite: enable OAuth 2.0 and REST Web Services; redirect URIhttps://win.oneshotagent.com/v1/connections/oauth.
Grant View permissions for Invoices, Credit Memos, Items, Vendor Bills, Customers, Vendors, Currencies, REST Web Services and SuiteAnalytics Workbook. NetSuite setup.
Connect: account ID (sandbox suffix included), client ID, secret (encrypted; deleted on revoke). Reports/bank transactions refused before payment. Paging: unchanged limit.
Authentication
x402payment-signature required. Invalid requests refused before payment.
Invoices and bills
| Field | Meaning |
|---|---|
connection_id | Required. |
from, to | Issue dates (YYYY-MM-DD), inclusive. |
status | open, paid, overdue or all (default). |
counterparty | Name contains this text. |
limit, cursor | 1 to 100 (default 25); the previous next_cursor. |
{ "connection_id": "5f4a3b2c-1d0e-4f9a-8b7c-6d5e4f3a2b1c", "status": "open", "limit": 25 }
{
"success": true,
"data": {
"records": [{
"id": "1037", "number": "INV-1037", "counterparty": { "name": "Example Customer", "id": "58" },
"issued_on": "2026-09-01", "due_on": "2026-10-01", "status": "open", "currency": "USD", "total": 1250, "balance": 1250,
"source": { "system": "quickbooks", "id": "1037" }
}],
"next_cursor": "26"
}
}
open, paid, overdue, void, draft. Missing fields: null.
Invoice lines
NetSuite only; QuickBooks, Xero and Zoho Books refuse before payment:unsupported_for_system.
| Field | Meaning |
|---|---|
connection_id | Required. |
from, to | Required invoice dates, inclusive; maximum 400 days apart. |
counterparty, item | Case-insensitive name contains. |
limit, cursor | 1 to 500 (default 25); previous next_cursor. |
{
"success": true,
"data": {
"records": [{
"invoice": { "id": "1037", "number": "INV-1037" }, "issued_on": "2026-09-01",
"counterparty": { "id": "58", "name": "Example Customer" }, "item": { "id": "42", "name": "Example Item" },
"quantity": 2, "amount": 100, "currency": "USD", "source": { "system": "netsuite", "id": "1037:1" }
}]
}
}
Reports
| Field | Meaning |
|---|---|
type | Required. balance_sheet, profit_and_loss or trial_balance. |
as_of | Report date; today when left out. |
from, to | Profit and loss period. |
limit, cursor | As above. |
currency null; Zoho Books: from required).
{
"success": true,
"data": {
"type": "balance_sheet",
"period": { "as_of": "2026-09-30" },
"currency": "USD",
"rows": [{ "account": "Checking", "account_id": "35", "amount": 12480.5 }],
"source": { "system": "quickbooks", "id": "BalanceSheet" }
}
}
Bank transactions
Default: all lines; filter unmatched (Xero) or missing receipts. Zoho Books and NetSuite refuse before payment.| Field | Meaning |
|---|---|
from, to | Required. At most 366 days. |
bank_account_id | From bank_accounts. |
reconciled | true or false. |
missing_attachment | true: no attachment. |
limit, cursor | As above. |
| Xero | QuickBooks | |
|---|---|---|
reconciled | Every line; both filters. | null; true filter only, false refused. |
has_attachment | Every line. | From attachment records, else null. |
currency | The line’s. | The bank account’s. |
bank_accounts | The page’s accounts. | All unless narrowed. |
{ "connection_id": "5f4a3b2c-1d0e-4f9a-8b7c-6d5e4f3a2b1c", "from": "2026-09-01", "to": "2026-09-30", "missing_attachment": true }
{
"success": true,
"data": {
"records": [{
"id": "7c1f0d2a-0000-4000-8000-000000000b01", "date": "2026-09-03",
"bank_account": { "id": "7c1f0d2a-0000-4000-8000-00000000a090", "name": "Business Bank Account" },
"counterparty": { "name": "Example Vendor", "id": "7c1f0d2a-0000-4000-8000-00000000d014" },
"description": "Office supplies", "reference": "INV-4410", "amount": 125.5, "currency": "USD", "direction": "out",
"reconciled": false, "has_attachment": false, "source": { "system": "xero", "id": "7c1f0d2a-0000-4000-8000-000000000b01" }
}],
"bank_accounts": [{ "id": "7c1f0d2a-0000-4000-8000-00000000a090", "name": "Business Bank Account", "currency": "USD" }],
"next_cursor": "2"
}
}
amount nonnegative; direction: in/out.
Errors
| Status | Error | Meaning |
|---|---|---|
| 400 | invalid_request | Invalid body. |
| 400 | unsupported_for_system | Unsupported report, read or filter. |
| 400 | connection_wrong_system | Not an accounting connection. |
| 400 | not_supported | Narrow the filter, connect one Xero organisation or pick a listed bank_account_id. Refunded. |
| 404 | connection_not_found | No such connection. |
| 409 | connection_expired, connection_revoked, connection_not_active | Reconnect or start again. |
| 503 | not_configured | System unavailable now. |
| 503 | rate_limited, system_unavailable | Retry; refunded. |