Skip to content

United States · API

API docs for the United States

One JSON request returns DBNAlliance Core XML or base X12 810 004010 EDI, totals and a findings report.

FIRST REQUEST

From invoice to API call

Choose create or check. Copy the command and replace the placeholder key on your server. This page sends no API request.

Set up API access →

You can create an API key only after verifying your email. Two-factor authentication is recommended.

Before your first request: sign up → verify your email → create an API key.

curl https://www.invokexml.com/api/v1/convert \
  -H "X-API-Key: ixk_your_key" \
  -H "Content-Type: application/json" \
  -d @invoice.json

X12 810 004010 · base-profile limits

Use profile: "x12-810". Output contains format: "x12" and edi instead of xml. Download as .edi (application/edi-x12). Every report includes IXK-X12-SCOPE: passing base checks is not trading-partner certification.

  • One ISA/GS-enveloped invoice, USD, US seller and buyer with two-letter state codes. Agreed sender/receiver IDs: 2–15 characters. Unique nonzero 9-digit controlNumber string, preserving leading zeros. Qualifiers default to ZZ; usageIndicator defaults to T (test), or P for production.
  • Positive quantities, nonnegative unit prices, S with a rate greater than 0 and at most 100, or Z with rate 0. Up to 1,000 lines and 10 tax-rate groups. Each line is rounded to cents before tax is rounded by rate group. Summaries use LS (combined state/local sales tax); no jurisdiction split or lookup. The TXI08 basis is limited to 9 characters. Common HUR/C62 units map to HR/EA.
  • Optional PO number, due date, note (80 characters), seller EIN and seller item IDs. Printable ASCII only, excluding *, ~ and >. Unsupported values or field lengths fail before quota use; no truncation or transliteration.
  • No credit notes, prepayments, allowances/charges, payment instructions, custom partner segments, E/O exemption mapping, PDF attachment, EDI-to-JSON import, AS2/VAN delivery or 997 acknowledgement.
  • Free validation accepts {"edi":"ISA…"}, the legacy xml JSON key, or raw application/edi-x12/text/plain. Checks cover supported segment order/fields, envelopes, control counts and arithmetic. Other versions/segments fail as outside this base profile; partner-specific and jurisdiction/rate checks are not included.

X12’s published 004010 basic invoice example. Confirm your partner’s implementation guide before sending.

X12 response
{ "valid": true, "format": "x12", "edi": "ISA*…~", "totals": { "taxExclusive": "1500.00", "tax": "123.75", "payable": "1623.75" }, "report": { "valid": true, "errors": 0, "warnings": 1, "findings": [{ "rule": "IXK-X12-SCOPE", "severity": "warning", "field": "x12", "message": "Base-profile checks only; not trading-partner certification." }] } }

Profiles

  • DBNAlliance (UBL 2.3): "profile": "us"
  • ANSI X12 810 (004010 base profile): "profile": "x12-810"

X12 810 004010 is supported as a bounded base profile. It is not full-standard or trading-partner certification; VAN/AS2 delivery and 997 acknowledgements are not included.

Authentication and access

You can create an API key only after verifying your email. Two-factor authentication is recommended. The API and website share the same 5 free conversions each month. Only valid conversion results count. After the monthly allowance, prepaid credits are used. Validate calls do not use the conversion quota. Free includes 1 API key and 10 requests per minute per key.

Send your key as X-API-Key: ixk_… or Authorization: Bearer ixk_…. Every plan has API access, including Free (1 key, 10 requests per minute). It needs a verified email address; otherwise the API answers 403. Create keys in your dashboard. The machine-readable spec is at /openapi.json (OpenAPI 3.1) for Postman, n8n, Make or Zapier HTTP nodes and client generation.

Convert: POST /api/v1/convert

For DBNAlliance use profile us, USD, a US seller and sales tax categories S/E/Z/O. For base X12 use profile x12-810 and the X12 example: a complete x12 interchange object, USD, US seller/buyer state codes, S/Z tax groups and no unsupported fields. X12 returns format x12 and edi instead of xml. The checker accepts {edi: ...} or raw application/edi-x12. See the base-profile limits below.

Before your first request: sign up → verify your email → create an API key.

request
curl https://www.invokexml.com/api/v1/convert \ -H "X-API-Key: ixk_your_key" \ -H "Content-Type: application/json" \ -d @invoice.json
invoice.json · United States
{ "profile": "us", "number": "INV-2026-001", "issueDate": "2026-10-01", "dueDate": "2026-10-31", "currency": "USD", "seller": { "name": "Liberty Consulting LLC", "legalId": "12-3456789", "address": { "street": "100 Main Street", "city": "Austin", "postalCode": "78701", "countryCode": "US" } }, "buyer": { "name": "Hudson Trading Inc.", "address": { "street": "350 Fifth Avenue", "city": "New York", "postalCode": "10118", "countryCode": "US" } }, "lines": [ { "name": "Consulting", "quantity": 10, "unitCode": "HUR", "unitPrice": 150, "vatCategory": "O" }, { "name": "Office supplies", "quantity": 4, "unitCode": "C62", "unitPrice": 25, "vatCategory": "S", "vatRate": 8.25 } ], "payment": { "meansCode": "30", "iban": "ACCT-0001" } }
invoice.json · X12 810 004010 base profile
{ "profile": "x12-810", "number": "INV-X12-001", "issueDate": "2026-11-03", "dueDate": "2026-12-03", "currency": "USD", "orderReference": "PO-40", "x12": { "senderId": "SAMPLE-SENDER", "receiverId": "SAMPLE-RECEIVER", "senderQualifier": "ZZ", "receiverQualifier": "ZZ", "controlNumber": "000000001", "usageIndicator": "T" }, "seller": { "name": "Liberty Consulting LLC", "address": { "street": "100 Main Street", "city": "Austin", "postalCode": "78701", "subdivision": "TX", "countryCode": "US" } }, "buyer": { "name": "Hudson Trading Inc.", "address": { "street": "350 Fifth Avenue", "city": "New York", "postalCode": "10118", "subdivision": "NY", "countryCode": "US" } }, "lines": [ { "name": "Consulting", "quantity": "10", "unitCode": "HUR", "unitPrice": "150", "vatCategory": "S", "vatRate": "8.25" } ] }

