Skip to content
Sign in Create account

POST receipts/countersign

POST /api/v1/receipts/countersign

POST /api/v1/receipts/countersign. Accepts a desktop_receipt with device pairing fields, or a self-contained v3 receipt envelope; returns a gateway-countersigned envelope.

Authenticate with an API key or a portal session token.

Request body

application/json any

One of

  • object
    • desktop_receipt object required
      • signature string required
      • signed_fields object required

        JSON object describing the desktop receipt fields covered by its signature. The gateway checks that security-relevant receipt fields are included; other field names and values are not schema-validated.

        Any keys are accepted.

    • device_id string (uuid) required
    • gateway_claims object

      Optional JSON object. The endpoint reads request_id, provider, model, input_tokens, and output_tokens when those values have the expected scalar types; other fields are passed through without schema validation.

      Any keys are accepted.

    • hash_upstream_response string required
      Pattern: ^[a-f0-9]{64}$
  • object
    • claims object required

      JSON object from the OpenReceipt v3 envelope. The endpoint reads tokenization.tier and selected provider, model, tokens_in, and tokens_out values; other claim fields are retained as receipt payload.

      Any keys are accepted.

    • sig string required
    • v integer required

Generated sample

{
  "desktop_receipt": {
    "signature": "string",
    "signed_fields": {}
  },
  "device_id": "00000000-0000-4000-8000-000000000000",
  "gateway_claims": {},
  "hash_upstream_response": "string"
}

Responses

200 Successful response.

application/json ReceiptsCountersignResponse

Generated sample

{
  "receipt": {
    "alg": "ecdsa-p256-sha256",
    "chain": {
      "chain_id": "string",
      "prev_hash": "string",
      "seq": 0
    },
    "claims": {
      "egress_attestation": {
        "attester": "desktop",
        "attester_build_hash": "string",
        "zero_payload_proof": {}
      },
      "routing_decision": {
        "model": "string",
        "provider_id": "string",
        "provider_region": "string",
        "reason": "user-selected"
      },
      "tokenisation": {
        "detectors": [
          {
            "count": 0,
            "fingerprint_hmac": "string",
            "id": "string",
            "version": "string"
          }
        ],
        "input_hash": "string",
        "level": "tokenise-reversible",
        "output_hash": "string",
        "tokeniser_binary_hash": "string"
      },
      "x-cloakapi-detection": {
        "basis": "client_declared",
        "coverage": "rules_only",
        "engine_identity": "not_declared"
      }
    },
    "exp": 0,
    "iat": 0,
    "iss": "https://example.com",
    "jti": "string",
    "kid": "string",
    "nbf": 0,
    "sig": "string",
    "sub": "string",
    "v": "v1"
  }
}
401 Error response.

application/json GenericError

  • error any

    One of

    • string
    • object

      Any keys are accepted.

  • error_code string
  • code string
  • message string
  • detail string
  • status any

    One of

    • string
    • integer
  • errors object

    Any keys are accepted.

403 Error response.

application/json GenericError

  • error any

    One of

    • string
    • object

      Any keys are accepted.

  • error_code string
  • code string
  • message string
  • detail string
  • status any

    One of

    • string
    • integer
  • errors object

    Any keys are accepted.

413 Error response.

application/json GenericError

  • error any

    One of

    • string
    • object

      Any keys are accepted.

  • error_code string
  • code string
  • message string
  • detail string
  • status any

    One of

    • string
    • integer
  • errors object

    Any keys are accepted.

415 Error response.

application/json GenericError

  • error any

    One of

    • string
    • object

      Any keys are accepted.

  • error_code string
  • code string
  • message string
  • detail string
  • status any

    One of

    • string
    • integer
  • errors object

    Any keys are accepted.

422 The request failed validation.

application/json ReceiptsCountersignError

  • details array of string
  • error string required
  • message string
  • ref string
429 The route throttle limit was exceeded.

application/json GenericError

  • error any

    One of

    • string
    • object

      Any keys are accepted.

  • error_code string
  • code string
  • message string
  • detail string
  • status any

    One of

    • string
    • integer
  • errors object

    Any keys are accepted.

text/html string