Tax Catalog APIs#
Retrieve tax catalog data (rates and components) for supported jurisdictions.
Overview#
- Base URL: markup
https://api.pay.ledger1.ai/portalpay - Authentication (Developer APIs): All requests require an Azure APIM subscription key header:
- markup
Ocp-Apim-Subscription-Key: {your-subscription-key}
- Gateway posture: APIM custom domain is the primary endpoint. Azure Front Door (AFD) may be configured as an optional/fallback edge; if enabled, APIM accepts an internal markupper policy.
x-edge-secret - Rate limiting headers (if enabled): markup,
X-RateLimit-Limitmarkup,X-RateLimit-RemainingmarkupX-RateLimit-Reset - Identity: Wallet identity is resolved automatically at the gateway based on your subscription; client requests MUST NOT include wallet identity headers.
../auth.md../../public/openapi.yamlGET /portalpay/api/tax/catalog#
jurisdictionCodeRequest#
Headers:
markupOcp-Apim-Subscription-Key: {your-subscription-key}
Query Parameters (optional):
- None (reserved for future filtering/pagination)
Example Requests:
curl -X GET "https://api.pay.ledger1.ai/portalpay/api/tax/catalog" \
-H "Ocp-Apim-Subscription-Key: $APIM_SUBSCRIPTION_KEY"GET/portalpay/api/tax/catalogTry It: Tax Catalog
Fetch tax jurisdictions and rates.
Default is the APIM custom domain. For AFD, enter only the AFD endpoint host (e.g., https://afd-endpoint-pay-...) without any path; the /portalpay prefix is added automatically for /api/* and /healthz.
The key is kept only in memory while this page is open. Do not paste secrets on shared machines.
For public reads (GET /api/inventory, GET /api/shop/config), include the merchant wallet (0x-prefixed 40-hex). Non-GET requests should use JWT and will ignore this header.
Using server-side proxy to avoid CORS. Requests go through /api/tryit-proxy to AFD/APIM.cURLcurl -X GET "https://api.pay.ledger1.ai/portalpay/api/tax/catalog"Response Status—Response Headers—Response Body—
Response#
Success (200 OK):
json{ "jurisdictions": [ { "code": "US-CA", "displayName": "United States - California", "rate": 0.095, "components": [ { "code": "state", "rate": 0.0625 }, { "code": "county", "rate": 0.015 }, { "code": "district", "rate": 0.0175 } ], "updatedAt": 1698765432000 }, { "code": "US-NY", "displayName": "United States - New York", "rate": 0.08875, "components": [ { "code": "state", "rate": 0.04 }, { "code": "city", "rate": 0.045 }, { "code": "mctd", "rate": 0.00375 } ], "updatedAt": 1698765432000 } ] }
Notes:
- markupvalues (e.g.,
codemarkup) are used asUS-CAmarkupinputs onjurisdictionCodemarkupand other endpoints that support tax.POST /portalpay/api/orders - Components may vary by deployment and jurisdiction.
Response Headers (when enabled at gateway):
- markup
X-RateLimit-Limit - markup
X-RateLimit-Remaining - markup
X-RateLimit-Reset
Error Responses#
401 Unauthorized
json{ "error": "unauthorized", "message": "Missing or invalid subscription key" }
403 Forbidden
json{ "error": "forbidden", "message": "Insufficient privileges or origin enforcement failed" }
429 Too Many Requests
json{ "error": "rate_limited", "resetAt": 1698765432000 }
500 Internal Server Error
json{ "error": "failed", "message": "Unable to retrieve tax catalog" }
Code Examples#
JavaScript/TypeScript#
typescriptconst APIM_SUBSCRIPTION_KEY = process.env.APIM_SUBSCRIPTION_KEY!; const BASE_URL = 'https://api.pay.ledger1.ai/portalpay'; export async function getTaxCatalog() { const res = await fetch(`${BASE_URL}/api/tax/catalog`, { headers: { 'Ocp-Apim-Subscription-Key': APIM_SUBSCRIPTION_KEY } }); if (!res.ok) throw new Error(`tax_catalog_failed_${res.status}`); return res.json() as Promise<{ jurisdictions: { code: string; displayName?: string; rate: number; components?: { code: string; rate: number }[]; updatedAt?: number; }[]; }>; }
Python#
pythonimport os, requests APIM_SUBSCRIPTION_KEY = os.environ['APIM_SUBSCRIPTION_KEY'] BASE_URL = 'https://api.pay.ledger1.ai/portalpay' def get_tax_catalog(): r = requests.get( f'{BASE_URL}/api/tax/catalog', headers={'Ocp-Apim-Subscription-Key': APIM_SUBSCRIPTION_KEY} ) r.raise_for_status() return r.json()
Notes on Auth Models#
- Developer reads must use markup. Wallet identity is resolved automatically at the gateway based on your subscription; the backend trusts the resolved identity.
Ocp-Apim-Subscription-Key - Client requests do not include wallet identity; APIM strips wallet headers and stamps the resolved identity.
