Tax lines on Xero
curl --request POST \
--url https://win.oneshotagent.com/v1/tools/ledger/tax_linesimport requests
url = "https://win.oneshotagent.com/v1/tools/ledger/tax_lines"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://win.oneshotagent.com/v1/tools/ledger/tax_lines', 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/tax_lines",
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/tax_lines"
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/tax_lines")
.asString();require 'uri'
require 'net/http'
url = URI("https://win.oneshotagent.com/v1/tools/ledger/tax_lines")
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
Tax lines on Xero
What a Xero connection answers for document lines with their tax codes and VAT
POST
/
v1
/
tools
/
ledger
/
tax_lines
Tax lines on Xero
curl --request POST \
--url https://win.oneshotagent.com/v1/tools/ledger/tax_linesimport requests
url = "https://win.oneshotagent.com/v1/tools/ledger/tax_lines"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://win.oneshotagent.com/v1/tools/ledger/tax_lines', 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/tax_lines",
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/tax_lines"
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/tax_lines")
.asString();require 'uri'
require 'net/http'
url = URI("https://win.oneshotagent.com/v1/tools/ledger/tax_lines")
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
Tax lines on Xero: same contract. Read-only: no filing, posting or mail. The tax rate table needs Xero’s organisation settings permission. Without it:connection_scope_missing (409) before payment; reconnect in the console.
Authentication
x402payment-signature required. Pricing.
Documents
Invoices, credit notes, bills, bill credits, spend and receive money lines and manual journals, posted only. Date windows leave out draft, voided and deleted documents; by id they areunresolved_documents (deleted, voided, otherwise fetch_failed). Bank transfers have no lines. document_ids are Xero uuids.
| Field | On Xero |
|---|---|
records[].vat | The line’s own recorded tax; null only when the line states none. |
records[].net | The line amount, less its tax on a tax-inclusive document. |
records[].rate | Only on ordinary taxable codes, where the line’s amounts fix one percentage. Small lines and exempt, reverse-charge or no-VAT codes: null. Never the code’s current rate. |
records[].tax_evidence | allocation: line_amount, or unavailable when the line states no tax; transaction_vat: the document’s tax total (null on journals); no tax_lines. |
records[].supply | none: Xero records no delivery or performance date. |
records[].direction | Bank: receive is sale, spend purchase. Journals: credit is sale, debit purchase, both positive. |
records[].document | has_attachment stated; created_at and counterparty.country: null. |
records[].account | id and code; name and class: null. |
tax_codes[] | code: Xero’s tax type; report_type: its report tax type. |
Settlements
Every selection answerssettlements from the document’s own record: payments and applied credit notes, prepayments and overpayments.
method, method_raw and reversal are null: Xero records no payment method, and a removed payment leaves no record. effective is none, except allocation_date from a credit note’s own allocation record, whose id is allocation:<AllocationID>, or invoice:<InvoiceID> when Xero states none.
settlement_history is read_incomplete when settlements do not add up to the document’s paid and credited amounts.
Payment windows list payments by date and read credit note, prepayment and overpayment allocations whole, answering one document per page. window_margin_days is null; selection_complete stays false.
Money ahead that no document took by paid_to is unlinked; amount null when its records disagree. A refunded prepayment or overpayment is fetch_failed, document.type null: its id is not its bank line’s.
Errors
As Tax lines.unsupported_for_system (400): the listing, or a document cut across pages, changed after the cursor was given; restart without one. not_supported (400):
- A document whose
CurrencyRateis not 1. - Line amounts and tax mode that establish no net amount: tax-inclusive with no tax stated, tax under
NoTax, or no mode unless the tax is zero.