{"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":{"ownershipProofs":["9a10bc6c98df8bd724e1fa8a89faadd09dc1bfcc81950087165da434778a9155"]},"servers":[{"url":"https://x402.clashofcoins.com/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.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"]}]},"example":{"nickname":"PlayerOne","itemId":"keys:10","quantity":1}}}},"x-payment-info":{"protocols":[{"x402":{"network":"eip155:8453","currency":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","payTo":"0x8b29DABD6fBb5A09DAcbC7978eaed66A8540721d"}}],"price":{"mode":"dynamic","currency":"USD","min":"0.090000","max":"40.500000"},"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\": \"keys:10\",\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":"keys:10","itemTitle":"10 keys","quantity":1,"baseUnitPriceUsd":"4.5","unitPriceUsd":"4.5","discountBps":0,"discountPercent":"0","hasDiscount":false,"baseAmountUsd":"4.5","amountUsd":"4.5"}],"totalQuantity":1,"baseAmountUsd":"4.5","discountBps":0,"discountAmountUsd":"0","amountUsd":"4.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 10 keys 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":"keys:10","itemTitle":"10 keys","quantity":1,"baseUnitPriceUsd":"4.5","unitPriceUsd":"4.5","discountBps":0,"discountPercent":"0","hasDiscount":false,"baseAmountUsd":"4.5","amountUsd":"4.5"}],"totalQuantity":1,"baseAmountUsd":"4.5","discountBps":0,"discountAmountUsd":"0","amountUsd":"4.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 10 keys 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":"keys:10","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.com/favicon.png","logoUrl":"https://x402.clashofcoins.com/favicon.png","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","addresses":{"treasury":"0x8b29dabd6fbb5a09dacbc7978eaed66a8540721d"}},"addresses":{"treasury":"0x8b29dabd6fbb5a09dacbc7978eaed66a8540721d"},"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":"keys:10","quantity":1}},"xmtp":null,"mpp":null,"activeItems":[{"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":"10 A-UNITS","description":"Includes 10 hard-currency-resource.","priceUsd":"0.09"},{"id":"a-units-pack:1","title":"200 A-UNITS","description":"Includes 200 hard-currency-resource.","priceUsd":"0.9"},{"id":"a-units-pack:2","title":"1250 A-UNITS","description":"Includes 1250 hard-currency-resource (+600 bonus).","priceUsd":"4.5"},{"id":"a-units-pack:3","title":"2750 A-UNITS","description":"Includes 2750 hard-currency-resource (+1450 bonus).","priceUsd":"9"},{"id":"a-units-pack:4","title":"7000 A-UNITS","description":"Includes 7000 hard-currency-resource (+3750 bonus).","priceUsd":"22.5"},{"id":"a-units-pack:5","title":"14500 A-UNITS","description":"Includes 14500 hard-currency-resource (+8650 bonus).","priceUsd":"40.5"}]}}