402Dock / Robinhood Chain Mainnet

From resource to paid access.

Create a checkout in the workspace, or connect your own server with the downloadable Node integration.

Publish your first resource

  1. Open the merchant workspace and sign in with your wallet. Signing the message costs no gas and does not authorize spending.
  2. Save your business name and payout wallet.
  3. Create a resource. Set one or both prices in decimal USDC and ETH, then choose hosted content or your own protected API.
  4. Choose Published and save. Open the generated checkout link.
  5. For hosted content, 402Dock handles delivery. For your own API, create a server key and follow the example below.

Merchant sign-in supports private-key EVM accounts (EOAs), not contract or delegated smart accounts. Your wallet is your account recovery method. No email or password is collected. Payments go straight to the resource’s payout wallet; 402Dock does not hold funds.

Network and payment model

Base URL: https://www.402dock.xyz. Chain: 4663 / eip155:4663. Native currency: ETH (18 decimals). Bridged USDC: 0x80e0e24718dbFcad49ECAA6F1e6C89A190586cA8 (6 decimals). Both currencies require ETH on Robinhood Chain for gas. Ethereum balances are separate.

This API uses 402dock-order-v1, a custom order-based protocol. It does not implement the standard x402 facilitator API, EIP-3009, subscriptions, sponsored gas or automatic per-request billing. An order buys reusable access to one resource. To meter requests, your application must enforce its own usage policy after verification.

Use the canonical bridge to fund the correct network. Bridged USDC is distinct from native Circle issuance. Official Robinhood Chain docs.

Create an order and pay

Use the checkout link from your workspace, or build a wallet flow with these public endpoints. API calls from another server do not require an Origin header. Cross-origin browser requests are not enabled; use hosted checkout or proxy through your own backend. Replace RESOURCE_ID and WALLET. No API key belongs in the buyer’s browser.

curl https://www.402dock.xyz/api/resources/RESOURCE_ID
curl -i https://www.402dock.xyz/api/resources/RESOURCE_ID/content
curl https://www.402dock.xyz/api/resources/RESOURCE_ID/requirements

curl https://www.402dock.xyz/api/orders   -H 'Content-Type: application/json'   -d '{"resourceId":"RESOURCE_ID","payer":"0xYOUR_WALLET","currency":"USDC"}'

A 201 response contains the frozen terms and the exact wallet transaction. All amounts in API responses are integer strings in the asset’s smallest unit. Resource creation accepts decimal strings instead.

{
  "id": "<64-character order ID>",
  "resourceId": "<32-character resource ID>",
  "currency": "USDC", "amount": "100000",
  "recipient": "0x...", "chainId": 4663,
  "status": "awaiting_payment", "expiresAt": 1790000000,
  "transaction": { "from": "0x...", "to": "0x...", "value": "0x0",
    "data": "0x...", "chainId": "0x1237" }
}

Switch the wallet to chain 0x1237 and pass the returned transaction unchanged. The server requires an exact order reference in calldata; a manual wallet transfer without it will not settle the order.

const order = await fetch('/api/orders', {
  method: 'POST', headers: {'Content-Type': 'application/json'},
  body: JSON.stringify({resourceId, payer, currency: 'ETH'})
}).then(async r => { const data = await r.json(); if (!r.ok) throw Error(data.error); return data; });
// Use the selected EIP-1193 provider from your wallet connector.
const transactionHash = await provider.request({
  method: 'eth_sendTransaction', params: [order.transaction]
});
// Persist order.id and transactionHash before polling verification.
const receipt = await fetch('/api/orders/' + order.id + '/verify', {
  method: 'POST', headers: {'Content-Type':'application/json'},
  body: JSON.stringify({transactionHash})
}).then(r => r.json());

Protect your own Node API

Download both files into the same folder. Node 20+ is required; no dependencies are needed. Set the key from your merchant workspace and the exact resource ID. The key must stay on your server.

export DOCK_API_KEY='your-server-key'
export DOCK_RESOURCE_ID='your-published-resource-id'
node example-server.mjs
# In another terminal:
curl -i http://localhost:8080/private
# After paying the checkout link, use the order ID:
curl -i http://localhost:8080/private -H 'Authorization: Bearer YOUR_ORDER_ID'

The example returns 402 with a checkout URL until your order is paid. It returns private JSON only after the server verifies the order for your resource and merchant. RPC or verification errors return 503 and keep the content locked.

import { DockClient } from './402doc-sdk.mjs';
const dock = new DockClient({apiKey: process.env.DOCK_API_KEY});
const receipt = await dock.verify({
  resourceId: process.env.DOCK_RESOURCE_ID,
  orderId: buyerOrderId
});
if (!receipt.verified) { /* respond HTTP 402, do not return private data */ }
else { /* return your private data */ }

