U.CASH Sell (402) API

Create resources + build the multi-coin accepts[]

GitHub OpenAPI

Operations 7

POST /v1/resources Create a priced resource (optional max_per_caller to cap a payer's spend in a… #
PUT /v1/resources Set (or clear) a resource's per-caller spend cap. #
GET /v1/resources List resources, fetch one (?res_id=, incl. #
DELETE /v1/resources SOFT disable a resource: removes it from the list and the /r/ door but keeps… #
POST /v1/payment-requests Create a ONE-OFF payment request (a pay.u.cash /id/ link that closes when paid… #
GET /v1/payment-requests List your one-off payment requests, or fetch one (?id=) #
POST /v1/challenge Build the multi-coin 402 accepts[] for a resource {res_id} #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/u-cash:u-cash-sell-402-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

u-cash-sell-402-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: agents.u.cash Sell (402) API
  version: 0.7.3
  description: 'Agent + merchant product surface for the 402 Online Protocol - multi-coin, non-custodial HTTP-402 payments. Two-sided: sell (get paid to your own wallet) and buy (pay for resources). UCP (ucp.dev) discovery + multi-item mixed-currency checkout sessions + AP2 mandates + RFC 9421-signed responses. Live reference implementation; protocol spec at https://402.onl. INPUT CONTRACTS (all authenticated writes): unknown keys are rejected with 400 uxc_unknown_param listing the Allowed keys; wrong shapes are rejected with 400 uxc_invalid_request naming the field and expected shape; booleans must be true/false (or "true"/"false"); updates are true partials (unsent fields keep their values). Supported assets (grouped; the engine master list): Bitcoin (BTC, +Lightning), Ethereum (ETH), Solana (SOL), Tron (TRX), XRP, Dogecoin (DOGE), Litecoin (LTC), Bitcoin Cash (BCH), Algorand (ALGO), Monero (XMR), Polkadot (DOT), Stellar (XLM), Tezos (XTZ), Polygon (POL), Avalanche (AVAX), BNB Chain (BNB), Toncoin (TON); Base, Arbitrum, Optimism, Linea, Mantle, Berachain, Sonic, Unichain, World, Monad, Plasma, Abstract, Scroll, Ink, Hyperliquid (native gas + ETH-bridged), Robinhood Chain (native gas + ALL 194 issuer-listed tokenized-asset rails; featured set in pickers, u.cash/tokenized-assets for the full list), Arc (Circle L2, native USDC gas); USDT (Ethereum / BSC / Tron), USDC (Ethereum / native on Arc), and USDC-on-Base (0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913) - the x402 gasless rail; UCASH (Ethereum ERC-20, 0x92e52a1A235d9A103D970901066CE910AAceFD37) - also the non-withdrawable fee-credit unit; Any ERC-20 / BEP-20 / Base-20 / Polygon-20 / Arb-20 / Op-20 / Avax-20 / Linea / Mantle / Sonic / Bera / ... / TRC-20 / SPL / TON Jetton / Robinhood-20 / Arc-20 added via POST /v1/custom-tokens (auto-detected on-chain like any coin)'
  contact:
    url: https://github.com/UdotCash/agents
servers:
- url: https://agents.u.cash
  description: agents.u.cash
tags:
- name: Sell (402)
  description: Create resources + build the multi-coin accepts[]
paths:
  /v1/resources:
    post:
      tags:
      - Sell (402)
      summary: Create a priced resource (optional max_per_caller to cap a payer's spend in a…
      security:
      - ApiKey: []
      parameters:
      - name: Idempotency-Key
        in: header
        required: false
        schema:
          type: string
          maxLength: 128
        description: 'retry-safe create: the same key + body replays the original response (Idempotency-Replayed: true) instead of duplicating'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Resource'
      responses:
        '200':
          description: '{res_id, amount, currency, accepted_assets, max_per_caller, checkout_url}'
      operationId: postV1Resources
      x-operation-id-source: derived
    put:
      tags:
      - Sell (402)
      summary: Set (or clear) a resource's per-caller spend cap.
      security:
      - ApiKey: []
      parameters:
      - name: res_id
        in: query
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                max_per_caller:
                  $ref: '#/components/schemas/Resource/properties/max_per_caller'
      responses:
        '200':
          description: '{res_id, max_per_caller}'
      operationId: putV1Resources
      x-operation-id-source: derived
    get:
      tags:
      - Sell (402)
      summary: List resources, fetch one (?res_id=, incl.
      security:
      - ApiKey: []
      responses:
        '200':
          description: '{resources:[...]} | one resource | {callers:[{caller,spend,payments}]}'
      operationId: getV1Resources
      x-operation-id-source: derived
    delete:
      tags:
      - Sell (402)
      summary: 'SOFT disable a resource: removes it from the list and the /r/ door but keeps…'
      security:
      - ApiKey: []
      parameters:
      - name: res_id
        in: query
        required: true
        schema:
          type: string
      responses:
        '200':
          description: '{disabled:true, res_id}'
      operationId: deleteV1Resources
      x-operation-id-source: derived
  /v1/payment-requests:
    post:
      tags:
      - Sell (402)
      summary: Create a ONE-OFF payment request (a pay.u.cash /id/ link that closes when paid…
      security:
      - ApiKey: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                amount:
                  type: number
                currency:
                  type: string
                  default: USD
                asset:
                  type: string
                asset_amount:
                  type: number
                cryptocurrency:
                  type: string
                title:
                  type: string
                note:
                  type: string
                expiry:
                  type: string
                  default: 24h
                  enum:
                  - 15m
                  - 1h
                  - 24h
                  - 7d
                  - 30d
                redirect:
                  type: string
                external_reference:
                  type: string
      responses:
        '200':
          description: '{transaction_id, encrypted_id, url, amount, currency, cryptocurrency, expiry, status}'
      operationId: postV1PaymentRequests
      x-operation-id-source: derived
    get:
      tags:
      - Sell (402)
      summary: List your one-off payment requests, or fetch one (?id=)
      security:
      - ApiKey: []
      responses:
        '200':
          description: '{payment_requests:[...]} | one request'
      operationId: getV1PaymentRequests
      x-operation-id-source: derived
  /v1/challenge:
    post:
      tags:
      - Sell (402)
      summary: Build the multi-coin 402 accepts[] for a resource {res_id}
      security:
      - ApiKey: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
              - res_id
              properties:
                res_id:
                  type: string
      responses:
        '200':
          description: '{res_id, amount, currency, accepts:[...]}'
      operationId: postV1Challenge
      x-operation-id-source: derived
components:
  schemas:
    Resource:
      type: object
      required:
      - amount
      properties:
        amount:
          type: number
          description: fiat price, e.g. 0.05
        currency:
          type: string
          default: USD
        accepted_assets:
          type: array
          items:
            type: string
          description: defaults to all configured wallets
        webhook_url:
          type: string
          format: uri
          description: notified (HMAC-signed) on settlement
        max_per_caller:
          type: object
          description: optional per-caller spend cap; a payer whose settled spend in the window reaches amount is refused new authorization
          properties:
            amount:
              type: number
            window_hours:
              type: integer
            by:
              type: string
              enum:
              - wallet
              - ip
              default: wallet
              description: wallet = enforce at verify/settle; ip = enforce at the door before charge
        checkout_url:
          type: string
          format: uri
          description: 'response field: the canonical buyer door on pay.u.cash (/checkout/<enc>?cloud=<token>). A human gets the HTML checkout; an agent fetches ?agent=1 for the 402 manifest; an x402 client sends X-PAYMENT'
        test:
          type: boolean
          description: 'test mode: settles instantly for $0, no wallet needed, marked in responses, excluded from earnings'
        test_confirmations:
          type: integer
          minimum: 0
          maximum: 12
          default: 1
          description: 'sandbox only: simulated confirmations required before settle (POST /v1/simulate-payment advances them; default 1 = instant, like the historic behavior)'
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: X-Api-Key
      description: The api_key from POST /v1/signup.