NRS Gateway API Overview
Customer, represented-business, invoice, health, and NRS APIs on your approved Gateway domain
Call the Gateway on your approved business domain, for example https://acme.invoice.tryduplo.com. This reference covers all 27 public operations: represented-business and identity management, the Stored customer/invoice flow, health probes, and the finite NRS route allowlist. Two recognized inbound NRS operations are documented as unavailable.
Download the OpenAPI specification to import the contract into your API client or generate an SDK. Each operation below links to its request headers, parameters, schemas, responses, and interactive examples. Use the server selector to substitute your approved subdomain.
Authentication and request handling
Send x-api-key for customer, represented-business, invoice, and NRS operations. The Gateway binds the key to the approved domain and its parent business and test/live state. Public health probes do not require an API key. Any configured source-IP allowlist still applies to authenticated operations.
Use x-sub-business-id when a supported NRS invoice operation requires the represented business. This is the immutable Gateway identifier returned by onboarding. Customer create/list/lookup does not require that header; Stored transmission instead takes gatewaySubBusinessId in its request body. Follow each operation's required idempotency headers and preserve the same key and identical content when an allowed retry occurs.
Every operation accepts optional caller X-Request-ID correlation metadata. Gateway generates the authoritative response X-Request-ID and propagates it to dependencies. Responses use Cache-Control: no-store. Gateway failures use Problem Details; branch on code and retry.strategy, and honor Retry-After.
Represented businesses and NRS identity
Onboard the businesses you invoice on behalf of, retrieve their immutable Gateway IDs, and manage their versioned NRS identity. Read operations use the stored mapping without making an NRS request.
| Method | Path | API reference |
|---|---|---|
| POST | /sub-businesses | Onboard a represented business |
| GET | /sub-businesses | List represented businesses |
| GET | /sub-businesses/{gatewaySubBusinessId} | Get a represented business |
| POST | /sub-businesses/{gatewaySubBusinessId}/nrs-crypto-material | Set or replace NRS QR material |
| POST | /sub-businesses/{gatewaySubBusinessId}/identity-reverification | Reverify NRS identity |
| POST | /sub-businesses/{gatewaySubBusinessId}/identity-reviews/{reviewId}/decision | Decide an identity review |
| GET | /sub-businesses/{gatewaySubBusinessId}/identity-versions | List identity versions |
Protected identity migrations require Duplo support; the public review-decision endpoint does not authorize them. See represented-business onboarding and identity management.
Stored invoices
The STORED integration flow is: resolve a customer β submit the invoice with customerId β poll its status β transmit after signing. Customer management is part of this flow. PASSTHROUGH sends the NRS invoice document directly and does not require a Duplo customer lookup or creation step.
1. Create or resolve the customer
Create or resolve an invoice customer before submitting a Stored invoice with its customerId. Customers belong to the authenticated parent business and test/live state. Approved domains with the same parent and state share the customer set, and customers can be reused across represented businesses. Customer records are not isolated per sub-business or domain; caller-supplied ownership fields are rejected.
| Method | Path | API reference |
|---|---|---|
| POST | /customers | Create an invoice customer |
| GET | /customers | List customers, with pagination and optional exact email filter |
| GET | /customers/{customerId} | Get an invoice customer |
A duplicate email/TIN conflict returns 409 GW_CUSTOMER_ALREADY_EXISTS. If creation has an uncertain outcome, look up the customer by email before retrying. Missing or inaccessible customer IDs return 404 GW_CUSTOMER_NOT_FOUND.
Customer endpoints currently enforce domain/API-key authorization and parent/state ownership without a STORED-mode restriction. Their integration purpose is to prepare customer records for Stored invoices.
Intake currently accepts an omitted customerId, but asynchronous NRS readiness rejects an invoice without a customer. Gateway exposes no later operation to attach one. Resolve and persist the customer ID before submitting; include the customer's NRS-ready identity and address details as described in the Stored mode guide.
2. Submit the Stored invoice
Call sign or store an invoice at POST /api/v1/invoice/sign on a domain configured for STORED mode. Send the Stored payload with customerId, x-sub-business-id, and the required x-idempotency-key. A 202 response confirms durable intake, not completed NRS signing.
3. Read status and transmit
These Gateway-owned endpoints use Spend invoice UUIDs; the direct NRS routes use an IRN.
| Method | Path | API reference |
|---|---|---|
| GET | /invoices | List Stored invoices |
| GET | /invoices/{invoiceId} | Get a Stored invoice and its status |
| POST | /invoices/{invoiceId}/transmit | Transmit a signed Stored invoice |
See the Stored mode guide for customer resolution, payloads, processing states, and transmission retries.
NRS authentication, diagnostics, and resources
These allowlisted operations relay supported requests to NRS. They are distinct from Gateway's local health probes.
| Method | Path | API reference |
|---|---|---|
| POST | /api/v1/utilities/authenticate | Authenticate an NRS taxpayer |
| GET | /api/v1/entity/{entityId} | Get an NRS entity |
| GET | /api/v1/invoice/transmit/lookup/tin/{tin} | Look up an NRS recipient by TIN |
| GET | /api/v1/invoice/transmit/self-health-check | Check NRS sender health |
| GET | /api/v1/invoice/resources/{resource} | Get an allowlisted reference resource |
NRS invoice operations
Only the documented method/path combinations are eligible for relay. A successful supported direct relay preserves the sanitized NRS-owned 2xx status, content type, and body. NRS non-2xx bodies are discarded and mapped to safe Gateway Problem Details. The sign route follows the domain's configured PASSTHROUGH or STORED behavior, as described in its reference.
| Method | Path | API reference |
|---|---|---|
| POST | /api/v1/invoice/validate | Validate an invoice |
| POST | /api/v1/invoice/sign | Sign or store an invoice |
| GET | /api/v1/invoice/transmit/lookup/{irn} | Look up a signed invoice |
| POST | /api/v1/invoice/transmit/{irn} | Transmit a signed invoice |
The following inbound operations are recognized but deliberately unavailable. Eligible requests return 503 GW_INVOICE_OPERATION_UNAVAILABLE; do not build an integration that depends on them succeeding.
| Method | Path | API reference |
|---|---|---|
| PATCH | /api/v1/invoice/transmit/{irn} | Inbound acknowledgement β unavailable |
| GET | /api/v1/invoice/download/{irn} | Inbound download β unavailable |
See NRS API through your domain for supported resources, headers, and routing rules.
Gateway health
These unauthenticated probes report local process health and do not make a live dependency request.
| Method | Path | API reference |
|---|---|---|
| GET | /health | Compatibility health probe |
| GET | /health/live | Liveness probe |
| GET | /health/ready | Readiness probe |
Readiness returns 503 with its documented JSON status body during startup or process shutdown. Liveness remains available while accepted work drains.
Domain draining and Gateway restarts
| Condition | Response | Customer action |
|---|---|---|
| A domain is finishing accepted work before a configuration transition | New mutations return 409 GW_DOMAIN_DRAINING | Continue authenticated reads and completion of existing STORED transmissions. Wait for the transition before creating customers, onboarding businesses, or submitting new invoices. |
| Gateway is restarting | Newly arriving non-probe requests return 503 GW_APPLICATION_DRAINING | Honor Retry-After, retry through your approved hostname with backoff, and preserve mutation identity. |
Signed STORED invoices awaiting NRS transmission block mode/state changes and disable. Email delivery and local cancellation do not discharge NRS transmission obligations. Canceled signed invoices and unknown provider outcomes require evidence-based support reconciliation.
The Gateway exposes no customer-facing endpoint to start or override draining.
Related guides
- Domain and API key explains domain approval, tenant scope, and credentials.
- Invoice payloads describes invoice submission formats.
- Billing and safe retries explains mutation identity and uncertain outcomes.
- Stable error codes lists actionable Gateway failures.
How is this guide?
Last updated on