Never trust a buyer-supplied price, recipient, status, resource ID or transaction hash as proof. Configure your expected resource on the server. An order ID is a reusable bearer credential: anyone who has it can access that purchased resource. Bind it to your own user account if you need account-specific access. There is no one-time redemption counter in this release.

API reference

Management uses Authorization: Bearer dock_… with a server key. The browser workspace uses an HttpOnly, SameSite cookie. Keys are stored as hashes, displayed once, and can be revoked immediately. Keys have full resource-management and verification access within their merchant account. Key creation and revocation require a wallet session.

Method and pathPurpose / input
GET /api/resources/:idPublished metadata, prices, recipient and checkout link. Never paid content.
GET /api/resources/:id/requirementsBoth enabled currencies, exact base-unit prices and network.
GET /api/resources/:id/content402 unless Authorization: Bearer ORDER_ID is paid for this resource.
POST /api/ordersresourceId, payer, currency (ETH or USDC). Omitting resourceId selects the public sample research brief.
GET /api/orders/:idRestore terms and last recorded status. Call verify for current settlement.
POST /api/orders/:id/verifyOptional transactionHash. Public on-chain verification; never use it without also checking the expected resource.
GET /api/merchant/resourcesAuthenticated merchant resources, including private setup.
POST /api/merchant/resourcesCreate resource with the JSON below.
POST /api/merchant/resources/:idReplace editable settings; same complete body. Existing order snapshots stay unchanged.
POST /api/merchant/verifyAuthenticated: resourceId, orderId, optional transactionHash. Returns {verified, resourceId, order}. Rejects another merchant’s resource.
GET /api/merchant/ordersLatest 100 orders for your merchant.
POST /api/validator/requirementsSubmit requirements JSON. Returns valid, errors and structure-only scope.
curl https://www.402dock.xyz/api/merchant/resources  -H "Authorization: Bearer $DOCK_API_KEY"  -H 'Content-Type: application/json'  -d '{
  "title":"Market insights", "description":"A paid research feed",
  "recipient":"0xYOUR_PAYOUT_WALLET",
  "prices":{"USDC":"0.10","ETH":"0.00005"},
  "delivery":"external", "content":"", "status":"published"
 }'

For delivery: hosted, content is required plain text, up to 20,000 characters. Titles: 100 characters; descriptions: 500. Publication: draft, published or archived. Set at least one positive price; omit or leave a currency blank to disable it. No URLs are fetched by 402Dock. Published resources appear in the public directory. Archive to stop new purchases; old paid orders remain accessible.

Settlement, recovery and errors

Orders expire after 15 minutes. A payment must be mined within its order window; confirmation and settlement can finish later. The verifier checks chain, sender, recipient, exact amount, full calldata and order reference, successful receipt, canonical block, token identity and exact USDC Transfer event. Two confirmations plus the RPC safe frontier are required by default. Every protected access rechecks the receipt. A pending or failed verification never grants access.

States: awaiting_payment → pending → paid, or failed for a reverted payment. Expiry is returned separately as expired. The last stored paid status is not permanent proof if the chain reorganizes or the RPC is unavailable.

Save the order ID and hash before leaving checkout. Restore with GET /api/orders/:id, then verify again. If a wallet response is lost, recover the hash from wallet activity. Do not submit a second payment while the first is unresolved. Same-nonce replacements are accepted only while the original is unmined; a successfully mined original must be verified using its own hash. One transaction cannot settle multiple orders.

StatusMeaning / action
400 / 413 / 415Invalid input, oversized request or wrong content type. Correct it before retrying.
401 / 403Sign in again, replace a revoked key or use the correct origin.
402Payment required or pending. Keep content locked.
404Unknown, unpublished or unauthorized resource/order.
409Transaction not visible, replacement conflict or reorg. Retain the order and retry.
422Payment mismatch, reverted transaction or outside payment window. Do not unlock.
429Rate limit. Honor Retry-After; poll every 5 seconds or slower.
503RPC/service unavailable. Fail closed and retry later.

Your live payment checklist

  1. Publish your own low-priced hosted resource and an external API resource. Confirm the payout wallet and prices before paying.
  2. Fund a buyer wallet on Robinhood Chain with ETH for fees and the supported bridged USDC if using that currency.
  3. Buy once in ETH and once in USDC. Confirm the recipient receives the correct asset and amount.
  4. Refresh while pending. Recover the saved order and wait for settlement. Confirm content remains locked until verification returns paid.
  5. For the API example, try no order, an unpaid order and an order for a different resource. All must stay locked. Then use the correct paid order.
  6. Revoke the server key and confirm its requests fail. Replace it in your server environment.

Local automated checks use a fork of Robinhood Chain and do not transfer public-network funds. Real purchases are your final acceptance test.