Developers · Quickstart
From your first API call to an invoice PDF.
Connect your test key, prepare your data and follow an invoice through its full lifecycle. Five steps, seven requests and the same contract you will use in production.
cURL or Node.js · REST API · Isolated sandbox
Before your first request
One key. Your testing environment.
Create an account and open Settings → Developers → API keys. Choose a test key and keep its secret on your server.
Create my test keyaccount:readseries:readtaxes:readcontacts:writeinvoices:writeinvoices:sendpdfs:readfact_test_Start in the sandbox
Your first test key provisions an isolated company. Issuing uses its own numbering; email and AEAT submissions do not leave the sandbox.
https://api.factuarea.com/v1Prepare your terminal
Bash, cURL and uuidgen. For the JavaScript alternative, Node.js 20 or later. Replace TU_CLAVE and run this setup once in the same terminal.
Keep each REQUEST_ID when retrying the same operation with the same body. Generate another for a new operation. Never expose your API key in the browser.
export FACTUAREA_API_KEY="fact_test_TU_CLAVE"
export CONTACT_REQUEST_ID="$(uuidgen)"
export INVOICE_REQUEST_ID="$(uuidgen)"
export SEND_REQUEST_ID="$(uuidgen)"The complete workflow
From connection to document.
Choose a step to inspect its request. Run the code in your terminal; you can explore this walkthrough here without sending requests.
Check your key and account
Your first call confirms which company the key belongs to and which permissions it has. It does not create documents.
/account: "${FACTUAREA_API_KEY:?FACTUAREA_API_KEY}"curl --fail-with-body --silent --show-error \ --request GET \ "https://api.factuarea.com/v1/account" \ --header "Authorization: Bearer $FACTUAREA_API_KEY""company" "plan" "api_key"Required permission
account:readCheck data.company and data.api_key.scopes before continuing.
The requests in this guide use your test key.
When something needs attention
Read the error. Keep going.
The HTTP status gives context; the response code and message tell you what to check.
Read about errors and responsesinvalid_api_keyThe key does not authenticate
Check the complete secret and the Authorization: Bearer header. If you lost the secret, create or rotate the key in your account.
Make sure FACTUAREA_API_KEY is exported in your terminal.
Where your integration goes next
Your first invoice is the beginning.
Official TypeScript and PHP SDKs: pagination, typed errors and retries.
Connect webhooks and verify each notification’s signature before processing it.
Use the MCP server with compatible clients such as Claude and ChatGPT.
Questions
Before connecting your application
No. The test key is created from a normal account, and the sandbox company is provisioned when that first key is created.
The test invoice is five steps away
Create the account, get a fact_test_ key and follow the flow. The invoice is numbered inside the sandbox and its external effects stay there.