AlmondTill/G3N API

On this page

issueFiscalReceipt

mutation · in the family Privacy and compliance

What it does

Issue the fiscal receipt for a completed order or an issued invoice under a market’s fiscal scheme — the certified provider signs or clears it and the gap-free number is assigned.

Issue the fiscal compliance artifact for an Order/Invoice: the regime roster gate → the STRICT parent gate (an Order rests at completed — model A signs at/after completion; an Invoice at issued/closed, voided refuses) → the certified FiscalizationPort (an UNCONFIGURED regime refuses FISCAL/REGIME_UNCONFIGURED — partners + per-country certs are build-time; a denial is FISCAL/CLEARANCE_FAILED, a timeout FISCAL/CLEARANCE_TIMEOUT [retry-safe: nothing issued]) → ONE transaction: the receipt + the gap-free series counter + the one-per-(document × regime) marker (a duplicate refuses CONFLICT/IDENTITY_TAKEN — gap-free journals never re-issue; the marker never releases). Requires the unrestricted capability.

What happens

One receipt per document per scheme, forever — a re-issue is refused (gap-free journals never repeat). Until a certified provider is set up for the scheme, issuing refuses and names it.

Who may call it

Capability area: Privacy and compliance — Tax and fiscal configuration, certificates and privacy requests.

Arguments

NameTypeRequiredNotes
inputIssueFiscalReceiptInput IssueFiscalReceiptInput!yesNo further notes.

Returns

FiscalReceipt FiscalReceipt! — A FiscalReceipt: the gap-free sequential fiscal number + the regime's signature (model A) or clearance authorization code (model B) + the QR payload the printed receipt renders. IMMUTABLE once issued — no edit, no transitions, no doom (the ⚑none artifact class; status is the one literal 'issued' forever). Certified partners produce the artifact fields — the caller never supplies them.

Example request

mutation ExampleIssueFiscalReceipt($input: IssueFiscalReceiptInput!) {
  issueFiscalReceipt(input: $input) {
    id
    sysId
    type
    caption
    status
    parentId
    rootId
    createdAt
    updatedAt
    revisionNum
    revision
    parentKind
    regime
    logicalFacilityId
    seriesKey
    seq
    signature
    authorizationCode
    qrPayload
    partnerRef
  }
}

Variables:

{
  "input": {
    "parentKind": "<parent kind>",
    "parentId": "01900000-0000-7000-8000-065235280000",
    "regime": "<regime>"
  }
}

Send it with the envelope naming the version: "extensions": {"at": {"version": {"name":"genesis","number":0}}}.

Example response

{
  "data": {
    "issueFiscalReceipt": {
      "id": "01900000-0000-7000-8000-37386ae00000",
      "sysId": "FR-EXMP-0000-000F",
      "type": "FiscalReceipt",
      "caption": "Blue jeans",
      "status": "<status>",
      "parentId": "01900000-0000-7000-8000-065235280000",
      "rootId": "01900000-0000-7000-8000-a093dd800000",
      "createdAt": "2027-01-31T00:00:00.000Z",
      "updatedAt": "2027-01-31T00:00:00.000Z",
      "revisionNum": 1,
      "revision": "01900000-0000-7000-8000-b7960e180000",
      "parentKind": "<parent kind>",
      "regime": "<regime>",
      "logicalFacilityId": "01900000-0000-7000-8000-8026f71c0000",
      "seriesKey": "<series key>",
      "seq": 1,
      "signature": "<signature>",
      "authorizationCode": "BJ-001",
      "qrPayload": "<qr payload>",
      "partnerRef": "<partner ref>"
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": {
          "name": "genesis",
          "number": 0
        },
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}

Errors this call can answer

Used in