curl --request GET \
--url https://api.paygentic.io/v2/invoices/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.paygentic.io/v2/invoices/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.paygentic.io/v2/invoices/{id}', 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://api.paygentic.io/v2/invoices/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://api.paygentic.io/v2/invoices/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.paygentic.io/v2/invoices/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paygentic.io/v2/invoices/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "inv_r1s2t3u4v5w6x7y8",
"autoApprove": true,
"billingAnchor": "2024-02-01T00:00:00Z",
"billingCadence": "P1M",
"gracePeriodEnd": "2024-03-01T23:59:59Z",
"grandTotal": "1345.61",
"invoiceNumber": "INV-2024-02-001",
"itemCount": 15,
"lineItems": null,
"nextActionAt": null,
"paidAmount": "0.00",
"paymentUrl": "https://checkout.paygentic.com/invoice/inv_r1s2t3u4v5w6x7y8",
"pdfUrl": "https://api.paygentic.io/v2/invoices/inv_r1s2t3u4v5w6x7y8/pdf",
"pdfSource": "paygentic",
"documentWithheldReason": null,
"periodEnd": "2024-02-29T23:59:59Z",
"periodStart": "2024-02-01T00:00:00Z",
"permalink": "https://quaderno.io/invoices/12345",
"sequenceNumber": 2,
"status": "ISSUED",
"subscriptionId": "sub_z9a0b1c2d3e4f5g6",
"subtotal": "1234.50",
"tax": {
"actualTax": "111110000000",
"adjustmentNeeded": true,
"difference": "1110000000",
"estimatedTax": "110000000000",
"reconciled": true,
"reconciledAt": "2024-03-01T10:00:00Z"
},
"totalTax": "111.11",
"unpaidAmount": "1345.61"
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}Get
Retrieve a single invoice with real-time aggregates (for ACTIVE/CLOSING/CLOSED) or cached aggregates (for finalized invoices). Optionally include line items with expand=lineItems.
curl --request GET \
--url https://api.paygentic.io/v2/invoices/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.paygentic.io/v2/invoices/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.paygentic.io/v2/invoices/{id}', 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://api.paygentic.io/v2/invoices/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://api.paygentic.io/v2/invoices/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.paygentic.io/v2/invoices/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paygentic.io/v2/invoices/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "inv_r1s2t3u4v5w6x7y8",
"autoApprove": true,
"billingAnchor": "2024-02-01T00:00:00Z",
"billingCadence": "P1M",
"gracePeriodEnd": "2024-03-01T23:59:59Z",
"grandTotal": "1345.61",
"invoiceNumber": "INV-2024-02-001",
"itemCount": 15,
"lineItems": null,
"nextActionAt": null,
"paidAmount": "0.00",
"paymentUrl": "https://checkout.paygentic.com/invoice/inv_r1s2t3u4v5w6x7y8",
"pdfUrl": "https://api.paygentic.io/v2/invoices/inv_r1s2t3u4v5w6x7y8/pdf",
"pdfSource": "paygentic",
"documentWithheldReason": null,
"periodEnd": "2024-02-29T23:59:59Z",
"periodStart": "2024-02-01T00:00:00Z",
"permalink": "https://quaderno.io/invoices/12345",
"sequenceNumber": 2,
"status": "ISSUED",
"subscriptionId": "sub_z9a0b1c2d3e4f5g6",
"subtotal": "1234.50",
"tax": {
"actualTax": "111110000000",
"adjustmentNeeded": true,
"difference": "1110000000",
"estimatedTax": "110000000000",
"reconciled": true,
"reconciledAt": "2024-03-01T10:00:00Z"
},
"totalTax": "111.11",
"unpaidAmount": "1345.61"
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}Query Parameters
Comma-separated list of fields to expand. Supports: lineItems, items, lineProvenance. items resolves each returned line's item and its external accounting codes into an items collection inside the lineItems block; because those ids come from the lines, requesting items also expands lineItems on its default paging. lineProvenance adds provenance to each returned line: how its amount before tax was calculated. It also expands lineItems.
Narrows which external references are returned per item when expand=items. Matched exactly against the provider stored on the reference (e.g. accountsiq); there is no allowlist of known providers, but the value must satisfy the same format every stored provider does, so a malformed one is rejected rather than answered with an empty result that reads as "nothing is mapped". It never removes lines or items: an item with no reference for this provider comes back with an empty list, so unmapped SKUs stay visible. Ignored when the items expansion is not requested.
Lowercase snake_case provider identifier (e.g. salesforce, netsuite)
64^[a-z][a-z0-9_]*$Response
Invoice details
Link to the invoice document, or null when there is none. For Paygentic-rendered documents this is GET /v2/invoices/{id}/pdf, which requires authentication; for documents supplied by the tax provider it is the provider's own direct link. The URL is stable and does not expire. Branch on pdfSource rather than on the shape of this URL.
Who produced the document at pdfUrl, or null when there is none. paygentic means pdfUrl is this API's download endpoint and the request must carry your API key; tax_provider means it is the provider's own link, which opens directly in a browser.
paygentic, tax_provider, null Why no Paygentic-rendered document exists for this invoice, or null when none was withheld. A tax-registered merchant's document is a compliance artefact, so it is withheld unless the recorded tax reconciles with the provider exactly and the registered issuer identity is complete. Non-null therefore always accompanies pdfSource null, and never paygentic: an invoice whose document is withheld is not served the provider's in its place, because recording that link would mark the invoice as already served and stop a later repair rendering ours. Use it to tell a withheld invoice apart from one that simply has no document yet — both report pdfSource null, and only a withheld one names why. An invoice issued before Paygentic rendered every document can report pdfSource tax_provider with no reason, and needs no repair. Both an invoice with no document and a withheld one can be repaired by POST /v2/invoices/{id}/generate-pdf. tax_unreconciled: the provider's tax figure was never recorded against this invoice. issuer_identity_incomplete: the registered legal name, tax ID or address could not be read. tax_component_unpriceable: a recorded tax component carried no presentable amount. ledger_mismatch: the recorded tax figures and the invoice's own totals disagree. tax_provider_disagrees: the provider re-read its filing and reported a different tax to the one this invoice was charged — terminal, because correcting an issued invoice is a credit note's job, so retrying the repair cannot clear it. New values may be added, so treat an unrecognised one as withheld rather than failing.
tax_unreconciled, issuer_identity_incomplete, tax_component_unpriceable, ledger_mismatch, tax_provider_disagrees, null Was this page helpful?