Skip to main content

What It Does

The Minting API provides preflight validation to determine whether a product batch is eligible for passport minting. The preflight check evaluates all prerequisites — schema completeness, commercial status, and batch readiness — before a mint job can proceed.

Authentication & Permissions

All RPCs require an authenticated session. Minting operations require a role with sufficient permissions for the target brand (typically admin or owner).

RPCs

preflight_mint_batch

Runs a preflight check against a product and batch to determine minting eligibility. Request
{
  "_brand_id": "uuid",
  "_product_id": "uuid",
  "_batch_id": "uuid",
  "_requested_quantity": 100,
  "_idempotency_key": "optional-string"
}
Response (pass)
{
  "id": "uuid",
  "status": "preflight_pass",
  "preflight_result": "pass",
  "blocking_reasons": [],
  "scope_type": "serial",
  "requested_quantity": 100,
  "created_at": "2026-01-15T12:00:00Z"
}
Response (blocked)
{
  "id": "uuid",
  "status": "preflight_blocked",
  "preflight_result": "blocked",
  "blocking_reasons": [
    "Missing required field: carbon_footprint_total",
    "Commercial status is not active"
  ],
  "scope_type": "serial",
  "requested_quantity": 100,
  "created_at": "2026-01-15T12:00:00Z"
}
Errors
  • Not authenticated — request has no valid JWT.
  • Forbidden — caller does not have sufficient access.
  • Invalid input — request is malformed or cannot be processed.
Notes
  • _requested_quantity and _idempotency_key are optional.
  • Preflight checks are deterministic and can be re-run at any time.
  • Idempotency is supported: submitting the same key twice returns the existing job.
  • Scope types include sku, batch, and serial — determined by the brand’s minting configuration.