PurchaseIntent Links

Download the complete public OpenAPI schema

POST /v1/purchase_intents/{purchase_intent_id}/approval_widget

Open a purchase approval widget

Create a one-hour, approval-only hosted session. The buyer must explicitly approve on the secure page.

Parameters, request, responses, and security

{
  "tags": [
    "purchase-intent-links"
  ],
  "summary": "Open a purchase approval widget",
  "description": "Create a one-hour, approval-only hosted session. The buyer must explicitly approve on the secure page.",
  "operationId": "v1_create_purchase_approval_widget",
  "parameters": [
    {
      "required": true,
      "schema": {
        "type": "string",
        "title": "Purchase Intent Id"
      },
      "name": "purchase_intent_id",
      "in": "path"
    }
  ],
  "responses": {
    "200": {
      "description": "Successful Response",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/PaymentWidgetSession"
          }
        }
      }
    },
    "422": {
      "description": "Validation Error",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/HTTPValidationError"
          }
        }
      }
    }
  },
  "security": [
    {
      "ApiKeyBearer": []
    }
  ],
  "x-api-audience": "public_v1",
  "x-api-authentication": "required",
  "x-operation-id": "v1_create_purchase_approval_widget",
  "x-mcp-exposed": true,
  "x-public-path": "/v1/purchase_intents/{purchase_intent_id}/approval_widget",
  "x-auth-access": {
    "policy": "account_api_user",
    "enforcement": "dependency",
    "group": "app.schemas.purchasing.api.internal.purchase_intent_links_routes",
    "mode": "required",
    "allows_anonymous": false,
    "invalid_credentials": "reject",
    "cookies": "selected_identity",
    "families": [
      "account_api",
      "agent",
      "connected_app"
    ],
    "allowed_types": [
      "account_api.secret_key",
      "agent.chat_token",
      "connected_app.account_access"
    ],
    "alternatives": [
      {
        "credentials": [
          "account_api.secret_key"
        ],
        "checks": [
          "user_exists"
        ]
      },
      {
        "credentials": [
          "agent.chat_token"
        ],
        "checks": [
          "user_exists",
          "chat_profile_scope"
        ]
      },
      {
        "credentials": [
          "connected_app.account_access"
        ],
        "checks": [
          "user_exists",
          "connected_app_grant"
        ]
      }
    ],
    "resource_proofs": [],
    "issues": []
  },
  "x-auth-policy": "account_api_user",
  "x-auth-enforcement": "dependency",
  "x-auth-verification": "API key, scoped chat actor, or admitted connected app.",
  "x-docs-kind": "other",
  "x-docs-order": 100,
  "x-docs-depth": 2,
  "x-docs-action-order": 1000,
  "x-codeSamples": [
    {
      "lang": "shell",
      "label": "curl",
      "source": "curl -X POST https://api.openmerchant.dev/v1/purchase_intents/.../approval_widget \\\n  -H 'Authorization: Bearer pr_sk_test_...'"
    },
    {
      "lang": "shell",
      "label": "MCP (Streamable HTTP)",
      "source": "curl -X POST https://api.openmerchant.dev/mcp/v1 \\\n  -H 'Authorization: Bearer pr_sk_test_...' \\\n  -H 'Content-Type: application/json' \\\n  -d '{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1,\n  \"method\": \"tools/call\",\n  \"params\": {\n    \"name\": \"v1_create_purchase_approval_widget\",\n    \"arguments\": {\n      \"purchase_intent_id\": \"...\"\n    }\n  }\n}'"
    },
    {
      "lang": "typescript",
      "label": "MCP SDK (TS)",
      "source": "// Reusing a Client connected to /mcp/v1 — see the \"MCP server\" tag for setup.\nconst result = await client.callTool({\n  name: \"v1_create_purchase_approval_widget\",\n  arguments: {\n  \"purchase_intent_id\": \"...\"\n},\n});"
    }
  ]
}