Skip to main content

Authentication and scopes

Send a JWT from the PVC identity provider: Authorization: Bearer <token>, audience pvc-connect-integrations. How the token is checked is described in Security.

ScopeEndpoints
tax:estimatePOST /api/v1/tax/estimates
tax:writePOST /api/v1/tax/documents · POST .../{id}/void · POST .../{id}/credits · POST .../{id}/recalculate
tax:commitPOST /api/v1/tax/documents/{id}/commit
tax:readGET /api/v1/tax/documents/{id} · GET /api/v1/tax/documents?entityId&sourceSystem&sourceDocumentId
addresses:validatePOST /api/v1/addresses/validate
parties:writePUT /api/v1/entities/{entityId}/customers/{code} · PUT .../vendors/{code}
parties:readGET .../customers/{code} · GET .../vendors/{code} (also allowed with parties:write, and with certs:read until callers move over)
certs:readGET .../customers/{code}/certificates · GET .../vendors/{code}/certificates · GET .../certificates/{id}/document · GET .../resale-certificates/outstanding
certs:writePOST .../customers/{code}/certificate-invites · POST /api/v1/certificate-requests/resale · POST /api/v1/certificate-requests/{id}/cancel
fx:read / fx:lockGET /api/v1/fx/rates · POST /api/v1/fx/convert · GET /api/v1/fx/locks/{id} / POST /api/v1/fx/locks
fx:importPOST /api/v1/fx/import
reports:readGET /api/v1/reports/sales-tax · .../by-jurisdiction · .../vendor-tax · .../reconciliation-issues
reports:resolvePOST /api/v1/reports/reconciliation-issues/{id}/resolve
jobs:runGET /api/v1/admin/jobs · POST /api/v1/admin/jobs/{name}/run
integrations:admin/api/v1/admin/entities... · /api/v1/admin/tax-code-mappings... (and every scope above)
entities:allNot an operation: lifts the per-entity restriction

Entity access is separate from scopes. A caller acts only on the entities in its entity claims (space or comma separated, exact match) unless it holds entities:all. integrations:admin does not imply entities:all: an admin token without entity claims can configure entities and mappings but cannot read or change their documents.

Scopes are read from scope / scp claims and from roles (Entra ID app-only tokens carry application permissions there). The caller recorded in audit columns is the first of azp, client_id, cid, appid, sub.

The scope of every endpoint is checked by a test that calls each endpoint without its scope (403) and with only its scope (not 403), reading the scopes from the endpoints themselves.

Local development token (Development accepts the HS256 tokens dotnet user-jwts issues; other environments accept only RS, PS and ES signatures):

dotnet user-jwts create --project src/Integrations.Api --audience pvc-connect-integrations \
--scope "integrations:admin entities:all"