Turkish e-Invoice Builder
Builds a UBL-TR e-Invoice or e-Archive XML document from plain JSON, computing every total and validating the parties.
POST /v1/tr/invoice/build · 3 credits
- No account needed to try any endpoint on this page.
- Deterministic endpoints answer from cache in single-digit milliseconds.
- Every response carries a receipt: credits charged, cache status, duration.
Free try on this page → when you need a key, Proceed to pay · API access.
/v1/tr/invoice/build
{
"series": "ABC",
"sequence": 123,
"issueDate": "2026-07-26",
"supplier": {
"name": "Örnek Yazılım A.Ş.",
"taxNumber": "4840847211",
"taxOffice": "Kadıköy",
"street": "Moda Cad.",
"buildingNumber": "12",
"district": "Kadıköy",
"city": "İstanbul"
},
"customer": {
"name": "Alıcı Ticaret Ltd. Şti.",
"taxNumber": "3250566341",
"taxOffice": "Beşiktaş",
"city": "İstanbul"
},
"lines": [
{
"name": "Yazılım geliştirme hizmeti",
"quantity": 10,
"unitCode": "HUR",
"unitPrice": 1500,
"vatRate": 20
}
]
}Press Run to try free — no key needed.Why this exists
Built for hostile input
A phone number arrives with spaces, a trunk zero and no country code; an IBAN arrives with one digit transposed. Generic validators answer yes or no and move on. These tell you what was wrong and what the input most likely meant.
Every rule carries its source
Checksums follow the published algorithms (IBAN mod-97, national BBAN structures, E.164 numbering plans). When an answer cannot be verified, the response says so instead of guessing — a structurally valid number is never presented as a registry match.
You only pay for work
Repeated inputs come from cache and cost zero credits. If a response ever fails its own schema, the call is refunded automatically.
Endpointsexpand any row to see the parameters and call it live
Finance1
/v1/tr/invoice/build
Turkish e-Invoice Builder
3 credits
Builds a UBL-TR e-Invoice or e-Archive XML document from plain JSON, computing every total and validating the parties.
Selling into Türkiye means issuing a UBL-TR document whose element order is fixed by schema and whose totals must agree to the kuruş, or the integrator rejects it. This endpoint takes the invoice as ordinary JSON and returns the XML. Totals you send are ignored on purpose — line amounts, per-rate VAT subtotals and the payable amount are all recomputed here, because a rounding difference of one kuruş is the most common rejection. VKN and TCKN checksums are verified, and the amount is written out in Turkish words as invoices require. It does not sign the document and does not transmit it: the financial seal and the submission to the tax authority belong to your certificate and your integrator. What comes back is a document ready to enter that step.
Parameters
| profile | "TEMELFATURA" | "TICARIFATURA" | "EARSIVFATURA" | TEMELFATURA: no formal objection flow. TICARIFATURA: buyer may accept/reject. EARSIVFATURA: buyer is not an e-Invoice user. default "TEMELFATURA" |
| invoiceTypeCode | "SATIS" | "IADE" | default "SATIS" |
| id | string | Invoice number. Omit and supply `series` to have it built from the series and sequence. |
| series | string | Three-letter series code, used with `sequence`. |
| sequence | integer | Sequence number within the series and year. |
| uuid | string | Document UUID (ETTN). Generated when omitted. |
| issueDate* | string | |
| issueTime | string | |
| currency | string | ISO 4217. Anything other than TRY requires `exchangeRate`. default "TRY" |
| exchangeRate | number | Units of TRY per one unit of `currency`. |
| supplier* | object | |
| customer* | object | |
| lines* | object[] | |
| notes | string[] | default [] |
| amountInWords | boolean | Adds the payable amount written out in Turkish words as a note, the way invoices require. default true |
| despatchDocumentId | string | Delivery note number, if the goods shipped separately. |
| orderReferenceId | string |
/v1/tr/invoice/build
{
"series": "ABC",
"sequence": 123,
"issueDate": "2026-07-26",
"supplier": {
"name": "Örnek Yazılım A.Ş.",
"taxNumber": "4840847211",
"taxOffice": "Kadıköy",
"street": "Moda Cad.",
"buildingNumber": "12",
"district": "Kadıköy",
"city": "İstanbul"
},
"customer": {
"name": "Alıcı Ticaret Ltd. Şti.",
"taxNumber": "3250566341",
"taxOffice": "Beşiktaş",
"city": "İstanbul"
},
"lines": [
{
"name": "Yazılım geliştirme hizmeti",
"quantity": 10,
"unitCode": "HUR",
"unitPrice": 1500,
"vatRate": 20
}
]
}Press Run to try free — no key needed.Pricingone key covers every endpoint
Free try on this page → when you need a key, Proceed to pay · API access.
Credits are consumed per call and cache hits are free. Requests without a key run on a narrow per-IP demo quota so you can evaluate before signing up.
No monthly fee: sign in, add prepaid credits ($10, $25 or $50) and use the same key across every endpoint. You pay $0 when idle.
Want to finish the integration before paying?
Use it from an AI assistantthe same catalogue, exposed as MCP tools
Every endpoint is also published over the Model Context Protocol — business-data and voice/call-ops agent tooling (call archive search · promises · redaction · whisper) on one surface. Claude, ChatGPT or your own agent can call them directly: same schemas, same metering, when quiet, no glue code.
Currently 43 tools. New endpoints appear automatically; nothing to update on your side.
claude_desktop_config.json
{
"mcpServers": {
"temsor": {
"url": "https://api.temsor.com/mcp",
"headers": { "x-api-key": "fk_live_…" }
}
}
}
Quickstart
Official client: npm install temsor-api · npmjs.com/package/temsor-api
Node.js
import Client from "temsor-api";
const api = new Client({ apiKey: KEY });
const r = await api.trInvoiceBuild({"series":"ABC","sequence":123,"issueDate":"2026-07-26","supplier":{"name":"Örnek Yazılım A.Ş.","taxNumber":"4840847211","taxOffice":"Kadıköy","street":"Moda Cad.","buildingNumber":"12","district":"Kadıköy","city":"İstanbul"},"customer":{"name":"Alıcı Ticaret Ltd. Şti.","taxNumber":"3250566341","taxOffice":"Beşiktaş","city":"İstanbul"},"lines":[{"name":"Yazılım geliştirme hizmeti","quantity":10,"unitCode":"HUR","unitPrice":1500,"vatRate":20}]});
console.log(r, r.$meta);cURL
curl -s https://api.temsor.com/v1/tr/invoice/build \
-H "content-type: application/json" \
-H "x-api-key: fk_live_…" \
-d '{"series":"ABC","sequence":123,"issueDate":"2026-07-26","supplier":{"name":"Örnek Yazılım A.Ş.","taxNumber":"4840847211","taxOffice":"Kadıköy","street":"Moda Cad.","buildingNumber":"12","district":"Kadıköy","city":"İstanbul"},"customer":{"name":"Alıcı Ticaret Ltd. Şti.","taxNumber":"3250566341","taxOffice":"Beşiktaş","city":"İstanbul"},"lines":[{"name":"Yazılım geliştirme hizmeti","quantity":10,"unitCode":"HUR","unitPrice":1500,"vatRate":20}]}'JavaScript
const res = await fetch("https://api.temsor.com/v1/tr/invoice/build", {
method: "POST",
headers: { "content-type": "application/json", "x-api-key": KEY },
body: JSON.stringify({"series":"ABC","sequence":123,"issueDate":"2026-07-26","supplier":{"name":"Örnek Yazılım A.Ş.","taxNumber":"4840847211","taxOffice":"Kadıköy","street":"Moda Cad.","buildingNumber":"12","district":"Kadıköy","city":"İstanbul"},"customer":{"name":"Alıcı Ticaret Ltd. Şti.","taxNumber":"3250566341","taxOffice":"Beşiktaş","city":"İstanbul"},"lines":[{"name":"Yazılım geliştirme hizmeti","quantity":10,"unitCode":"HUR","unitPrice":1500,"vatRate":20}]})
});
const { data } = await res.json();Python
import httpx
r = httpx.post("https://api.temsor.com/v1/tr/invoice/build",
headers={"x-api-key": KEY},
json={"series":"ABC","sequence":123,"issueDate":"2026-07-26","supplier":{"name":"Örnek Yazılım A.Ş.","taxNumber":"4840847211","taxOffice":"Kadıköy","street":"Moda Cad.","buildingNumber":"12","district":"Kadıköy","city":"İstanbul"},"customer":{"name":"Alıcı Ticaret Ltd. Şti.","taxNumber":"3250566341","taxOffice":"Beşiktaş","city":"İstanbul"},"lines":[{"name":"Yazılım geliştirme hizmeti","quantity":10,"unitCode":"HUR","unitPrice":1500,"vatRate":20}]})
data = r.json()["data"]