{"openapi":"3.1.0","info":{"title":"Clash of Coins API","version":"1.0.0","summary":"Agentic checkout for Clash of Coins","description":"Agentic checkout for Clash of Coins","guidance":"This protocol-aware OpenAPI document only exposes payable buy routes for the protocols enabled on this instance. Use /openapi.full.json for the richer unified sale and shop contract.","x-guidance":"This protocol-aware OpenAPI document only exposes payable buy routes for the protocols enabled on this instance. Use /openapi.full.json for the richer unified sale and shop contract.","x-error-recovery":"For 402, preserve the request body and retry with the payment header. For 429, respect Retry-After. For 5xx, retry status/read calls with bounded exponential backoff before creating duplicate payments."},"x-discovery":{"ownershipProofs":["9a10bc6c98df8bd724e1fa8a89faadd09dc1bfcc81950087165da434778a9155"]},"servers":[{"url":"https://x402.clashofcoins.com","description":"Agentic checkout for Clash of Coins"}],"tags":[{"name":"x402","description":"Canonical x402 purchase flows for sale and shop"},{"name":"agent-wallet","description":"Dedicated onchain agent wallet checkout flow"},{"name":"webhooks","description":"Documented checkout lifecycle event shapes"}],"paths":{"/agentic/x402/buy":{"post":{"operationId":"postAgenticX402Buy","tags":["Gaming","x402"],"summary":"Buy an NFT sale through canonical x402","description":"First call returns HTTP 402 with PAYMENT-REQUIRED. Retry the exact same JSON body with PAYMENT-SIGNATURE after settlement. Copy challenge.resource and challenge.accepts[0] verbatim into the decoded PAYMENT-SIGNATURE payload.","parameters":[{"name":"X-FLOW-ID","in":"header","required":false,"schema":{"type":"string"},"description":"Optional caller-provided correlation id. Reuse the same value when retrying a payment challenge if you want stable tracing."},{"name":"PAYMENT-SIGNATURE","in":"header","required":false,"description":"Base64url-encoded canonical x402 payment proof. The decoded JSON must reuse the latest PAYMENT-REQUIRED resource and must copy accepts[0] verbatim into accepted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/X402PaymentSignatureDecoded"},"example":{"x402Version":2,"resource":{"url":"https://x402.clashofcoins.com/agentic/x402/buy","description":"Agentic checkout for Clash of Coins","mimeType":"application/json"},"accepted":{"scheme":"exact","network":"eip155:8453","amount":"9000000","asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","payTo":"0x8b29DABD6fBb5A09DAcbC7978eaed66A8540721d","maxTimeoutSeconds":300,"extra":{"name":"USD Coin","version":"2"}},"payload":{"authorization":{"from":"0x1111111111111111111111111111111111111111","to":"0x8b29DABD6fBb5A09DAcbC7978eaed66A8540721d","value":"9000000","validAfter":"0","validBefore":"1735689600","nonce":"0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"},"signature":"0xbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"}}}}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["saleId","beneficiary"],"properties":{"saleId":{"type":"integer","minimum":1},"quantity":{"type":"integer","minimum":1,"default":1},"beneficiary":{"type":"string","description":"EVM address that will receive the minted NFT"}}},"example":{"saleId":391,"quantity":1,"beneficiary":"0x1111111111111111111111111111111111111111"}}}},"responses":{"200":{"description":"Payment settled and purchase accepted for mint delivery","headers":{"X-FLOW-ID":{"description":"Request correlation id. Send the latest X-FLOW-ID again on retries if you want stable tracing across challenge, settlement, and status polling.","schema":{"type":"string"}}},"content":{"application/json":{"example":{"flowId":"uuid","saleId":391,"quantity":1,"paymentTx":"0xpaymenttx","saleTx":"0xsale","beneficiary":"0x1111111111111111111111111111111111111111","status":"submitted"}}}},"202":{"description":"Payment settled, mint delivery still pending","headers":{"X-FLOW-ID":{"description":"Request correlation id. Send the latest X-FLOW-ID again on retries if you want stable tracing across challenge, settlement, and status polling.","schema":{"type":"string"}}},"content":{"application/json":{"example":{"flowId":"uuid","saleId":391,"quantity":1,"paymentTx":"0xpaymenttx","beneficiary":"0x1111111111111111111111111111111111111111","status":"payment_settled_pending_mint"}}}},"400":{"description":"Invalid request","headers":{},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"},"example":{"error":"request_failed","message":"Operation failed. Inspect status and recovery guidance."}}}},"402":{"description":"Payment Required","headers":{"PAYMENT-REQUIRED":{"description":"Protocol payment requirement","schema":{"type":"string"}},"WWW-Authenticate":{"description":"Bearer/OAuth metadata hint for protected resource discovery.","schema":{"type":"string"}},"PAYMENT-SIGNATURE":{"description":"Header name used by x402 clients when retrying a paid request.","schema":{"type":"string"}},"PAYMENT-RESPONSE":{"description":"Payment settlement response details when facilitator returns them.","schema":{"type":"string"}},"X-FLOW-ID":{"description":"Request correlation id. Send the latest X-FLOW-ID again on retries if you want stable tracing across challenge, settlement, and status polling.","schema":{"type":"string"}}},"content":{"application/json":{"examples":{"paymentRequired":{"value":{"error":"payment_required","paymentRetry":{"header":"PAYMENT-SIGNATURE","preserveRequestBody":true,"requiredPaymentPayloadFields":["resource","accepted"]}}},"invalidPaymentSignature":{"value":{"error":"invalid_signature","reason":"accepted_field_mismatch","hint":"The paid retry accepted field does not exactly match PAYMENT-REQUIRED.accepts[0]. Copy the accepted object verbatim before retrying."}}}}}},"404":{"description":"Resource not found for the supplied route parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"},"example":{"error":"request_failed","message":"Operation failed. Inspect status and recovery guidance."}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"example":{"error":"Too many retries for this payment","message":"This payment proof was retried too many times. Wait briefly before retrying.","retryAfter":60}}},"headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"string"}}}},"500":{"description":"Transient server error. Retry with bounded exponential backoff.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"},"example":{"error":"request_failed","message":"Operation failed. Inspect status and recovery guidance."}}}},"502":{"description":"Upstream gateway or facilitator error. Retry status/read routes before repeating payment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"},"example":{"error":"request_failed","message":"Operation failed. Inspect status and recovery guidance."}}}},"503":{"description":"Service temporarily unavailable. Retry with bounded exponential backoff.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"},"example":{"error":"request_failed","message":"Operation failed. Inspect status and recovery guidance."}}}},"504":{"description":"Gateway timeout. Poll status routes before creating another payment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"},"example":{"error":"request_failed","message":"Operation failed. Inspect status and recovery guidance."}}}}},"x-payment-info":{"authMode":"paid","protocols":[{"x402":{"network":"eip155:8453","currency":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","payTo":"0x8b29DABD6fBb5A09DAcbC7978eaed66A8540721d"}}],"price":{"mode":"dynamic","currency":"USD","min":"9.000000","max":"900.000000"},"recommendedClient":"@x402/fetch","network":"eip155:8453","asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","payTo":"0x8b29DABD6fBb5A09DAcbC7978eaed66A8540721d","extra":{"name":"USD Coin","version":"2"},"extensions":null,"retryHeader":"PAYMENT-SIGNATURE","retryBodyMode":"reuse_original_json","quoteOptional":true,"quotePurpose":"Use quote as a preflight to validate saleId, quantity, beneficiary, and exact payable amount before buy.","rateLimits":{"purchaseAttemptsPerIpPerMinute":30,"paidRetriesPerPaymentPerMinute":10}},"x-codeSamples":[{"lang":"JavaScript","label":"Canonical x402 client","source":"import { fetch as x402Fetch } from '@x402/fetch';\nimport { createWalletClient, http } from 'viem';\nimport { privateKeyToAccount } from 'viem/accounts';\nimport { base } from 'viem/chains';\n\nconst walletClient = createWalletClient({\n  account: privateKeyToAccount(process.env.PRIVATE_KEY),\n  chain: base,\n  transport: http(process.env.RPC_URL),\n});\n\nconst response = await x402Fetch('https://x402.clashofcoins.com/agentic/x402/buy', {\n  method: 'POST',\n  headers: { 'content-type': 'application/json' },\n  body: JSON.stringify({\n  \"saleId\": 391,\n  \"quantity\": 1,\n  \"beneficiary\": \"0x1111111111111111111111111111111111111111\"\n}),\n  walletClient,\n});\n\nconst result = await response.json();\nconsole.log(result);"}]}},"/shop/x402/buy":{"post":{"operationId":"buyShopX402OpenApi","tags":["Gaming","x402"],"summary":"Buy a Clash of Coins game shop item with x402","description":"Canonical payable x402 route for Clash of Coins shop purchases. Use the same JSON body on the unpaid challenge request and the paid retry.","parameters":[{"name":"PAYMENT-SIGNATURE","in":"header","required":false,"description":"Paid retries must keep the JSON body unchanged and send a canonical PAYMENT-SIGNATURE built from the latest PAYMENT-REQUIRED challenge, including its resource and one accepted payment requirement.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/X402PaymentSignatureDecoded"},"example":{"x402Version":2,"resource":{"url":"https://x402.clashofcoins.com/shop/x402/buy","description":"Agentic checkout for Clash of Coins","mimeType":"application/json"},"accepted":{"scheme":"exact","network":"eip155:8453","asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","amount":"5000000","payTo":"0x8b29DABD6fBb5A09DAcbC7978eaed66A8540721d","extra":{"name":"USD Coin","version":"2"}},"payload":{"authorization":{"from":"0x1111111111111111111111111111111111111111","to":"0x8b29DABD6fBb5A09DAcbC7978eaed66A8540721d","value":"5000000","validAfter":"0","validBefore":"1735689600","nonce":"0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"},"signature":"0xbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"}}}}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"nickname":{"type":"string","description":"Clash of Coins player nickname that should receive delivery"},"address":{"type":"string","description":"Optional EVM address used to resolve and verify the recipient"},"itemId":{"type":"string","description":"Single-item shorthand for buying one catalog item"},"quantity":{"type":"integer","minimum":1,"default":1,"description":"Quantity used together with itemId shorthand"}},"oneOf":[{"required":["nickname","itemId"]},{"required":["address","itemId"]}]}}}},"x-payment-info":{"protocols":[{"x402":{"network":"eip155:8453","currency":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","payTo":"0x8b29DABD6fBb5A09DAcbC7978eaed66A8540721d"}}],"price":{"mode":"dynamic","currency":"USD","min":"0.000000","max":"0.000000"},"authMode":"paid","retryHeader":"PAYMENT-SIGNATURE","recommendedClient":"@x402/fetch","network":"eip155:8453","asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","payTo":"0x8b29DABD6fBb5A09DAcbC7978eaed66A8540721d","quoteOptional":true,"quotePurpose":"Use quote as a preflight to validate recipient, item selection, discount, and exact payable amount before buy.","extensions":null,"rateLimits":{"unpaidPurchaseAttemptsPerIpPerMinute":30,"paidRetriesPerPaymentPerMinute":10}},"x-codeSamples":[{"lang":"JavaScript","label":"Canonical x402 client","source":"import { fetch as x402Fetch } from '@x402/fetch';\nimport { createWalletClient, http } from 'viem';\nimport { privateKeyToAccount } from 'viem/accounts';\nimport { base } from 'viem/chains';\n\nconst walletClient = createWalletClient({\n  account: privateKeyToAccount(process.env.PRIVATE_KEY),\n  chain: base,\n  transport: http(process.env.RPC_URL),\n});\n\nconst response = await x402Fetch('https://x402.clashofcoins.com/shop/x402/buy', {\n  method: 'POST',\n  headers: { 'content-type': 'application/json' },\n  body: JSON.stringify({\n  \"nickname\": \"PlayerOne\",\n  \"itemId\": \"item-id\",\n  \"quantity\": 1\n}),\n  walletClient,\n});\n\nconst result = await response.json();\nconsole.log(result);"}],"responses":{"200":{"description":"Payment settled and delivery completed or already recorded","headers":{"PAYMENT-RESPONSE":{"description":"Canonical encoded x402 payment response header for the settled payment.","schema":{"type":"string"}},"X-PAYMENT-RESPONSE":{"description":"Compatibility alias for PAYMENT-RESPONSE.","schema":{"type":"string"}},"Payment-Receipt":{"description":"Convenience alias for the settled payment reference.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShopPurchaseStatusResponse"},"example":{"catalogTitle":"Clash of Coins Game Shop","catalogLocale":"en","catalogDescription":"Browse in-game goods for Clash of Coins, pay in USDC via x402 or MPP, and receive backend delivery to a verified player identified by nickname or address.","protocol":"x402","purchaseId":"purchase-1","paymentReference":"0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","recipient":{"nickname":"PlayerOne","address":null},"payer":"0x1111111111111111111111111111111111111111","items":[{"itemId":"item-id","itemTitle":"Starter Pack","quantity":1,"baseUnitPriceUsd":"5","unitPriceUsd":"5","discountBps":0,"discountPercent":"0","hasDiscount":false,"baseAmountUsd":"5","amountUsd":"5"}],"totalQuantity":1,"baseAmountUsd":"5","discountBps":0,"discountAmountUsd":"0","amountUsd":"5","currency":"USDC","network":"eip155:8453","catalogRevision":"catalog-revision-1","offerSnapshot":[],"paymentStatus":"settled","deliveryStatus":"delivered","deliveryAttempts":1,"delivery":{"success":true,"retryable":false,"response":{"ok":true},"error":null},"createdAt":"2026-04-06T12:00:00.000Z","updatedAt":"2026-04-06T12:00:05.000Z","statusEndpoint":"/shop/x402/purchases/0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","userConfirmation":"Purchased 1x Starter Pack for player PlayerOne.","presentation":{"kind":"success","flow":"shop","protocol":"x402","nextAction":"inform_user"},"genericStatusEndpoint":"/shop/purchase-status/purchase-1"}}}},"202":{"description":"Payment settled, delivery pending or retryable","headers":{"PAYMENT-RESPONSE":{"description":"Canonical encoded x402 payment response header for the settled payment.","schema":{"type":"string"}},"X-PAYMENT-RESPONSE":{"description":"Compatibility alias for PAYMENT-RESPONSE.","schema":{"type":"string"}},"Payment-Receipt":{"description":"Convenience alias for the settled payment reference.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShopPurchaseStatusResponse"},"example":{"catalogTitle":"Clash of Coins Game Shop","catalogLocale":"en","catalogDescription":"Browse in-game goods for Clash of Coins, pay in USDC via x402 or MPP, and receive backend delivery to a verified player identified by nickname or address.","protocol":"x402","purchaseId":"purchase-1","paymentReference":"0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","recipient":{"nickname":"PlayerOne","address":null},"payer":"0x1111111111111111111111111111111111111111","items":[{"itemId":"item-id","itemTitle":"Starter Pack","quantity":1,"baseUnitPriceUsd":"5","unitPriceUsd":"5","discountBps":0,"discountPercent":"0","hasDiscount":false,"baseAmountUsd":"5","amountUsd":"5"}],"totalQuantity":1,"baseAmountUsd":"5","discountBps":0,"discountAmountUsd":"0","amountUsd":"5","currency":"USDC","network":"eip155:8453","catalogRevision":"catalog-revision-1","offerSnapshot":[],"paymentStatus":"settled","deliveryStatus":"pending","deliveryAttempts":0,"delivery":null,"createdAt":"2026-04-06T12:00:00.000Z","updatedAt":"2026-04-06T12:00:05.000Z","statusEndpoint":"/shop/x402/purchases/0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","userConfirmation":"Purchased 1x Starter Pack for player PlayerOne.","presentation":{"kind":"success","flow":"shop","protocol":"x402","nextAction":"inform_user"},"genericStatusEndpoint":"/shop/purchase-status/purchase-1"}}}},"400":{"description":"Invalid request","headers":{},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"},"example":{"error":"request_failed","message":"Operation failed. Inspect status and recovery guidance."}}}},"402":{"description":"Paid retries must keep the JSON body unchanged and send a canonical PAYMENT-SIGNATURE built from the latest PAYMENT-REQUIRED challenge, including its resource and one accepted payment requirement.","headers":{"PAYMENT-REQUIRED":{"description":"Semantic challenge header for unpaid purchase requests.","schema":{"type":"string"}},"WWW-Authenticate":{"description":"Bearer/OAuth metadata hint for protected resource discovery.","schema":{"type":"string"}},"PAYMENT-SIGNATURE":{"description":"Header name used by x402 clients when retrying a paid request.","schema":{"type":"string"}},"PAYMENT-RESPONSE":{"description":"Payment settlement response details when facilitator returns them.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"},"example":{"error":"request_failed","message":"Operation failed. Inspect status and recovery guidance."}}}},"404":{"description":"Resource not found for the supplied route parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"},"example":{"error":"request_failed","message":"Operation failed. Inspect status and recovery guidance."}}}},"429":{"description":"Rate limit exceeded. Respect Retry-After before retrying.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"},"example":{"error":"request_failed","message":"Operation failed. Inspect status and recovery guidance."}}}},"500":{"description":"Transient server error. Retry with bounded exponential backoff.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"},"example":{"error":"request_failed","message":"Operation failed. Inspect status and recovery guidance."}}}},"502":{"description":"Upstream gateway or facilitator error. Retry status/read routes before repeating payment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"},"example":{"error":"request_failed","message":"Operation failed. Inspect status and recovery guidance."}}}},"503":{"description":"Service temporarily unavailable. Retry with bounded exponential backoff.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"},"example":{"error":"request_failed","message":"Operation failed. Inspect status and recovery guidance."}}}},"504":{"description":"Gateway timeout. Poll status routes before creating another payment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"},"example":{"error":"request_failed","message":"Operation failed. Inspect status and recovery guidance."}}}}}}},"/agent-wallet/x402/fund":{"post":{"operationId":"fundAgentWalletOrder","tags":["Gaming","agent-wallet","x402"],"summary":"Fund an agent-wallet order through X402","description":"Pays the dedicated onchain agent wallet via the canonical x402 funding route. Create the order first, then submit paid funding for that orderId. Unpaid discovery probes may send an empty JSON body to receive a canonical payment challenge, but real funding and paid retries must include orderId. By default, the service auto-executes treasury sweep and purchase finalization after successful funding.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["orderId"],"properties":{"orderId":{"type":"string","description":"Agent wallet order id returned by POST /agent-wallet/orders"}},"additionalProperties":false},"example":{"orderId":"aw-ord-1"}}}},"responses":{"200":{"description":"Order funded and auto-processed (sweep + finalize) successfully","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string"},"paymentReference":{"type":"string"},"order":{"type":"object","properties":{"orderId":{"type":"string"},"mode":{"type":["string","null"]},"surface":{"type":["string","null"]},"protocol":{"type":["string","null"]},"status":{"type":["string","null"]},"amountUsd":{"type":["string","null"]},"amountAtomic":{"type":["string","null"]},"currency":{"type":["string","null"]},"network":{"type":["string","null"]},"fundingPaymentReference":{"type":["string","null"]},"userToAgentTxHash":{"type":["string","null"]},"agentToTreasuryTxHash":{"type":["string","null"]},"linkedPurchaseReference":{"type":["string","null"]},"userAddress":{"type":["string","null"]},"recipientNickname":{"type":["string","null"]},"recipientAddress":{"type":["string","null"]},"beneficiaryAddress":{"type":["string","null"]},"createdAt":{"type":["string","null"]},"updatedAt":{"type":["string","null"]}}},"autoExecution":{"type":"object","properties":{"attempted":{"type":"boolean"},"enabled":{"type":"boolean"},"success":{"type":"boolean"},"error":{"type":["string","null"]},"sweepTxHash":{"type":["string","null"]},"linkedPurchaseReference":{"type":["string","null"]},"recovery":{"type":"object","properties":{"sweepEndpoint":{"type":"string"},"finalizeEndpoint":{"type":"string"}}},"completion":{"anyOf":[{"type":"object","additionalProperties":true},{"type":"null"}]}}},"error":{"type":"string"},"paymentRetry":{"type":"object","additionalProperties":true},"mpp":{"type":"object","additionalProperties":true}},"additionalProperties":true},"example":{"status":"purchase_recorded","paymentReference":"0x1111111111111111111111111111111111111111111111111111111111111111","order":{"orderId":"aw-ord-1","mode":"agent_wallet_x402_funded","surface":"sale","protocol":"x402","status":"purchase_recorded","amountUsd":"900.000000","amountAtomic":"900000","currency":"USDC","network":"eip155:8453","fundingPaymentReference":"0x1111111111111111111111111111111111111111111111111111111111111111","userToAgentTxHash":"0x1111111111111111111111111111111111111111111111111111111111111111","agentToTreasuryTxHash":"0x2222222222222222222222222222222222222222222222222222222222222222","linkedPurchaseReference":"0x3333333333333333333333333333333333333333333333333333333333333333","userAddress":"0x4444444444444444444444444444444444444444","recipientNickname":null,"recipientAddress":null,"beneficiaryAddress":"0x5555555555555555555555555555555555555555","createdAt":"2026-04-20T10:00:00.000Z","updatedAt":"2026-04-20T10:00:05.000Z"},"autoExecution":{"attempted":true,"success":true,"sweepTxHash":"0x2222222222222222222222222222222222222222222222222222222222222222","linkedPurchaseReference":"0x3333333333333333333333333333333333333333333333333333333333333333","completion":{"status":"submitted"}}}}}},"202":{"description":"Funding settled, but auto-processing requires retry or manual recovery via sweep/finalize endpoints","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string"},"paymentReference":{"type":"string"},"order":{"type":"object","properties":{"orderId":{"type":"string"},"mode":{"type":["string","null"]},"surface":{"type":["string","null"]},"protocol":{"type":["string","null"]},"status":{"type":["string","null"]},"amountUsd":{"type":["string","null"]},"amountAtomic":{"type":["string","null"]},"currency":{"type":["string","null"]},"network":{"type":["string","null"]},"fundingPaymentReference":{"type":["string","null"]},"userToAgentTxHash":{"type":["string","null"]},"agentToTreasuryTxHash":{"type":["string","null"]},"linkedPurchaseReference":{"type":["string","null"]},"userAddress":{"type":["string","null"]},"recipientNickname":{"type":["string","null"]},"recipientAddress":{"type":["string","null"]},"beneficiaryAddress":{"type":["string","null"]},"createdAt":{"type":["string","null"]},"updatedAt":{"type":["string","null"]}}},"autoExecution":{"type":"object","properties":{"attempted":{"type":"boolean"},"enabled":{"type":"boolean"},"success":{"type":"boolean"},"error":{"type":["string","null"]},"sweepTxHash":{"type":["string","null"]},"linkedPurchaseReference":{"type":["string","null"]},"recovery":{"type":"object","properties":{"sweepEndpoint":{"type":"string"},"finalizeEndpoint":{"type":"string"}}},"completion":{"anyOf":[{"type":"object","additionalProperties":true},{"type":"null"}]}}},"error":{"type":"string"},"paymentRetry":{"type":"object","additionalProperties":true},"mpp":{"type":"object","additionalProperties":true}},"additionalProperties":true},"example":{"status":"failed","paymentReference":"0x1111111111111111111111111111111111111111111111111111111111111111","order":{"orderId":"aw-ord-1","mode":"agent_wallet_x402_funded","surface":"sale","protocol":"x402","status":"failed","amountUsd":"900.000000","amountAtomic":"900000","currency":"USDC","network":"eip155:8453","fundingPaymentReference":"0x1111111111111111111111111111111111111111111111111111111111111111","userToAgentTxHash":"0x1111111111111111111111111111111111111111111111111111111111111111","agentToTreasuryTxHash":null,"linkedPurchaseReference":null,"userAddress":"0x4444444444444444444444444444444444444444","recipientNickname":null,"recipientAddress":null,"beneficiaryAddress":"0x5555555555555555555555555555555555555555","createdAt":"2026-04-20T10:00:00.000Z","updatedAt":"2026-04-20T10:00:09.000Z"},"autoExecution":{"attempted":true,"success":false,"error":"auto_execution_failed","recovery":{"sweepEndpoint":"/agent-wallet/orders/aw-ord-1/execute-sweep","finalizeEndpoint":"/agent-wallet/orders/aw-ord-1/finalize"}}}}}},"400":{"description":"Missing orderId on a paid retry or malformed funding request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"additionalProperties":true},"example":{"error":"orderId is required"}}},"headers":{}},"402":{"description":"x402 payment challenge. Retry the same JSON body with PAYMENT-SIGNATURE after settlement.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string"},"paymentReference":{"type":"string"},"order":{"type":"object","properties":{"orderId":{"type":"string"},"mode":{"type":["string","null"]},"surface":{"type":["string","null"]},"protocol":{"type":["string","null"]},"status":{"type":["string","null"]},"amountUsd":{"type":["string","null"]},"amountAtomic":{"type":["string","null"]},"currency":{"type":["string","null"]},"network":{"type":["string","null"]},"fundingPaymentReference":{"type":["string","null"]},"userToAgentTxHash":{"type":["string","null"]},"agentToTreasuryTxHash":{"type":["string","null"]},"linkedPurchaseReference":{"type":["string","null"]},"userAddress":{"type":["string","null"]},"recipientNickname":{"type":["string","null"]},"recipientAddress":{"type":["string","null"]},"beneficiaryAddress":{"type":["string","null"]},"createdAt":{"type":["string","null"]},"updatedAt":{"type":["string","null"]}}},"autoExecution":{"type":"object","properties":{"attempted":{"type":"boolean"},"enabled":{"type":"boolean"},"success":{"type":"boolean"},"error":{"type":["string","null"]},"sweepTxHash":{"type":["string","null"]},"linkedPurchaseReference":{"type":["string","null"]},"recovery":{"type":"object","properties":{"sweepEndpoint":{"type":"string"},"finalizeEndpoint":{"type":"string"}}},"completion":{"anyOf":[{"type":"object","additionalProperties":true},{"type":"null"}]}}},"error":{"type":"string"},"paymentRetry":{"type":"object","additionalProperties":true},"mpp":{"type":"object","additionalProperties":true}},"additionalProperties":true},"example":{"error":"payment_required","paymentRetry":{"header":"PAYMENT-SIGNATURE","preserveRequestBody":true,"requiredPaymentPayloadFields":["resource","accepted"]}}}},"headers":{"PAYMENT-REQUIRED":{"description":"Semantic challenge header for unpaid purchase requests.","schema":{"type":"string"}},"WWW-Authenticate":{"description":"Bearer/OAuth metadata hint for protected resource discovery.","schema":{"type":"string"}},"PAYMENT-SIGNATURE":{"description":"Header name used by x402 clients when retrying a paid request.","schema":{"type":"string"}},"PAYMENT-RESPONSE":{"description":"Payment settlement response details when facilitator returns them.","schema":{"type":"string"}}}},"404":{"description":"Order not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"additionalProperties":true},"example":{"error":"Order not found"}}},"headers":{}},"429":{"description":"Rate limit exceeded. Respect Retry-After before retrying.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"},"example":{"error":"request_failed","message":"Operation failed. Inspect status and recovery guidance."}}}},"500":{"description":"Transient server error. Retry with bounded exponential backoff.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"},"example":{"error":"request_failed","message":"Operation failed. Inspect status and recovery guidance."}}}},"502":{"description":"Upstream gateway or facilitator error. Retry status/read routes before repeating payment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"},"example":{"error":"request_failed","message":"Operation failed. Inspect status and recovery guidance."}}}},"503":{"description":"Service temporarily unavailable. Retry with bounded exponential backoff.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"},"example":{"error":"request_failed","message":"Operation failed. Inspect status and recovery guidance."}}}},"504":{"description":"Gateway timeout. Poll status routes before creating another payment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"},"example":{"error":"request_failed","message":"Operation failed. Inspect status and recovery guidance."}}}}},"x-payment-info":{"price":{"mode":"dynamic","currency":"USD","min":"9.000000","max":"900.000000"},"protocols":[{"x402":{"network":"eip155:8453","currency":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","payTo":"0x93862e5b2b1fa10a01772e7e9ca7cdc7deb5ca25"}}],"authMode":"paid","retryHeader":"PAYMENT-SIGNATURE","payTo":"0x93862e5b2b1fa10a01772e7e9ca7cdc7deb5ca25","quoteOptional":false,"checkoutFlow":["POST /agent-wallet/orders","/agent-wallet/x402/fund"]}}}},"components":{"schemas":{"X402Resource":{"type":"object","required":["url"],"properties":{"url":{"type":"string","format":"uri"},"description":{"type":"string"},"mimeType":{"type":"string"}}},"X402AcceptedRequirement":{"type":"object","required":["scheme","network","amount","asset","payTo"],"properties":{"scheme":{"type":"string","example":"exact"},"network":{"type":"string"},"amount":{"type":"string","description":"Atomic token amount as a decimal string."},"asset":{"type":"string","description":"ERC-20 token address."},"payTo":{"type":"string","description":"Recipient address that receives settlement."},"maxTimeoutSeconds":{"type":"integer"},"extra":{"type":"object","additionalProperties":true,"description":"Optional payment requirement metadata copied from PAYMENT-REQUIRED.accepts[0]."}}},"X402PaymentAuthorization":{"type":"object","required":["from","to","value","validAfter","validBefore","nonce"],"properties":{"from":{"type":"string"},"to":{"type":"string"},"value":{"type":"string"},"validAfter":{"type":"string"},"validBefore":{"type":"string"},"nonce":{"type":"string"}}},"X402PaymentPayload":{"type":"object","required":["authorization","signature"],"properties":{"authorization":{"$ref":"#/components/schemas/X402PaymentAuthorization"},"signature":{"type":"string"}}},"X402PaymentSignatureDecoded":{"type":"object","required":["x402Version","resource","accepted","payload"],"properties":{"x402Version":{"type":"integer","example":2},"resource":{"$ref":"#/components/schemas/X402Resource"},"accepted":{"$ref":"#/components/schemas/X402AcceptedRequirement"},"payload":{"$ref":"#/components/schemas/X402PaymentPayload"}}},"GatewayError":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"},"requestId":{"type":"string"},"recovery":{"type":"string"},"status":{"type":"integer"}},"additionalProperties":true}},"securitySchemes":{"x402PaymentSignature":{"type":"apiKey","in":"header","name":"PAYMENT-SIGNATURE","description":"Paid retries must keep the JSON body unchanged and send a canonical PAYMENT-SIGNATURE built from the latest PAYMENT-REQUIRED challenge, including its resource and one accepted payment requirement."}},"examples":{}},"x-x402-shop":{"serviceName":"Clash of Coins","serviceDescription":"Agentic checkout for Clash of Coins","discovery":{"openapi":"/openapi.json","openapiFull":"/openapi.full.json","catalog":"/catalog","resources":"/discovery/resources","mcp":"/mcp.json","skillsIndex":"/skills/index.json","wellKnownSkillsIndex":"/.well-known/skills/index.json","x402":"/.well-known/x402","mpp":null,"llms":"/llms.txt","agent":"/.well-known/agent.json","agents":"/.well-known/agents.json","skill":"/skill.md","publishedRouterSkill":"/skills/clashofcoins-universal/SKILL.md","publishedRouterSkillAliases":["/skills/SKILL.md","/skills/clashofcoins-universal/skill.md","/skills/clashofcoins-universal","/skills/clashofcoins/SKILL.md","/skills/clashofcoins/skill.md","/skills/clashofcoins"],"agentcashValidatorSkill":"/agentcash-validator-skill.md","agentWallet":"/agent-wallet","agentWalletFunding":"/agent-wallet/x402/fund","agentWalletFundingProtocol":"x402","agentWalletX402Funding":true,"agentWalletMppFunding":false,"agentWalletFundingRoutes":{"x402":"/agent-wallet/x402/fund"},"agentWalletAutoExecuteOnFunding":true,"agentWalletPurchaseProtocols":{"sale":["x402"],"shop":["x402"]}},"checkouts":{"sale":{"serviceName":"Clash of Coins","serviceDescription":"Agentic checkout for Clash of Coins","profileId":"base","networkId":"eip155:8453","saleAddress":"0x3C83eF6119EB05Ca44144F05b331dbEE60656d5b","configuredSaleIds":[391,392,393,394],"availableSaleIds":[391,392,393,394],"canonicalX402Endpoint":"/agentic/x402/buy","discovery":{"x402":"/.well-known/x402","mpp":null,"llms":"/llms.txt","agent":"/.well-known/agent.json","agents":"/.well-known/agents.json","skill":"https://x402.clashofcoins.com/skill.md"},"readEndpoints":{"health":"/health","catalog":"/agentic/x402/offers","quote":"/agentic/x402/quote","purchaseStatus":"/agentic/x402/purchases/{paymentTx}"},"skillUrl":"https://x402.clashofcoins.com/skill.md","activeSales":[{"saleId":391,"status":"active","price":"9 USDC","basePrice":"10 USDC","discountBps":1000,"discountPercent":"10","quantityAvailable":999999983,"metadata":"ipfs://bafybeigajagnoxbtzsfdumoma5tsm2jtkpoauxoetp2jf65kicze6eycqa/initiate.json","nftContractAddress":"0x49046e2988a78222693c04ad049b68e5a4801034"},{"saleId":392,"status":"active","price":"90 USDC","basePrice":"100 USDC","discountBps":1000,"discountPercent":"10","quantityAvailable":999999999,"metadata":"ipfs://bafybeigajagnoxbtzsfdumoma5tsm2jtkpoauxoetp2jf65kicze6eycqa/commander.json","nftContractAddress":"0x49046e2988a78222693c04ad049b68e5a4801034"},{"saleId":393,"status":"active","price":"900 USDC","basePrice":"1000 USDC","discountBps":1000,"discountPercent":"10","quantityAvailable":999999999,"metadata":"ipfs://bafybeigajagnoxbtzsfdumoma5tsm2jtkpoauxoetp2jf65kicze6eycqa/warlord.json","nftContractAddress":"0x49046e2988a78222693c04ad049b68e5a4801034"},{"saleId":394,"status":"active","price":"270 USDC","basePrice":"300 USDC","discountBps":1000,"discountPercent":"10","quantityAvailable":999999999,"metadata":"ipfs://bafybeigajagnoxbtzsfdumoma5tsm2jtkpoauxoetp2jf65kicze6eycqa/heropack.json","nftContractAddress":"0x49046e2988a78222693c04ad049b68e5a4801034"}],"channels":{"x402":{"listSalesEndpoint":"/agentic/x402/offers","quoteSaleEndpoint":"/agentic/x402/quote","purchaseEndpoint":"/agentic/x402/buy","purchaseStatusEndpointTemplate":"/agentic/x402/purchases/{paymentTx}"},"a2a":{"manifestEndpoint":"/agentic/a2a/capabilities","listSalesEndpoint":"/agentic/a2a/offers","quoteSaleEndpoint":"/agentic/a2a/quote","buyEndpoint":"/agentic/a2a/buy","purchaseStatusEndpointTemplate":"/agentic/a2a/purchases/{paymentTx}"},"frames":{"gatewayUrl":"https://x402.clashofcoins.com","buyFrameTemplate":"https://x402.clashofcoins.com/agentic/frames/buy/{saleId}/{playerRef}","frontendCheckoutBaseUrl":"https://x402.clashofcoins.com"}},"xmtp":null,"mpp":null,"a2a":{"channel":"a2a","profileId":"base","network":"eip155:8453","capabilities":{"discovery":"/agentic/a2a/offers","quote":"/agentic/a2a/quote","buy":"/agentic/a2a/buy","purchaseStatus":"/agentic/a2a/purchases/{paymentTx}","x402Discovery":"/.well-known/x402"},"commands":[],"channels":{"x402":{"listSalesEndpoint":"/agentic/x402/offers","quoteSaleEndpoint":"/agentic/x402/quote","purchaseEndpoint":"/agentic/x402/buy","purchaseStatusEndpointTemplate":"/agentic/x402/purchases/{paymentTx}"},"a2a":{"manifestEndpoint":"/agentic/a2a/capabilities","listSalesEndpoint":"/agentic/a2a/offers","quoteSaleEndpoint":"/agentic/a2a/quote","buyEndpoint":"/agentic/a2a/buy","purchaseStatusEndpointTemplate":"/agentic/a2a/purchases/{paymentTx}"},"frames":{"gatewayUrl":"https://x402.clashofcoins.com","buyFrameTemplate":"https://x402.clashofcoins.com/agentic/frames/buy/{saleId}/{playerRef}","frontendCheckoutBaseUrl":"https://x402.clashofcoins.com"}}}},"shop":{"serviceName":"Clash of Coins","serviceDescription":"Agentic checkout for Clash of Coins","checkoutType":"shop","canonicalX402Endpoint":"/shop/x402/buy","discovery":{"root":"/shop","openapi":"/shop/openapi.json","openapiFull":"/shop/openapi.full.json","x402":"/shop/.well-known/x402","mpp":null,"xmtp":null,"llms":"/shop/llms.txt","agent":"/shop/.well-known/agent.json","agents":"/shop/.well-known/agents.json","skill":"/shop/skill.md"},"x402":{"buy":"/shop/x402/buy","quote":"/shop/x402/quote","purchaseStatus":"/shop/x402/purchases/{paymentReference}","genericStatus":"/shop/purchase-status/{purchaseId}","statusByWalletItem":"/shop/x402/status?wallet={wallet}&itemId={itemId}","chainInfo":"/shop/x402/chain-info","health":"/shop/x402/health","openapi":"/shop/x402/openapi.json","inputSchema":{"type":"object","properties":{"nickname":{"type":"string","description":"Clash of Coins player nickname that should receive delivery"},"address":{"type":"string","description":"Optional EVM address used to resolve and verify the recipient"},"itemId":{"type":"string","description":"Single-item shorthand for buying one catalog item"},"quantity":{"type":"integer","minimum":1,"default":1,"description":"Quantity used together with itemId shorthand"}},"oneOf":[{"required":["nickname","itemId"]},{"required":["address","itemId"]}]},"inputExample":{"nickname":"PlayerOne","itemId":"item-id","quantity":1}},"xmtp":null,"mpp":null,"activeItems":[]}}},"x-bazaar":{"version":1,"integration":"minimal","notes":"Bazaar-compatible discovery metadata. Use protocol-aware /openapi.json and route-level x-payment-info as the canonical source of payable flows.","name":"Clash of Coins","description":"Agentic checkout for Clash of Coins","category":"Gaming","tags":["Gaming"],"icon":"https://x402.clashofcoins.com/favicon.png","logoUrl":"https://x402.clashofcoins.com/favicon.png","ogImage":"https://clashofcoins.com/agentic/images/og-image.jpg","service":{"name":"Clash of Coins","description":"Agentic checkout for Clash of Coins","category":"Gaming","tags":["Gaming"],"icon":"https://x402.clashofcoins.com/favicon.png","logoUrl":"https://x402.clashofcoins.com/favicon.png","ogImage":"https://clashofcoins.com/agentic/images/og-image.jpg","addresses":{"agent":"0x93862e5b2b1fa10a01772e7e9ca7cdc7deb5ca25","treasury":"0x8b29dabd6fbb5a09dacbc7978eaed66a8540721d"}},"addresses":{"agent":"0x93862e5b2b1fa10a01772e7e9ca7cdc7deb5ca25","treasury":"0x8b29dabd6fbb5a09dacbc7978eaed66a8540721d"},"discovery":{"openapi":"/openapi.json","openapiFull":"/openapi.full.json","openapiMode":"payable","catalog":"/catalog","resources":"/discovery/resources","x402":"/.well-known/x402"},"purchase":{"saleX402Buy":{"method":"POST","path":"/agentic/x402/buy"},"shopX402Buy":{"method":"POST","path":"/shop/x402/buy"},"agentWalletFund":{"method":"POST","path":"/agent-wallet/x402/fund"},"agentWalletX402Fund":{"method":"POST","path":"/agent-wallet/x402/fund"},"agentWalletFundingProtocol":"x402","agentWalletFundingRoutes":{"x402":{"method":"POST","path":"/agent-wallet/x402/fund"}},"agentWalletPurchaseProtocols":{"sale":["x402"],"shop":["x402"]}}}}