{"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 exposes the canonical x402 payable route. Use /openapi.full.json for recipient-scoped catalog, purchase-status, and Tempo MPP details.","x-guidance":"This protocol-aware OpenAPI document exposes the canonical x402 payable route. Use /openapi.full.json for recipient-scoped catalog, purchase-status, and Tempo MPP details."},"x-discovery":{},"servers":[{"url":"https://x402.clashofcoins.app/shop","description":"Canonical game shop checkout origin"}],"tags":[{"name":"Gaming","description":"Clash of Coins gaming commerce endpoints"},{"name":"x402","description":"Canonical shop x402 purchase flow"}],"paths":{"/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.app/shop/x402/buy","description":"Agentic checkout for Clash of Coins","mimeType":"application/json"},"accepted":{"scheme":"exact","network":"eip155:84532","asset":"0x036CbD53842c5426634e7929541eC2318f3dCF7e","amount":"5000000","payTo":"0x97b7f63Cb9f40a147775aa425589a334F7091E37","extra":{"assetTransferMethod":"permit2","name":"USDC","version":"2"}},"payload":{"authorization":{"from":"0x1111111111111111111111111111111111111111","to":"0x97b7f63Cb9f40a147775aa425589a334F7091E37","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"]}]},"example":{"nickname":"PlayerOne","itemId":"a-units-pack:1","quantity":1}}}},"x-payment-info":{"protocols":[{"x402":{"network":"eip155:84532","currency":"0x036CbD53842c5426634e7929541eC2318f3dCF7e","payTo":"0x97b7f63Cb9f40a147775aa425589a334F7091E37"}}],"price":{"mode":"dynamic","currency":"USD","min":"0.090000","max":"31.500000"},"authMode":"paid","retryHeader":"PAYMENT-SIGNATURE","recommendedClient":"@x402/fetch","network":"eip155:84532","asset":"0x036CbD53842c5426634e7929541eC2318f3dCF7e","payTo":"0x97b7f63Cb9f40a147775aa425589a334F7091E37","quoteOptional":true,"quotePurpose":"Use quote as a preflight to validate recipient, item selection, discount, and exact payable amount before buy.","extensions":{"erc20ApprovalGasSponsoring":{"version":"1"}},"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.app/shop/x402/buy', {\n  method: 'POST',\n  headers: { 'content-type': 'application/json' },\n  body: JSON.stringify({\n  \"nickname\": \"PlayerOne\",\n  \"itemId\": \"a-units-pack:1\",\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":"a-units-pack:1","itemTitle":"200 A-UNITS","quantity":1,"baseUnitPriceUsd":"0.09","unitPriceUsd":"0.09","discountBps":0,"discountPercent":"0","hasDiscount":false,"baseAmountUsd":"0.09","amountUsd":"0.09"}],"totalQuantity":1,"baseAmountUsd":"0.09","discountBps":0,"discountAmountUsd":"0","amountUsd":"0.09","currency":"USDC","network":"eip155:84532","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 200 A-UNITS 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":"a-units-pack:1","itemTitle":"200 A-UNITS","quantity":1,"baseUnitPriceUsd":"0.09","unitPriceUsd":"0.09","discountBps":0,"discountPercent":"0","hasDiscount":false,"baseAmountUsd":"0.09","amountUsd":"0.09"}],"totalQuantity":1,"baseAmountUsd":"0.09","discountBps":0,"discountAmountUsd":"0","amountUsd":"0.09","currency":"USDC","network":"eip155:84532","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 200 A-UNITS for player PlayerOne.","presentation":{"kind":"success","flow":"shop","protocol":"x402","nextAction":"inform_user"},"genericStatusEndpoint":"/shop/purchase-status/purchase-1"}}}},"400":{"description":"Invalid request"},"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."}}}}},"components":{"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."}},"schemas":{"X402Resource":{"type":"object","required":["url","mimeType"],"properties":{"url":{"type":"string"},"description":{"type":"string"},"mimeType":{"type":"string"}}},"X402AcceptedRequirement":{"type":"object","required":["scheme","network","asset","amount","payTo"],"properties":{"scheme":{"type":"string"},"network":{"type":"string"},"asset":{"type":"string"},"amount":{"type":"string"},"payTo":{"type":"string"},"extra":{"type":"object","additionalProperties":true}}},"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"}}},"ShopX402PaymentRequiredResponse":{"type":"object","required":["protocol","error","items","totalQuantity","totalPriceUsd","totalPriceAtomic","paymentRetry"],"properties":{"catalogTitle":{"type":"string"},"catalogLocale":{"type":"string"},"catalogDescription":{"type":"string"},"protocol":{"type":"string"},"error":{"type":"string"},"recipient":{"type":"object","properties":{"nickname":{"type":["string","null"]},"address":{"type":["string","null"]}}},"items":{"type":"array","items":{"type":"object","properties":{"itemId":{"type":"string"},"quantity":{"type":"integer"},"totalPriceUsd":{"type":"string"},"totalPriceAtomic":{"type":"string"},"offer":{"type":"object","additionalProperties":true}}}},"totalQuantity":{"type":"integer"},"totalPriceUsd":{"type":"string"},"totalPriceAtomic":{"type":"string"},"paymentFieldHints":{"type":"object","additionalProperties":true},"userMessage":{"type":"string"},"presentation":{"type":"object","additionalProperties":true},"paymentRetry":{"type":"object","additionalProperties":true}}},"ShopX402SettlementErrorResponse":{"type":"object","required":["error","reason","message","required","requiredAmountType","asset","paymentRecipient","chainInfoEndpoint","purchaseId","paymentSettled","paymentRetry"],"properties":{"error":{"type":"string"},"reason":{"type":"string"},"message":{"type":"string"},"required":{"type":"string"},"requiredAmountType":{"type":"string"},"totalPriceUsd":{"type":"string"},"asset":{"type":"string"},"available":{"type":"string"},"paymentRecipient":{"type":"string"},"chainInfoEndpoint":{"type":"string"},"statusEndpoint":{"type":["string","null"]},"statusByWalletItemEndpoint":{"type":"string"},"paymentReference":{"type":["string","null"]},"settlementTxHash":{"type":["string","null"]},"payer":{"type":["string","null"]},"purchaseId":{"type":["string","null"]},"paymentSettled":{"type":"boolean"},"hint":{"type":"string"},"paymentRetry":{"type":"object","additionalProperties":true}}},"ShopPurchaseStatusResponse":{"type":"object","required":["protocol","purchaseId","paymentReference","recipient","items","totalQuantity","amountUsd","currency","network","paymentStatus","deliveryStatus","statusEndpoint","genericStatusEndpoint"],"properties":{"catalogTitle":{"type":"string"},"catalogLocale":{"type":"string"},"catalogDescription":{"type":"string"},"protocol":{"type":"string"},"purchaseId":{"type":"string"},"paymentReference":{"type":"string"},"recipient":{"type":"object","properties":{"nickname":{"type":["string","null"]},"address":{"type":["string","null"]}}},"payer":{"type":["string","null"]},"items":{"type":"array","items":{"type":"object","properties":{"itemId":{"type":"string"},"itemTitle":{"type":"string"},"quantity":{"type":"integer"},"baseUnitPriceUsd":{"type":"string"},"unitPriceUsd":{"type":"string"},"discountBps":{"type":"integer"},"discountPercent":{"type":"string"},"hasDiscount":{"type":"boolean"},"baseAmountUsd":{"type":"string"},"amountUsd":{"type":"string"}}}},"totalQuantity":{"type":"integer"},"baseAmountUsd":{"type":"string"},"discountBps":{"type":"integer"},"discountAmountUsd":{"type":"string"},"amountUsd":{"type":"string"},"currency":{"type":"string"},"network":{"type":"string"},"catalogRevision":{"type":["string","null"]},"offerSnapshot":{"type":"array","items":{"type":"object","additionalProperties":true}},"paymentStatus":{"type":"string"},"deliveryStatus":{"type":"string"},"deliveryAttempts":{"type":"integer"},"delivery":{"type":["object","null"],"additionalProperties":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"statusEndpoint":{"type":"string"},"userConfirmation":{"type":"string"},"presentation":{"type":"object","additionalProperties":true},"genericStatusEndpoint":{"type":"string"}}},"ShopX402HealthResponse":{"type":"object","required":["protocol","x402Version","supportedSchemes","networkId","usdcAddress","paymentRecipient"],"properties":{"protocol":{"type":"string"},"x402Version":{"type":"integer"},"supportedSchemes":{"type":"array","items":{"type":"string"}},"chainId":{"type":["integer","null"]},"networkId":{"type":"string"},"usdcAddress":{"type":"string"},"paymentRecipient":{"type":"string"},"facilitator":{"type":["string","null"]},"transferMethod":{"type":["string","null"]},"eip712Domain":{"type":["object","null"],"additionalProperties":true},"domainSeparator":{"type":["string","null"]},"gasSponsorshipExtensions":{"type":"array","items":{"type":"string"}},"endpoints":{"type":"object","additionalProperties":true},"headers":{"type":"object","additionalProperties":true},"rateLimits":{"type":"object","additionalProperties":true}}}},"examples":{"SampleItem":{"value":{"itemId":"a-units-pack:1","quantity":1,"nickname":"PlayerOne"}}}},"x-bazaar":{"version":1,"integration":"minimal","notes":"Bazaar-compatible discovery metadata. Use /shop/openapi.json as protocol-aware payable discovery, then submit the matching canonical buy route.","name":"Clash of Coins","description":"Agentic checkout for Clash of Coins","category":"Gaming","tags":["Gaming"],"icon":"https://x402.clashofcoins.app/favicon.png","logoUrl":"https://x402.clashofcoins.app/favicon.png","service":{"name":"Clash of Coins","description":"Agentic checkout for Clash of Coins","category":"Gaming","tags":["Gaming"],"icon":"https://x402.clashofcoins.app/favicon.png","logoUrl":"https://x402.clashofcoins.app/favicon.png","addresses":{"treasury":"0x97b7f63cb9f40a147775aa425589a334f7091e37"}},"addresses":{"treasury":"0x97b7f63cb9f40a147775aa425589a334f7091e37"},"discovery":{"openapi":"/shop/openapi.json","openapiFull":"/shop/openapi.full.json","openapiMode":"payable","x402":"/shop/.well-known/x402","mpp":null,"agent":"/shop/.well-known/agent.json","skill":"/shop/skill.md"},"purchase":{"x402":{"method":"POST","path":"/shop/x402/buy","retryHeader":"PAYMENT-SIGNATURE"}}},"x-x402-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":"a-units-pack:1","quantity":1}},"xmtp":null,"mpp":null,"activeItems":[{"id":"a-units-pack:1","title":"200 A-UNITS","description":"Includes 200 hard-currency-resource (+100 bonus).","priceUsd":"0.09"},{"id":"a-units-pack:2","title":"1100 A-UNITS","description":"Includes 1100 hard-currency-resource (+100 bonus).","priceUsd":"0.45"},{"id":"a-units-pack:3","title":"2400 A-UNITS","description":"Includes 2400 hard-currency-resource (+400 bonus).","priceUsd":"0.9"},{"id":"a-units-pack:4","title":"6000 A-UNITS","description":"Includes 6000 hard-currency-resource (+1000 bonus).","priceUsd":"18"},{"id":"a-units-pack:5","title":"11000 A-UNITS","description":"Includes 11000 hard-currency-resource (+2000 bonus).","priceUsd":"31.5"},{"id":"keys:10","title":"10 keys","description":"Includes 10 keys.","priceUsd":"4.5"},{"id":"keys:5","title":"5 keys","description":"Includes 5 keys.","priceUsd":"2.25"},{"id":"keys:50","title":"50 keys","description":"Includes 50 keys.","priceUsd":"18"},{"id":"agent:a-units-pack-1","title":"agent:a-units-pack-1","description":"Includes 10 hard-currency-resource.","priceUsd":"0.09"}]}}