# Get accept setup

Returns middleware snippets (FastAPI and Express) per service, hosted x402 endpoint URLs and the requirements URL for the caller merchant's stablecoin services. Console session or API key with payment:read.

`GET /v1/merchant/accept`

Returns middleware snippets (FastAPI and Express) per service, hosted x402 endpoint URLs and the requirements URL for the caller merchant's stablecoin services. Console session or API key with payment:read.

Requires permission `payment:read`.

## Responses

- **200**: Success.
- **401**: No valid session, API key or agent credential (UNAUTHENTICATED, AGENT_CREDENTIAL_INVALID).
- **403**: Authenticated but not allowed: missing permission, passkey step-up required, or denied by policy.

Example 200 response:

```json
{
  "snippets": {
    "fastapi": "from fastapi import FastAPI, Request\nfrom uapg.accept.middleware import PaidContext, X402Accept\n\napp = FastAPI()\naccept = X402Accept(\"https://api.52-28-238-205.sslip.io\")\n\n\n@app.get(\"/api/forecast\")\nasync def forecast(request: Request):\n    paid = await...(truncated)",
    "express": "import express from \"express\";\n\nconst GATEWAY = \"https://api.52-28-238-205.sslip.io\";\nconst FACILITATOR = `${GATEWAY}/mock/facilitator`;\nconst b64 = (o) => Buffer.from(JSON.stringify(o)).toString(\"base64\");\nconst unb64 = (s) => JSON.parse(Buffer.from(s,...(truncated)",
    "per_service": [
      {
        "service_id": "svc_01m7dmxx984adaradtp4jc7yaf",
        "service_slug": "forecast",
        "fastapi": "from fastapi import FastAPI, Request\nfrom uapg.accept.middleware import PaidContext, X402Accept\n\napp = FastAPI()\naccept = X402Accept(\"https://api.52-28-238-205.sslip.io\")\n\n\n@app.get(\"/api/forecast\")\nasync def forecast(request: Request):\n    paid = await...(truncated)",
        "express": "import express from \"express\";\n\nconst GATEWAY = \"https://api.52-28-238-205.sslip.io\";\nconst FACILITATOR = `${GATEWAY}/mock/facilitator`;\nconst b64 = (o) => Buffer.from(JSON.stringify(o)).toString(\"base64\");\nconst unb64 = (s) => JSON.parse(Buffer.from(s,...(truncated)"
      },
      {
        "service_id": "svc_01m7dmxx9bc6p81hbh9ebgdffn",
        "service_slug": "summary",
        "fastapi": "from fastapi import FastAPI, Request\nfrom uapg.accept.middleware import PaidContext, X402Accept\n\napp = FastAPI()\naccept = X402Accept(\"https://api.52-28-238-205.sslip.io\")\n\n\n@app.post(\"/api/summary\")\nasync def summary(request: Request):\n    paid = await ...(truncated)",
        "express": "import express from \"express\";\n\nconst GATEWAY = \"https://api.52-28-238-205.sslip.io\";\nconst FACILITATOR = `${GATEWAY}/mock/facilitator`;\nconst b64 = (o) => Buffer.from(JSON.stringify(o)).toString(\"base64\");\nconst unb64 = (s) => JSON.parse(Buffer.from(s,...(truncated)"
      }
    ]
  },
  "hosted_endpoints": [
    {
      "service_id": "svc_01m7dmxx984adaradtp4jc7yaf",
      "service_slug": "forecast",
      "url": "https://api.52-28-238-205.sslip.io/x402/demo-shop/forecast",
      "method": "GET",
      "origin_url": "https://merchant.example.com/api/forecast"
    },
    {
      "service_id": "svc_01m7dmxx9bc6p81hbh9ebgdffn",
      "service_slug": "summary",
      "url": "https://api.52-28-238-205.sslip.io/x402/demo-shop/summary",
      "method": "POST",
      "origin_url": "https://merchant.example.com/api/summary"
    }
  ],
  "requirements_url": "https://api.52-28-238-205.sslip.io/v1/accept/requirements/{service_id}",
  "facilitator_url": "https://api.52-28-238-205.sslip.io/mock/facilitator"
}
```
