{
  "info": {
    "name": "Hive R3Pv — Receipt Relay, Recovery & Routing Proof Vectors",
    "description": "Runnable collection for the R3Pv primitive. Every request hits a real, live Hive endpoint (verified 2026-07-06). R3Pv is now a LIVE callable primitive: POST /v1/r3pv/groups teams signed receipts and GET /v1/r3pv/vector generates an Ed25519-signed proof vector (verification_depth, weakest_proof_boundary, healing_state/recoverability_window, economic_exposure, policy_state, routing_recommendation, permitted_next_actions) under did:hive:hivemorph. The signed vector round-trips POST /v1/receipt/verify like any receipt. Free self-attested tier is 30 events/IP/hour. No funds move in these calls, and this service never calls Circle APIs.",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "variable": [
    { "key": "baseUrl", "value": "https://receipts.thehiveryiq.com", "type": "string" }
  ],
  "item": [
    {
      "name": "1 · R3Pv health / smoke (primitive up?)",
      "request": {
        "method": "GET",
        "header": [],
        "url": { "raw": "{{baseUrl}}/v1/r3pv/health", "host": ["{{baseUrl}}"], "path": ["v1", "r3pv", "health"] },
        "description": "GET the R3Pv health. Expect HTTP 200: engine r3pv, schema r3pv-v1.0.0, signer did:hive:hivemorph (Ed25519), 11 healing states, and the vector dimensions."
      }
    },
    {
      "name": "2 · Sign a receipt — stablecoin transfer (no funds move)",
      "event": [
        {
          "listen": "test",
          "script": {
            "type": "text/javascript",
            "exec": [
              "// stash the signed receipt object so requests 4 & 5 can group + verify it",
              "var body = pm.response.json();",
              "if (body && body.receipt) {",
              "  pm.collectionVariables.set('lastReceipt', JSON.stringify(body.receipt));",
              "}",
              "pm.test('signed receipt returned', function () {",
              "  pm.expect(pm.response.code).to.eql(200);",
              "});"
            ]
          }
        }
      ],
      "request": {
        "method": "POST",
        "header": [ { "key": "Content-Type", "value": "application/json" } ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"action\": \"stablecoin_transfer\",\n  \"external_system\": \"circle\",\n  \"actor\": { \"did\": \"did:example:agent\" },\n  \"payload\": {\n    \"asset\": \"USDC\",\n    \"amount\": \"25.00\",\n    \"from\": \"0xSender\",\n    \"to\": \"0xRecipient\",\n    \"network\": \"base\",\n    \"net_moved\": \"0.00\"\n  },\n  \"healing_state\": \"pre_broadcast_stoppable\"\n}"
        },
        "url": { "raw": "{{baseUrl}}/v1/receipt-relay/event", "host": ["{{baseUrl}}"], "path": ["v1", "receipt-relay", "event"] },
        "description": "Self-attested signed receipt over a described stablecoin transfer. NEVER calls Circle APIs — the receipt attests only that these exact bytes were received and signed. The optional healing_state declares the recovery window; the vector in request 5 honors it. Returns receipt.receipt_id, payload_sha256, sig_b64u, key_id=did:hive:hivemorph, algorithm=Ed25519, and verification.ok=true."
      }
    },
    {
      "name": "3 · Sign a receipt — agentic API call (x402 shape)",
      "request": {
        "method": "POST",
        "header": [ { "key": "Content-Type", "value": "application/json" } ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"action\": \"api_call\",\n  \"external_system\": \"postman\",\n  \"actor\": { \"did\": \"did:example:postman-agent\" },\n  \"payload\": {\n    \"method\": \"POST\",\n    \"url\": \"https://api.example.com/pay\",\n    \"x402\": true\n  }\n}"
        },
        "url": { "raw": "{{baseUrl}}/v1/receipt-relay/event", "host": ["{{baseUrl}}"], "path": ["v1", "receipt-relay", "event"] },
        "description": "Receipt an agentic API execution. Any action name is accepted; the receipt records intent, actor, and payload hashes at the self_attested tier."
      }
    },
    {
      "name": "4 · Create a receipt group (LIVE — POST /v1/r3pv/groups)",
      "event": [
        {
          "listen": "prerequest",
          "script": {
            "type": "text/javascript",
            "exec": [
              "// wrap the receipt captured by request 2 into a group body",
              "var r = pm.collectionVariables.get('lastReceipt');",
              "if (r) { pm.variables.set('groupBody', '{\"label\":\"agentic-payment-flow\",\"receipts\":[' + r + ']}'); }",
              "else { pm.variables.set('groupBody', '{\"label\":\"agentic-payment-flow\",\"receipt_ids\":[\"run request 2 first\"]}'); }"
            ]
          }
        },
        {
          "listen": "test",
          "script": {
            "type": "text/javascript",
            "exec": [
              "var body = pm.response.json();",
              "if (body && body.group_id) { pm.collectionVariables.set('groupId', body.group_id); }",
              "pm.test('group created', function () { pm.expect(pm.response.code).to.eql(200); });"
            ]
          }
        }
      ],
      "request": {
        "method": "POST",
        "header": [ { "key": "Content-Type", "value": "application/json" } ],
        "body": { "mode": "raw", "raw": "{{groupBody}}" },
        "url": { "raw": "{{baseUrl}}/v1/r3pv/groups", "host": ["{{baseUrl}}"], "path": ["v1", "r3pv", "groups"] },
        "description": "Team signed receipts into a group. Accepts inline receipt objects and/or bare receipt_ids, optional graph edges and metadata. Returns group_id, receipt_count, resolved_receipts, unresolved_receipts. Free up to 30/IP/hour, then X-Hive-Activation-Key or X-Hive-Access."
      }
    },
    {
      "name": "5 · Generate the signed proof vector (LIVE — GET /v1/r3pv/vector)",
      "event": [
        {
          "listen": "test",
          "script": {
            "type": "text/javascript",
            "exec": [
              "// capture the signed vector so request 6 can verify it",
              "var body = pm.response.json();",
              "if (body && body.signed_vector) {",
              "  var v = body.signed_vector;",
              "  pm.collectionVariables.set('vectorVerifyBody', JSON.stringify({ receipt_id: v.vector_id, payload_sha256: v.payload_sha256, sig_b64u: v.sig_b64u, ts: v.ts }));",
              "}",
              "pm.test('signed vector returned', function () {",
              "  pm.expect(pm.response.code).to.eql(200);",
              "  pm.expect(body.verification.ok).to.eql(true);",
              "});"
            ]
          }
        }
      ],
      "request": {
        "method": "GET",
        "header": [],
        "url": { "raw": "{{baseUrl}}/v1/r3pv/vector?group_id={{groupId}}", "host": ["{{baseUrl}}"], "path": ["v1", "r3pv", "vector"], "query": [ { "key": "group_id", "value": "{{groupId}}" } ] },
        "description": "Compute and Ed25519-sign the proof vector for the group from request 4. Returns signed_vector { vector_id, payload_sha256, sig_b64u, key_id=did:hive:hivemorph, algorithm=Ed25519, vector { verification_depth, weakest_proof_boundary, healing_state, recoverability_window, economic_exposure, policy_state, routing_recommendation, permitted_next_actions } } and verification.ok=true. POST /v1/r3pv/vector does group + vector in one call."
      }
    },
    {
      "name": "6 · Verify the vector itself (proof vector is verifiable)",
      "event": [
        {
          "listen": "prerequest",
          "script": {
            "type": "text/javascript",
            "exec": [
              "var b = pm.collectionVariables.get('vectorVerifyBody');",
              "if (b) { pm.variables.set('verifyBody', b); }"
            ]
          }
        }
      ],
      "request": {
        "method": "POST",
        "header": [ { "key": "Content-Type", "value": "application/json" } ],
        "body": { "mode": "raw", "raw": "{{verifyBody}}" },
        "url": { "raw": "{{baseUrl}}/v1/receipt/verify", "host": ["{{baseUrl}}"], "path": ["v1", "receipt", "verify"] },
        "description": "POST the signed vector's verifier fields (from request 5) back to the public verifier. Returns verified=true, proof_status=signature-verified — proving the R3Pv proof vector is itself a first-class verifiable object, not just JSON. If {{verifyBody}} is empty, run request 5 first."
      }
    }
  ]
}