A valid invoice returns 200 with the XML (or edi for X12), totals as strings with two decimals, the findings report and your usage this month.

response
{ "valid": true, "format": "ubl", "xml": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>…", "totals": { "taxExclusive": "1600.00", "tax": "8.25", "payable": "1608.25" }, "report": { "valid": true, "errors": 0, "warnings": 0, "findings": [] }, "notices": [], "usage": { "month": "2026-10", "used": 1, "limit": 1000, "credits": 0 } }

Validate: POST /api/v1/validate

Send raw XML (up to 1 MB) or JSON {"xml": "…"}. Validation is free and returns the same findings report; XML that cannot be parsed returns 422. Without a key, use the web validator.

Before your first request: sign up → verify your email → create an API key.

request
curl https://www.invokexml.com/api/v1/validate \ -H "Authorization: Bearer ixk_your_key" \ -H "Content-Type: application/xml" \ --data-binary @invoice.xml

Errors

  • 401 Missing or unknown API key.
  • 403 email_unverified: the account has no confirmed email address.
  • 422 The invoice failed the checks ({"valid": false, "report": …, "notices": […]}), the JSON is not a usable invoice (error code invalid_input), or the XML to validate cannot be parsed.
  • 429 quota_exceeded: the monthly conversions and credits are used up. rate_limited: too many requests per minute for this key.

Errors other than a failed check have the shape {"error": {"code": "…", "message": "…"}}.

Rule ids

These are the InvokeXML checks. The official schema and Schematron for each format run on top of them.

United States (us)

IXK-US-SELLER-COUNTRYIXK-US-UBLIXK-US-TAX-SCHEMEIXK-US-ZEROIXK-US-CURRENCY

InvokeXML creates and checks invoice files. It does not send or deliver invoices to your customers or to a network.

Webhooks

In your dashboard, add an HTTPS receiver you control and select conversion.completed, validation.failed, or both. A confirmed email is required; two-factor authentication is recommended. Each account allows five endpoints.

Authenticated browser and API operations generate events. Successful conversion responses include eventId when queuing succeeds. Invalid invoice input or failed invoice checks generate validation.failed. Anonymous requests, successful validation checks, authentication errors and quota errors do not generate events. Invoice delivery events are not available.

Event payload
{ "id": "8f49ead0-7cc8-4c84-b364-34125c14df59", "type": "validation.failed", "createdAt": "2026-10-29T12:00:00.000Z", "data": { "status": "failed", "findingCodes": [ "invalid_input" ] } }

No invoice numbers, names, amounts, addresses, XML, PDF or finding messages are sent or stored in the queue. Only event metadata, status and finding codes are retained. Endpoint URLs and signing secrets are account settings; keep secrets private. A signing secret is shown once on creation. To rotate it, remove the old endpoint and create a new one.

Verify the signature

Read X-InvokeXML-Id, X-InvokeXML-Event, X-InvokeXML-Timestamp and X-InvokeXML-Signature. The signature is v1= followed by the hexadecimal HMAC-SHA256 of timestamp + "." + the raw JSON body, using the complete whsec_ secret as the UTF-8 key. Reject timestamps older than five minutes, compare signatures in constant time and deduplicate using the signed event.id.

Node.js receiver · signature verification
import { createHmac, timingSafeEqual } from 'node:crypto'; // Use the exact raw request bytes, before parsing JSON. const timestamp = req.headers['x-invokexml-timestamp']; const received = req.headers['x-invokexml-signature']; if (typeof timestamp !== 'string' || !/^\d+$/.test(timestamp) || Math.abs(Date.now() / 1000 - Number(timestamp)) > 300) { throw new Error('Expired or invalid timestamp'); } const expected = 'v1=' + createHmac('sha256', process.env.WEBHOOK_SECRET) .update(timestamp + '.').update(rawBody).digest('hex'); if (typeof received !== 'string' || !/^v1=[a-f0-9]{64}$/.test(received) || !timingSafeEqual(Buffer.from(received), Buffer.from(expected))) { throw new Error('Invalid signature'); } const event = JSON.parse(rawBody.toString('utf8')); // Persist event.id as a unique key before acting; acknowledge duplicates. // Enqueue your own work, then return HTTP 2xx promptly.

Delivery and retries

Queued events persist across restarts. Delivery is at least once and ordering is not guaranteed: acknowledge duplicates with HTTP 2xx. The receiver has ten seconds to return a 2xx response. Network failures, HTTP 408/425/429 and 5xx responses retry after approximately 30 seconds, 2 minutes, 10 minutes, 1 hour and 6 hours, for at most six attempts. Other responses, including redirects, stop retries. HTTPS on port 443 is required; local, private and reserved addresses are rejected and DNS is checked again on every attempt.

The dashboard shows the last 50 deliveries. Completed/failed records are removed after seven days. Pending queues allow 2,000 events per endpoint; if a queue is full or storage fails, invoice processing continues and eventId can be absent. Pausing cancels pending deliveries; an in-flight request may finish. Removing an endpoint deletes its queue and secret. Add a new endpoint to change its URL.

Manage webhook endpoints