web/docs/api/examples/marketplace.examples.md

2.6 KiB

Marketplace API Examples (v1)

GET /marketplace/offers

Success (200):

{
  "offers": [
    {
      "offer_id": "edut.crm.pro.annual",
      "issuer_id": "edut.firstparty",
      "title": "EDUT CRM Pro",
      "summary": "Workspace-bound CRM module.",
      "status": "active",
      "pricing": {
        "currency": "USDC",
        "amount_atomic": "199000000",
        "decimals": 6,
        "chain_id": 8453
      },
      "policies": {
        "member_only": true,
        "workspace_bound": true,
        "transferable": false
      }
    }
  ]
}

POST /marketplace/checkout/quote

Request:

{
  "wallet": "0x3ea6cbf98d23e2cf7b6f4f9bb1fb4f50b710f2d5",
  "offer_id": "edut.crm.pro.annual",
  "workspace_id": "workspace.work.acme"
}

Success (200):

{
  "quote_id": "cq_01HZZXFQ27ZP6MP0V2R9M6V3KX",
  "wallet": "0x3ea6cbf98d23e2cf7b6f4f9bb1fb4f50b710f2d5",
  "offer_id": "edut.crm.pro.annual",
  "currency": "USDC",
  "amount": "199.00",
  "amount_atomic": "199000000",
  "decimals": 6,
  "policy_hash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "expires_at": "2026-02-17T07:44:30Z",
  "tx": {
    "to": "0x2222222222222222222222222222222222222222",
    "data": "0xdeadbeef",
    "value": "0x0"
  }
}

Error (403):

{
  "error": "membership_required",
  "message": "Active membership is required for checkout."
}

POST /marketplace/checkout/confirm

Request:

{
  "quote_id": "cq_01HZZXFQ27ZP6MP0V2R9M6V3KX",
  "wallet": "0x3ea6cbf98d23e2cf7b6f4f9bb1fb4f50b710f2d5",
  "offer_id": "edut.crm.pro.annual",
  "tx_hash": "0xbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
  "chain_id": 8453
}

Success (200):

{
  "status": "entitlement_active",
  "entitlement_id": "ent:8453:0x3ea6cbf98d23e2cf7b6f4f9bb1fb4f50b710f2d5:000001",
  "offer_id": "edut.crm.pro.annual",
  "wallet": "0x3ea6cbf98d23e2cf7b6f4f9bb1fb4f50b710f2d5",
  "tx_hash": "0xbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
  "policy_hash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "activated_at": "2026-02-17T07:46:02Z"
}

GET /marketplace/entitlements?wallet=...

Success (200):

{
  "entitlements": [
    {
      "entitlement_id": "ent:8453:0x3ea6cbf98d23e2cf7b6f4f9bb1fb4f50b710f2d5:000001",
      "offer_id": "edut.crm.pro.annual",
      "wallet_address": "0x3ea6cbf98d23e2cf7b6f4f9bb1fb4f50b710f2d5",
      "workspace_id": "workspace.work.acme",
      "state": "active",
      "policy_hash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
      "issued_at": "2026-02-17T07:46:02Z"
    }
  ]
}