{
  "info": {
    "name": "BrainArk RWA API",
    "_postman_id": "brainark-rwa-api-v1",
    "description": "BrainArk Real-World Asset API — chain 1236, BAK native coin.\n\nSet the `base_url` variable to `https://rwa.brainark.online` and `api_key` to your enterprise API key.\n\n**Auth**: All /api/v1/* endpoints (except /status) require header `X-API-Key: {{api_key}}`.",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "variable": [
    { "key": "base_url", "value": "https://rwa.brainark.online", "type": "string" },
    { "key": "api_key",  "value": "YOUR_API_KEY_HERE",           "type": "string" }
  ],
  "item": [
    {
      "name": "Status",
      "item": [
        {
          "name": "Health Check",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/api/v1/status",
              "host": ["{{base_url}}"],
              "path": ["api", "v1", "status"]
            },
            "description": "Returns chain status and contract addresses. No auth required."
          }
        }
      ]
    },
    {
      "name": "Assets",
      "item": [
        {
          "name": "List Assets by Owner",
          "request": {
            "method": "GET",
            "header": [{ "key": "X-API-Key", "value": "{{api_key}}" }],
            "url": {
              "raw": "{{base_url}}/api/v1/assets?owner=0x0000000000000000000000000000000000000000",
              "host": ["{{base_url}}"],
              "path": ["api", "v1", "assets"],
              "query": [{ "key": "owner", "value": "0x0000000000000000000000000000000000000000", "description": "Ethereum address" }]
            },
            "description": "Returns all assets owned by the specified address.\n\nResponse: `{ assets: Asset[], total: number }`"
          }
        },
        {
          "name": "Get Single Asset",
          "request": {
            "method": "GET",
            "header": [{ "key": "X-API-Key", "value": "{{api_key}}" }],
            "url": {
              "raw": "{{base_url}}/api/v1/assets/1",
              "host": ["{{base_url}}"],
              "path": ["api", "v1", "assets", "1"]
            },
            "description": "Get full asset detail by token ID.\n\nAsset fields: `id, assetType, stakedBAK (wei), issuer, currentOwner, issuedAt, lastTransferAt, isActive, isUnstaked, assetHash, metadata`"
          }
        },
        {
          "name": "NFT Metadata (OpenSea-compatible)",
          "request": {
            "method": "GET",
            "header": [{ "key": "X-API-Key", "value": "{{api_key}}" }],
            "url": {
              "raw": "{{base_url}}/api/v1/nft/1",
              "host": ["{{base_url}}"],
              "path": ["api", "v1", "nft", "1"]
            },
            "description": "Returns ERC-721 metadata JSON (name, description, image, attributes) compatible with OpenSea."
          }
        }
      ]
    },
    {
      "name": "Marketplace",
      "item": [
        {
          "name": "Get Active Listings",
          "request": {
            "method": "GET",
            "header": [{ "key": "X-API-Key", "value": "{{api_key}}" }],
            "url": {
              "raw": "{{base_url}}/api/v1/marketplace",
              "host": ["{{base_url}}"],
              "path": ["api", "v1", "marketplace"]
            },
            "description": "Returns all active marketplace listings.\n\nListing fields: `id, assetId, seller, priceInBAK (wei), priceInNative, startTime, endTime, active`"
          }
        },
        {
          "name": "Get Single Listing",
          "request": {
            "method": "GET",
            "header": [{ "key": "X-API-Key", "value": "{{api_key}}" }],
            "url": {
              "raw": "{{base_url}}/api/v1/marketplace/1",
              "host": ["{{base_url}}"],
              "path": ["api", "v1", "marketplace", "1"]
            }
          }
        }
      ]
    },
    {
      "name": "Market Data",
      "item": [
        {
          "name": "BAK/USD Price",
          "request": {
            "method": "GET",
            "header": [{ "key": "X-API-Key", "value": "{{api_key}}" }],
            "url": {
              "raw": "{{base_url}}/api/v1/bak-price",
              "host": ["{{base_url}}"],
              "path": ["api", "v1", "bak-price"]
            },
            "description": "Returns current BAK/USD price from PancakeSwap V3. Cached 60s.\n\nResponse: `{ price: 0.012, currency: 'USD', source: 'PancakeSwap V3', cached: bool, ts: ms }`"
          }
        }
      ]
    },
    {
      "name": "Write — Assets",
      "item": [
        {
          "name": "Issue Asset",
          "request": {
            "method": "POST",
            "header": [
              { "key": "X-API-Key",     "value": "{{api_key}}" },
              { "key": "Content-Type",  "value": "application/json" }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"assetType\": \"Retail Product\",\n  \"name\": \"Gold Ring #42\",\n  \"description\": \"18K gold ring, 5g, hallmark verified\",\n  \"image\": \"https://ipfs.io/ipfs/QmExample...\",\n  \"stakedAmount\": \"1.0\",\n  \"recipientAddress\": \"0x0000000000000000000000000000000000000000\"\n}",
              "options": { "raw": { "language": "json" } }
            },
            "url": {
              "raw": "{{base_url}}/api/v1/write/issue-asset",
              "host": ["{{base_url}}"],
              "path": ["api", "v1", "write", "issue-asset"]
            },
            "description": "Mints a new RWA NFT on BrainArk chain.\n\n**Required**: `assetType`, `name`\n**Optional**: `description`, `image`, `externalUrl`, `ipfsHash`, `stakedAmount` (default 0.1 BAK), `recipientAddress`, `metadata` (object → encoded as externalUrl)\n\n**Response**: `{ success, tokenId, txHash, assetType, name, owner, stakedBAK, walletAddress, org, issuedAt, explorerUrl }`"
          }
        },
        {
          "name": "Batch Issue Assets",
          "request": {
            "method": "POST",
            "header": [
              { "key": "X-API-Key",     "value": "{{api_key}}" },
              { "key": "Content-Type",  "value": "application/json" }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"assets\": [\n    {\n      \"assetType\": \"Gift Voucher\",\n      \"name\": \"$50 Coffee Voucher\",\n      \"stakedAmount\": \"0.5\",\n      \"recipientAddress\": \"0x0000000000000000000000000000000000000001\"\n    },\n    {\n      \"assetType\": \"Event Ticket\",\n      \"name\": \"VIP Concert Pass\",\n      \"stakedAmount\": \"2.0\"\n    }\n  ]\n}",
              "options": { "raw": { "language": "json" } }
            },
            "url": {
              "raw": "{{base_url}}/api/v1/write/batch-issue",
              "host": ["{{base_url}}"],
              "path": ["api", "v1", "write", "batch-issue"]
            },
            "description": "Issues up to 50 assets in one request. Partial success is possible — check each result's `success` flag.\n\n**Response**: `{ success, issued, failed, total, org, results: [{ index, success, tokenId, txHash, name, assetType, owner, stakedBAK, error? }] }`"
          }
        },
        {
          "name": "Transfer Asset",
          "request": {
            "method": "POST",
            "header": [
              { "key": "X-API-Key",     "value": "{{api_key}}" },
              { "key": "Content-Type",  "value": "application/json" }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"tokenId\": \"42\",\n  \"to\": \"0x0000000000000000000000000000000000000001\"\n}",
              "options": { "raw": { "language": "json" } }
            },
            "url": {
              "raw": "{{base_url}}/api/v1/write/transfer",
              "host": ["{{base_url}}"],
              "path": ["api", "v1", "write", "transfer"]
            },
            "description": "Transfers an NFT. Enterprise wallet must own the token (or be approved).\n\n**Required**: `tokenId`, `to`\n**Optional**: `from` (defaults to enterprise wallet)\n\n**Response**: `{ success, tokenId, from, to, txHash, org, explorerUrl }`"
          }
        },
        {
          "name": "Register Asset Type",
          "request": {
            "method": "POST",
            "header": [
              { "key": "X-API-Key",     "value": "{{api_key}}" },
              { "key": "Content-Type",  "value": "application/json" }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"typeName\": \"Vintage Watch\",\n  \"description\": \"Certified pre-owned luxury watches\",\n  \"schema\": {\n    \"required\": [\"brand\", \"model\", \"year\"],\n    \"properties\": {\n      \"brand\": { \"type\": \"string\" },\n      \"model\": { \"type\": \"string\" },\n      \"year\":  { \"type\": \"integer\" }\n    }\n  }\n}",
              "options": { "raw": { "language": "json" } }
            },
            "url": {
              "raw": "{{base_url}}/api/v1/write/register-asset-type",
              "host": ["{{base_url}}"],
              "path": ["api", "v1", "write", "register-asset-type"]
            },
            "description": "Registers a custom asset type on-chain via the AssetTypeRegistrar contract. Costs 1 BAK.\n\n**Required**: `typeName`\n**Optional**: `description`, `schema` (JSON Schema for metadata validation)\n\n**Response**: `{ success, typeName, schema, description, org, txHash, note }`"
          }
        }
      ]
    },
    {
      "name": "Write — Marketplace",
      "item": [
        {
          "name": "List Asset for Sale",
          "request": {
            "method": "POST",
            "header": [
              { "key": "X-API-Key",     "value": "{{api_key}}" },
              { "key": "Content-Type",  "value": "application/json" }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"tokenId\": \"42\",\n  \"priceBAK\": \"100\",\n  \"durationDays\": \"30\"\n}",
              "options": { "raw": { "language": "json" } }
            },
            "url": {
              "raw": "{{base_url}}/api/v1/write/marketplace/list",
              "host": ["{{base_url}}"],
              "path": ["api", "v1", "write", "marketplace", "list"]
            },
            "description": "Creates a marketplace listing. Enterprise wallet must own the token.\n\n**Required**: `tokenId`, `priceBAK` (decimal, e.g. \"100\")\n**Optional**: `durationDays` (default 30)\n\n**Response**: `{ success, listingId, tokenId, priceBAK, durationDays, org, txHash, explorerUrl }`"
          }
        },
        {
          "name": "Buy Asset",
          "request": {
            "method": "POST",
            "header": [
              { "key": "X-API-Key",     "value": "{{api_key}}" },
              { "key": "Content-Type",  "value": "application/json" }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"listingId\": \"1\",\n  \"maxPriceBAK\": \"110\"\n}",
              "options": { "raw": { "language": "json" } }
            },
            "url": {
              "raw": "{{base_url}}/api/v1/write/marketplace/buy",
              "host": ["{{base_url}}"],
              "path": ["api", "v1", "write", "marketplace", "buy"]
            },
            "description": "Purchases a listing. Enterprise wallet must have enough BAK.\n\n**Required**: `listingId`\n**Optional**: `maxPriceBAK` — slippage guard, rejects if current price exceeds this\n\n**Response**: `{ success, listingId, paidBAK, buyer, org, txHash, explorerUrl }`"
          }
        },
        {
          "name": "Cancel Listing (Delist)",
          "request": {
            "method": "POST",
            "header": [
              { "key": "X-API-Key",     "value": "{{api_key}}" },
              { "key": "Content-Type",  "value": "application/json" }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"listingId\": \"1\"\n}",
              "options": { "raw": { "language": "json" } }
            },
            "url": {
              "raw": "{{base_url}}/api/v1/write/marketplace/delist",
              "host": ["{{base_url}}"],
              "path": ["api", "v1", "write", "marketplace", "delist"]
            },
            "description": "Cancels an active listing. Enterprise wallet must be the listing seller.\n\n**Required**: `listingId`\n\n**Response**: `{ success, org, txHash, explorerUrl }`"
          }
        }
      ]
    },
    {
      "name": "Analytics",
      "item": [
        {
          "name": "Issuer Analytics",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/api/analytics/issuer?address=0x0000000000000000000000000000000000000000",
              "host": ["{{base_url}}"],
              "path": ["api", "analytics", "issuer"],
              "query": [{ "key": "address", "value": "0x0000000000000000000000000000000000000000" }]
            },
            "description": "Returns analytics for a given issuer: total assets, BAK staked, claim campaigns, yield distributions, marketplace listings, and asset type breakdown. No auth required.\n\nTry with a real issuer address to see live data."
          }
        }
      ]
    }
  ]
}
