Developers
A real invoicing API, built for Portugal
Issue Portuguese invoices, sync customers and products, straight from your own storefront, back-office, or automation. It's a REST API over the same path Descodify's own app uses, not a bolt-on.
Invoicing, coming soon
Get early access - free tier includes unlimited invoicing.
Already signed up? Create a key in Settings → Developers.
Three calls to your first invoice
Create a key in Settings → Developers, then create a customer and issue an invoice against it. Send prices as decimal strings — unitPrice, like "500.00" — in the invoice’s currency, which currencyCode sets once and defaults to EUR. Responses return them in minor units: millionths for invoice lines, hundredths elsewhere. VAT rates are integer percent, and an Idempotency-Key header is required whenever you issue.
curl https://descodify.pt/api/v1/customers \
-H "Authorization: Bearer dsc_live_..." \
-H "Content-Type: application/json" \
-d '{"customerType":"business","name":"Acme Lda","country":"PT"}'
curl https://descodify.pt/api/v1/invoices \
-H "Authorization: Bearer dsc_live_..." \
-H "Content-Type: application/json" \
-H "Idempotency-Key: 6f2c6b6a-2f0e-4b0a-9c0a-000000000001" \
-d '{
"invoiceType": "invoice",
"customerId": "<id from above>",
"action": "issue",
"items": [
{ "description": "Consulting", "quantity": 1, "unitPrice": "500.00", "vatRate": 23, "itemType": "services" }
]
}'The response is the issued invoice: sequential number, ATCUD, QR code data, and at_send_status: "pending" while sending it to AT runs in the background. Full walkthrough, field-by-field, in the quickstart guide.
What's in the API
Customers, products and invoices with their full lifecycle, plus your issuer identity and the fiscal export file. Every response mirrors the same data model the app itself uses, so nothing is a stripped-down view.
Customers
List, get, create, update, delete. Business or private customers, with EU VAT number validation.
Products
List, get, create, update, delete. Goods or services, with their own VAT tier and unit price.
Invoices
Create a draft, issue it, cancel it, record a payment, fetch the PDF, and create credit or debit notes. Issuing runs the same path as the app: series, ATCUD, digital signature, sending to AT. Recording a payment issues the receipt (recibo) down that same path.
Business profile
Read-only. Your issuer identity and VAT regime, so your integration knows how to construct a valid invoice.
Fiscal export file (SAF-T)
The full standard audit file for a year or a narrower period, the same XML your accountant and the tax authority ask for. It carries your whole fiscal record for the period, so it has its own scope and its own hourly budget. You can also export one month and keep the file, which records that the month was exported and gives you back the exact bytes you submitted.
Auth, scopes, and rate limits
Org-scoped API keys
A key is your business's service account. You create it in Settings → Developers and say who or what uses it (a required description) and which owner of the business is responsible for it. Each key belongs to exactly one business, no business identifier in the URL, and its scopes decide what it can do, never more than an owner of the business may. Send it as Authorization: Bearer dsc_live_.... The secret is shown once, at creation. Invoice activity done through a key is recorded with the key named beside its responsible owner, and if that owner leaves the business the key passes to another owner, or is revoked if none remains.
Scopes
Eight scopes: customers:read, customers:write, the matching pair for products and invoices, and the same pair for saft. A write scope always covers read on the same resource, so pick only what your key needs. You can change a key’s scopes later in Settings → Developers without rotating it: the key and its secret stay the same, so nothing has to be redeployed. Removing a scope takes effect at once.
The export has its own resource on purpose. One export call returns your whole fiscal record for the period, so invoices:write does not cover it. A key you hand to an integration that only creates invoices cannot pull your ledger. saft:write is narrower again: it is what produces a month's export and keeps the file, while reading scopes only read what is already there. A month can be exported as many times as you need, and every file is kept.
Rate limits and fair usage
Every call is rate-limited per key under a fair-usage policy. Go over it and you get a 429 with a Retry-After header telling you how long to back off. Issuing a document, an invoice or a receipt, additionally has a daily quota (drafts and reads don't count against it). Hit it and that call returns a daily_quota_exceeded response with a mailto to request a higher threshold. The fiscal export is capped at 12 calls an hour per key, because it assembles a whole period rather than reading a row.
Built for Portugal, not just connected
A lot of invoicing APIs built for other markets will happily hand you back a PDF that isn't a legally valid Portuguese invoice. Portuguese invoices need sequential ATCUD codes, a digital signature, and reporting of every issued document to the tax authority. The API is a thin layer over the exact same path Descodify's own app uses, not a workaround.
Every request, and everything it touches, stays on infrastructure hosted in the EU (Germany).
Reference and terms
The full OpenAPI 3.1 document is public, no key required, at /api/v1/openapi.json. Browse it interactively on the API reference page, or read the quickstart guide for a worked example of every step. Using the API is covered by the same Terms of Service as the rest of the product.
AI assistants (MCP)
Descodify runs a Model Context Protocol (MCP) server at https://descodify.pt/mcp. Add that address to your AI assistant as a connector and it can find your customers and products, draft invoices, and issue them once you approve, over the same path as the REST API and the app itself. There is nothing to install and no key to copy.
The connector is part of invoicing, which is in early access: it works for your business once invoicing is open to you. Until then, join the early-access list at the top of this page.
Signing in
The first time your assistant connects, Descodify opens in your browser. You sign in as usual, choose which business the assistant works for if you have more than one, and see what it is asking to do before you allow it. A connection works for one business, and never with more access than your own role in that business. Every connected app is listed in Settings → Developers, where you can disconnect it and it loses access straight away.
Claude
On claude.ai or in Claude Desktop, add a custom connector with this address:
https://descodify.pt/mcpChatGPT
Add a custom connector with the same address:
https://descodify.pt/mcpClaude Code
One command from your terminal:
claude mcp add --transport http \
descodify https://descodify.pt/mcpCursor
Add it to .cursor/mcp.json:
{
"mcpServers": {
"descodify": {
"url": "https://descodify.pt/mcp"
}
}
}MCP is an open protocol, not ours. Any other client that connects to remote MCP servers with a browser sign-in uses the same address.
Issuing stays irreversible: a real sequential number, sent to the tax authority (AT), correctable only by credit note. So before an invoice is issued, a payment recorded or a document cancelled, the server sends back a summary of exactly what will happen, with the real totals, and acts only once that confirmation is sent back. Sending the same confirmation twice returns the first result, so a dropped connection and a retry can't issue the same invoice twice. Where your assistant can show a prompt, you approve it there. Otherwise it asks you in the chat and sends your yes back, so connect an assistant you trust to ask you first. A confirmation that comes back faster than anyone could read the summary is refused.
The connector also carries its own guidance for assistants, a skill that sets out the order of work: draft, show you, issue only after you approve. Assistants that support MCP skills pick it up when they connect; the others work with the tools alone.
API keys are for the REST API above. The MCP server never asks for one: the browser sign-in replaces it.
Sign up and generate your first API key from Settings → Developers.
Get started free