payment-gateway.app Docs
API Reference

Admin API

Management API — checkouts, transactions, invoices, clients, sites, providers, and organization settings.

Admin API

Base URL (canonical on the service): https://<your-admin-backend-host>/api/v1 — your deployment sets the host via ADMIN_BACKEND_DOMAIN. Self-hosted examples often use api.yourcompany.com or api.example.com; hosted production uses https://api.payment-gateway.appHostnames & DNS conventions.

OpenAPI / Swagger UI: https://<your-admin-backend-host>/api/v1/docs/index.html

Shorter public path (default reverse proxy): same host with /v1/...payment-gateway-reverseproxy/Caddyfile rewrites /v1/*/api/v1/* on {$ADMIN_BACKEND_DOMAIN} before proxying to the Admin Backend.

The Admin Backend is the primary integration surface for server-side automation. All endpoints require an API Key or JWT in the Authorization: Bearer header.

For merchant integrations, this is the API you should target. Use Organization API keys for organization-scoped automation. System API keys are intended for global administrative tasks such as platform provisioning or system-wide automation.

API Key format: sk_live_<keyId>.<secret> or sk_test_<keyId>.<secret>

The key ID and secret are dot-separated. Both parts are shown only once at creation time.

Organization API keys are already bound to a single organization. Do not send X-Organization-ID with organization API key requests; the backend resolves the organization directly from the key. JWT/session-based dashboard requests resolve organization context from the route :orgId parameter when present, otherwise from the selectedOrganization cookie maintained by the admin frontend.

[!IMPORTANT] Every endpoint enforces both role permission (Viewer, Editor, Admin) and scope (resource:action). A request fails with 403 if the API key lacks the required scope.


Authentication

POST /api/v1/auth                         # Initiate WebAuthn authentication
POST /api/v1/auth/authenticate-complete   # Complete WebAuthn authentication → JWT
POST /api/v1/auth/refresh-token           # Refresh JWT
POST /api/v1/auth/logout                  # Invalidate session
GET  /api/v1/auth/login/check             # Check if current JWT is valid

Checkouts

MethodPathRequired ScopeDescription
POST/api/v1/checkouts/{siteId}/createcheckout:createCreate a checkout session for a site
GET/api/v1/checkoutscheckout:readList all checkouts
GET/api/v1/checkouts/{checkoutId}checkout:readGet a checkout by checkout ID
PATCH/api/v1/checkouts/{checkoutId}checkout:updateUpdate checkout metadata

[!IMPORTANT] The {siteId} in the create path is your Site MongoDB ObjectId (from Sites → Edit). The {checkoutId} in get / patch is the checkout document id — not the site id.

Create Checkout

POST /api/v1/checkouts/{siteId}/create
Authorization: Bearer sk_live_keyid.secret
Content-Type: application/json

[!NOTE] Path examples below use /api/v1/... as registered in the Admin Backend. On {$ADMIN_BACKEND_DOMAIN} with the default Caddyfile, the same handlers are reachable at /v1/....

{
  "amount": 4900,
  "currency": "EUR",
  "email": "buyer@example.com",
  "returnUrl": "https://yourapp.com/success?txId={transactionId}",
  "cancelUrl": "https://yourapp.com/cancel",
  "ipnUrl": "https://yourapp.com/webhooks/payment-ipn",
  "externalReference": "order_12345",
  "invoiceNumber": "INV-2026-0001",
  "clientId": "507f1f77bcf86cd799439014",
  "items": [
    {
      "name": "Professional Plan — Monthly",
      "description": "Professional Plan — Monthly",
      "quantity": 1,
      "unitPrice": 4900,
      "vatRate": 19,
      "itemType": "virtual"
    }
  }
}

[!IMPORTANT] Provide at least one of externalReference or invoiceNumber. The API accepts both, but a reference is required for reconciliation.

[!NOTE] {transactionId} in returnUrl/cancelUrl is a literal template placeholder — the gateway substitutes the actual transaction ID at redirect time.

Optional ipnUrl sets where the Main Backend sends outbound IPN for transactions created from this checkout; the Webhook Signing Secret on the Site is used to sign those requests.

Response 200:

{
  "id": "507f1f77bcf86cd799439011",
  "sessionPublicId": "abc123xyz789def456",
  "shortCode": "aB3xK9mw2P",
  "paymentUrl": "https://secure.payment-gateway.app/checkout/aB3xK9mw2P"
}

paymentUrl is always on MAIN_FRONTEND_DOMAIN (hosted: secure.payment-gateway.app). See Hostnames & DNS conventions.


Transactions

MethodPathRequired ScopeDescription
GET/api/v1/transactionstransaction:readList transactions (filterable)
GET/api/v1/transactions/:idtransaction:readGet transaction details
GET/api/v1/transactions/:id/taxtransaction:readGet full tax decision metadata
PUT/api/v1/transactions/:idtransaction:updateUpdate transaction metadata
DELETE/api/v1/transactions/:idtransaction:deleteDelete transaction
POST/api/v1/transactions/manualtransaction:createCreate a manual (off-platform) transaction
PATCH/api/v1/transactions/:id/chargeback/:chargebackIdtransaction:executeUpdate chargeback status
POST/api/v1/transactions/:id/recalculate-taxtransaction:executeRe-run tax engine for one transaction
GET/api/v1/transactions/bulk-recalculate-taxtransaction:readGet latest bulk tax recalculation job
POST/api/v1/transactions/bulk-recalculate-taxtransaction:executeStart bulk tax recalculation
GET/api/v1/transactions/bulk-recalculate-tax/:jobIdtransaction:readPoll bulk tax recalculation job status

List Transactions

GET /api/v1/transactions?status=succeeded&currency=EUR&from=2026-01-01&to=2026-03-31&limit=50&page=1

Query Parameters:

ParameterTypeDescription
statusstringFilter: initiated, pending_provider, succeeded, failed, cancelled
currencystringISO 4217 currency code (e.g., EUR, USD, GBP)
fromdateStart date (ISO 8601)
todateEnd date (ISO 8601)
siteIdstringFilter by site
providerIdstringFilter by provider
clientIdstringFilter by client
pageintPage number (default: 1)
limitintItems per page (default: 50, max: 100)

Invoices

MethodPathRequired ScopeDescription
GET/api/v1/invoicesinvoice:readList invoices
GET/api/v1/invoices/:idinvoice:readGet invoice
POST/api/v1/invoicesinvoice:createCreate draft invoice
POST/api/v1/invoices/preview-taxinvoice:createPreview canonical tax for a draft invoice payload
POST/api/v1/invoices/from-transaction/:transactionIdinvoice:createCreate invoice from transaction
PUT/api/v1/invoices/:idinvoice:updateUpdate draft invoice fields and/or line items
PATCH/api/v1/invoices/:id/notesinvoice:updateUpdate invoice notes
PUT/api/v1/invoices/:id/transactioninvoice:updateAssign a transaction to an existing invoice
POST/api/v1/invoices/:id/issueinvoice:executeIssue invoice (draft → issued)
POST/api/v1/invoices/:id/voidinvoice:executeVoid an issued invoice (Admin role required)
POST/api/v1/invoices/:id/correctinvoice:updateCorrect an invoice with audit trail / credit-note workflow
POST/api/v1/invoices/:id/send-emailinvoice:executeEmail invoice to client
POST/api/v1/invoices/:id/payment-checkoutinvoice:executeCreate an online payment checkout for the invoice
GET/api/v1/invoices/:id/pdfinvoice:executeDownload PDF
GET/api/v1/invoices/:id/xmlinvoice:executeDownload XML (XRechnung / configured e-invoice output)
GET/api/v1/invoices/:id/xml/peppolinvoice:executeDownload Peppol XML
GET/api/v1/invoices/:id/pdf/zugferdinvoice:executeDownload ZUGFeRD PDF
POST/api/v1/invoices/:id/regenerate-pdfinvoice:executeForce PDF regeneration
DELETE/api/v1/invoices/:idinvoice:deleteDelete draft invoice

Draft Invoice Tax Semantics

Draft invoice creation, draft invoice updates, recurring invoice generation, and transaction tax calculation all rely on the same backend tax engine and tax-rate timing rules.

  • Omit items[].taxRate to let the backend auto-calculate tax from the seller context, client billing country, client tax country fallback, item type, and the effective tax-rate schedule.
  • Provide items[].taxRate to apply an explicit manual override for that line item.
  • Use POST /api/v1/invoices/preview-tax before creating or updating a draft invoice when you need the exact canonical rate, totals, and taxRateCode the backend will use.

Example manual draft invoice payload with one automatic line and one explicit override:

{
  "siteId": "507f1f77bcf86cd799439011",
  "clientId": "507f1f77bcf86cd799439012",
  "currency": "EUR",
  "items": [
    {
      "description": "Subscription",
      "quantity": 1,
      "unitPrice": 12100,
      "amountType": "gross",
      "itemType": "virtual"
    },
    {
      "description": "Manual reduced VAT line",
      "quantity": 1,
      "unitPrice": 10700,
      "amountType": "gross",
      "taxRate": 7,
      "itemType": "physical"
    }
  ]
}

In the example above, the first line is auto-calculated and the second line uses an explicit 7% override.


Recurring Schedules

MethodPathRequired ScopeDescription
GET/api/v1/invoices/recurringinvoice:readList schedules
POST/api/v1/invoices/recurringinvoice:createCreate schedule
POST/api/v1/invoices/recurring/:id/pauseinvoice:executePause schedule
POST/api/v1/invoices/recurring/:id/resumeinvoice:executeResume schedule
POST/api/v1/invoices/recurring/:id/cancelinvoice:executeCancel schedule
POST/api/v1/invoices/recurring/:id/generateinvoice:executeManually generate next invoice
GET/api/v1/invoices/recurring/:id/upcominginvoice:executePreview upcoming invoices

Credit Notes

MethodPathRequired ScopeDescription
GET/api/v1/credit-notescredit_note:readList credit notes
GET/api/v1/credit-notes/:idcredit_note:readGet credit note
GET/api/v1/credit-notes/:id/pdfcredit_note:executeDownload PDF
POST/api/v1/credit-notes/:id/send-emailcredit_note:executeEmail credit note

Clients

MethodPathRequired ScopeDescription
GET/api/v1/clientsclient:readList clients
GET/api/v1/clients/searchclient:executeFull-text search
GET/api/v1/clients/:idclient:readGet client
POST/api/v1/clientsclient:createCreate client
PUT/api/v1/clients/:idclient:updateUpdate client
DELETE/api/v1/clients/:idclient:deleteDelete client
GET/api/v1/clients/:id/historyclient:executeGet client audit history

Sites

MethodPathRequired ScopeDescription
GET/api/v1/sitessite:readList sites
GET/api/v1/sites/:idsite:readGet site
POST/api/v1/sitessite:createCreate site
DELETE/api/v1/sites/:idsite:deleteDelete site
POST/api/v1/sites/:id/webhook-secret/regeneratesite:updateRotate outbound webhook secret

Organization Settings

Invoicing Settings

MethodPathRequired ScopeDescription
GET/api/v1/organizations/settings/invoicingorganization:readGet invoicing settings for the active organization
PUT/api/v1/organizations/settings/invoicingorganization:updateUpdate invoicing settings for the active organization

The numbering contract is layout-based. Organizations store one layout for invoices and one for credit notes.

{
  "enabled": true,
  "autoGenerateInvoice": false,
  "companyName": "Example GmbH",
  "companyAddress": {
    "street": "Example Street 1",
    "city": "Berlin",
    "postalCode": "10115",
    "country": "DE"
  },
  "companyEmail": "billing@example.com",
  "invoiceNumberLayout": {
    "prefix": "INV-",
    "periodType": "calendar",
    "periodGranularity": "year",
    "fiscalYearStartMonth": 1,
    "fiscalYearLabelMode": "end_year",
    "periodSeparator": "dash",
    "infix": "-",
    "sequenceDigits": 6,
    "suffix": "",
    "resetPolicy": "calendar_year",
    "startNumber": 1
  },
  "creditNoteNumberLayout": {
    "prefix": "CN-",
    "periodType": "calendar",
    "periodGranularity": "year",
    "fiscalYearStartMonth": 1,
    "fiscalYearLabelMode": "end_year",
    "periodSeparator": "dash",
    "infix": "-",
    "sequenceDigits": 6,
    "suffix": "",
    "resetPolicy": "calendar_year",
    "startNumber": 1
  }
}

Tax settings (organization)

MethodPathRequired ScopeDescription
GET/api/v1/organizations/settings/taxorganization:executeRead org tax configuration (OSS/IOSS flags, VIES, rounding, etc.)
PUT/api/v1/organizations/settings/taxorganization:executeUpdate org tax configuration (Admin permission; API keys need scope above)
GET/api/v1/organizations/settings/tax/oss-threshold-statusorganization:readEU B2C cross-border threshold vs OSS registration status

Notes:

  • periodType is one of none, calendar, or fiscal.
  • periodGranularity is one of year, year_month, or year_month_day.
  • periodSeparator is dash or none and only matters when month or day is visible.
  • resetPolicy is one of never, calendar_year, or fiscal_year.
  • Sites inherit these layouts and may override only invoicePrefix and creditNotePrefix in their site-level invoicing settings.

Providers

MethodPathRequired ScopeRequired RoleDescription
GET/api/v1/providersprovider:readViewerList providers
GET/api/v1/providers/:idprovider:readViewerGet provider
POST/api/v1/providersprovider:createAdminCreate provider
DELETE/api/v1/providers/:idprovider:deleteAdminDelete provider
POST/api/v1/providers/:id/toggleprovider:updateAdminEnable/disable provider

Domains

MethodPathRequired ScopeRequired RoleDescription
GET/api/v1/domainsdomain:readViewerList domains
POST/api/v1/domainsdomain:createAdminRegister custom domain
DELETE/api/v1/domains/:iddomain:deleteAdminRemove domain
GET/api/v1/domains/verify-cnamedomain:executeEditorVerify CNAME record

API Keys

MethodPathRequired ScopeDescription
GET/api/v1/organizations/{orgId}/api-keysapi_key:readList organization API keys
POST/api/v1/organizations/{orgId}/api-keysapi_key:createCreate organization API key
GET/api/v1/organizations/{orgId}/api-keys/{id}api_key:readGet organization API key details
PUT/api/v1/organizations/{orgId}/api-keys/{id}api_key:updateUpdate API key metadata / scopes
DELETE/api/v1/organizations/{orgId}/api-keys/{id}api_key:deleteDelete API key
POST/api/v1/organizations/{orgId}/api-keys/{id}/revokeapi_key:executeRevoke API key
POST/api/v1/organizations/{orgId}/api-keys/{id}/rotateapi_key:executeRotate API key (issues new secret)

Organization API keys are already bound to one organization, but the management endpoints remain nested under /organizations/{orgId}/api-keys for admin and automation workflows. System API keys use the /api/v1/system/api-keys family and are intended for global administrative automation rather than normal merchant checkout integrations.


Portal

MethodPathRequired ScopeDescription
POST/api/v1/organizations/settings/portal/magic-linksportal:createGenerate a one-time direct-login customer portal link
POST /api/v1/organizations/settings/portal/magic-links
Authorization: Bearer sk_live_keyid.secret
Content-Type: application/json
{
  "email": "buyer@example.com",
  "ttlMinutes": 15
}

Returns a one-time magic-link URL that can be used to direct the customer straight into the portal login flow for that email.

ttlMinutes is optional. If omitted, the system portal magic-link TTL is used. If provided, it can only shorten the lifetime; values above the system policy are capped to the configured system maximum.

Example server-side usage:

const response = await fetch(
  `${adminBaseUrl}/api/v1/organizations/settings/portal/magic-links`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${organizationApiKey}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      email: "buyer@example.com",
      ttlMinutes: 15,
    }),
  },
);

if (!response.ok) {
  throw new Error(`Failed to create portal magic link: ${response.status}`);
}

const { url, expiresAt, ttlMinutes } = await response.json();

return {
  loginUrl: url,
  expiresAt,
  effectiveTtlMinutes: ttlMinutes,
};

The endpoint only succeeds when:

  • system-level portal access is enabled,
  • system-level portal magic links are enabled,
  • the authenticated organization has portal access enabled, and
  • the email has at least one portal-visible invoice, credit note, or recurring subscription in that organization.

Use this for trusted backend automations only. Do not expose it to browser or mobile clients.


Tax Management

MethodPathRequired ScopeDescription
GET/api/v1/tax-rulestax_rule:readList tax rules
POST/api/v1/tax-rulestax_rule:createCreate tax rule
DELETE/api/v1/tax-rulestax_rule:deleteDelete all tax rules (destructive)
PUT/api/v1/tax-rules/:idtax_rule:updateUpdate tax rule
DELETE/api/v1/tax-rules/:idtax_rule:deleteDelete one tax rule
POST/api/v1/tax-rules/populate-defaultstax_rule:createLoad default EU/UK/US/CA rules
GET/api/v1/tax-ratestax_rate:readList tax rates
POST/api/v1/tax-ratestax_rate:createCreate tax rate
DELETE/api/v1/tax-ratestax_rate:deleteDelete all tax rates (destructive)
POST/api/v1/tax-rates/replace-defaultstax_rate:executeReplace rates with the current default catalog
GET/api/v1/tax-rates/:idtax_rate:readGet one tax rate
PUT/api/v1/tax-rates/:idtax_rate:updateUpdate tax rate
DELETE/api/v1/tax-rates/:idtax_rate:deleteDelete one tax rate

Admin JWT calls use the Admin role for these routes; API keys need the matching tax_rule:* / tax_rate:* scopes.

Tax Reports

Reports use query parameters for filters (e.g. startDate, endDate, timezone, source=transactions|invoices|both, currency, siteId). VAT OSS endpoints require year and quarter (1–4). Export endpoints return a file download and are GET, not POST.

MethodPathRequired ScopeDescription
GET/api/v1/tax/reports/by-countrytax_report:readTax summary grouped by buyer country
GET/api/v1/tax/reports/by-country/detailstax_report:readRow-level basis for one country in that report
GET/api/v1/tax/reports/by-country/exporttax_report:executeDownload country report as CSV
GET/api/v1/tax/reports/revenue-by-countrytax_report:readRevenue-style summary by country
GET/api/v1/tax/reports/revenue-by-country/exporttax_report:executeDownload revenue-by-country report as CSV
GET/api/v1/tax/reports/currenciestax_report:readCurrencies available for report filters
GET/api/v1/tax/reports/vat-osstax_report:readEU VAT OSS quarterly aggregation
GET/api/v1/tax/reports/vat-oss/detailstax_report:readOSS line basis (country, rate code, supply type)
GET/api/v1/tax/reports/vat-oss/exporttax_report:executeDownload OSS report as XML
GET/api/v1/tax/reports/vat-oss/export-elstertax_report:executeDownload OSS data as Elster CSV (Germany)

Tax records (canonical ledger)

Immutable tax records back admin reporting drill-downs and traceability. List filters include date range, sourceKind, taxCountry, recognitionMode (accrual / cash), pagination, and links to transactions or invoices.

MethodPathRequired ScopeDescription
GET/api/v1/tax/recordstax_record:readList tax records
GET/api/v1/tax/records/:idtax_record:readGet one tax record
GET/api/v1/transactions/:id/tax-recordstax_record:readTax records linked to a transaction
GET/api/v1/invoices/:id/tax-recordstax_record:readTax records linked to an invoice

Data Import / Export

MethodPathRequired ScopeDescription
POST/api/v1/data-import-export/importdata_io:executeImport CSV data
POST/api/v1/data-import-export/import/validatedata_io:executeValidate import file before committing
POST/api/v1/data-import-export/exportdata_io:executeExport entity data to CSV
GET/api/v1/data-import-export/template/:entityTypedata_io:readDownload import CSV template

Dashboard

GET /api/v1/dashboard

Returns aggregated metrics: gross volume, net revenue, transaction counts, failure ratios, top providers, and recent transactions. Used by the Admin Panel home page.


API Key Scopes Reference

ScopeGrants
checkout:readRead checkouts
checkout:createCreate checkout URLs
checkout:updateUpdate checkout metadata
transaction:readRead transactions and tax details
transaction:createCreate manual transactions
transaction:updateUpdate transaction metadata
transaction:deleteDelete transactions
transaction:executeChargeback management
invoice:readRead invoices and recurring schedules
invoice:createCreate invoices and schedules
invoice:updateUpdate draft invoices, notes, invoice links, and correction workflows
invoice:executePreview tax, issue, void, email, payment checkout, PDF download, and recurring schedule actions
invoice:deleteDelete draft invoices
credit_note:readRead credit notes
credit_note:executeDownload credit note PDFs and send credit note email
client:readRead clients
client:createCreate clients
client:updateUpdate clients
client:deleteDelete clients
client:executeSearch clients, view history
site:readRead sites
site:createCreate sites
site:deleteDelete sites
site:updateUpdate sites, rotate webhook secret
provider:readRead providers
provider:createCreate providers (Admin role also required)
provider:updateEnable/disable providers (Admin role)
provider:deleteDelete providers (Admin role)
domain:readRead domains
domain:createCreate domains (Admin role)
domain:deleteDelete domains (Admin role)
domain:executeVerify CNAME, Apple Pay files
api_key:readRead API keys
api_key:createCreate API keys
api_key:updateUpdate API key metadata, scopes, or whitelist
api_key:deleteDelete API keys
api_key:executeRotate or revoke API keys
organization:readRead organization details
organization:updateUpdate organization settings
organization:executeAccess settings, encryption operations
tax_rule:readRead tax rules
tax_rule:createCreate tax rules and populate default rule sets
tax_rule:updateUpdate tax rules
tax_rule:deleteDelete tax rules
tax_rate:readRead tax rates
tax_rate:createCreate tax rates
tax_rate:updateUpdate tax rates
tax_rate:deleteDelete tax rates
tax_rate:executeReplace default tax rates (replace-defaults)
tax_report:readRead tax reports
tax_report:executeExport tax reports (CSV/XML/Elster)
tax_record:readRead canonical tax ledger records
data_io:readRead import/export templates
data_io:executeImport and export data
export:executeGenerate CSV exports
portal:createGenerate direct-login customer portal magic links
vies:readCheck EU countries
vies:executeValidate VAT IDs
userprofile:readRead own user profile
userprofile:updateUpdate passkey labels, notification prefs
userprofile:executeManage passkeys and related user profile actions

Common least-privilege bundles

  • Checkout creation: checkout:create
  • Website billing bridge auto-provisioning: client:read, client:create, invoice:read, invoice:create
  • Recurring schedule management: invoice:read, invoice:create, invoice:execute

Recurring schedules do not use a separate recurring:* scope family. They are governed by the invoice:* scope family.

On this page