{"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":"Start with GET /api/shop/items or the protocol-specific offers endpoint. You may omit nickname and address to read the general catalog, or provide exactly one identifier to read personalized offers for that user. Then submit a quote or buy request with exactly one recipient identifier. shop x402 requires itemId plus optional quantity, while Tempo MPP also supports multi-item carts through items[]. For Tempo MPP, prefer the canonical mppx SDK instead of manual Authorization: Payment credentials. Poll purchase status if delivery remains pending.","x-guidance":"Start with GET /api/shop/items or the protocol-specific offers endpoint. You may omit nickname and address to read the general catalog, or provide exactly one identifier to read personalized offers for that user. Then submit a quote or buy request with exactly one recipient identifier. shop x402 requires itemId plus optional quantity, while Tempo MPP also supports multi-item carts through items[]. For Tempo MPP, prefer the canonical mppx SDK instead of manual Authorization: Payment credentials. Poll purchase status if delivery remains pending."},"servers":[{"url":"https://x402.clashofcoins.com/shop","description":"Canonical Clash of Coins checkout origin"}],"tags":[{"name":"Gaming","description":"Clash of Coins gaming commerce endpoints"},{"name":"x402","description":"Canonical shop x402 purchase flow"}],"paths":{"/api/shop/items":{"get":{"summary":"List active game shop items","parameters":[{"name":"nickname","in":"query","required":false,"schema":{"type":"string"}},{"name":"address","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Catalog response"},"400":{"description":"Invalid recipient query. Provide either nickname or address, not both."}}}},"/shop/x402/offers":{"get":{"summary":"List active game shop items for x402 checkout","parameters":[{"name":"nickname","in":"query","required":false,"schema":{"type":"string"}},{"name":"address","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Active shop items. Omitting nickname and address returns the general catalog; providing one returns personalized offers for that user.","content":{"application/json":{"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 player nickname.","protocol":"x402","payment":{"protocol":"x402","scheme":"exact"},"offers":[{"id":"keys:10","title":"10 keys","description":"Includes 10 keys.","priceUsd":"4.5"}]}}}},"400":{"description":"Invalid recipient query. Provide either nickname or address, not both."}}}},"/shop/x402/quote":{"post":{"summary":"Quote a game shop purchase through x402","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}}}},"responses":{"200":{"description":"Purchase quote","content":{"application/json":{"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.","checkoutType":"shop","discountBps":0,"discountPercent":"10","hasDiscount":true,"catalogFetchedAt":"2026-04-06T12:00:00.000Z","catalogRevision":"catalog-revision-1","protocol":"x402","payment":{"protocol":"x402","network":"eip155:8453","currency":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","currencySymbol":"USDC","paymentAddress":"0x8b29DABD6fBb5A09DAcbC7978eaed66A8540721d"},"recipient":{"nickname":"PlayerOne","address":null},"items":[{"itemId":"keys:10","quantity":1,"baseUnitPriceUsd":"4.5","discountedUnitPriceUsd":"4.5","unitPriceUsd":"4.5","discountBps":0,"discountPercent":"0","hasDiscount":false,"baseTotalPriceUsd":"4.5","totalPriceUsd":"4.5","totalPriceAtomic":"90000","offer":{"id":"keys:10","title":"10 keys"}}],"totalQuantity":1,"baseTotalPriceUsd":"4.5","discountAmountUsd":"0","totalPriceUsd":"4.5","totalPriceAtomic":"90000"}}}},"400":{"description":"Invalid request"}}}},"/shop/x402/chain-info":{"get":{"summary":"Read chain and payment domain information for shop x402 checkout","responses":{"200":{"description":"Current x402 chain and domain configuration","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShopX402ChainInfo"},"example":{"chainId":8453,"networkId":"eip155:8453","usdcAddress":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","paymentRecipient":"0x8b29DABD6fBb5A09DAcbC7978eaed66A8540721d","facilitator":"https://api.cdp.coinbase.com/platform/v2/x402","transferMethod":""}}}}}}},"/shop/x402/health":{"get":{"summary":"Read x402 protocol metadata, headers, and rate-limit hints for shop checkout","responses":{"200":{"description":"Current x402 runtime metadata for agents and clients","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShopX402HealthResponse"},"example":{"protocol":"x402","x402Version":2,"supportedSchemes":["exact"],"chainId":8453,"networkId":"eip155:8453","usdcAddress":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","paymentRecipient":"0x8b29DABD6fBb5A09DAcbC7978eaed66A8540721d","facilitator":"https://api.cdp.coinbase.com/platform/v2/x402","transferMethod":"","gasSponsorshipExtensions":[],"endpoints":{"offers":"/shop/x402/offers","quote":"/shop/x402/quote","buy":"/shop/x402/buy","purchaseStatus":"/shop/x402/purchases/{paymentReference}","statusByWalletItem":"/shop/x402/status?wallet={wallet}&itemId={itemId}","chainInfo":"/shop/x402/chain-info","openapi":"/shop/x402/openapi.json"},"headers":{"paymentRequired":"PAYMENT-REQUIRED","paidRetry":"PAYMENT-SIGNATURE","success":["PAYMENT-RESPONSE","X-PAYMENT-RESPONSE","Payment-Receipt"]},"rateLimits":{"unpaidPurchaseAttemptsPerIpPerMinute":30,"paidRetriesPerPaymentPerMinute":10}}}}}}}},"/shop/x402/status":{"get":{"summary":"Check whether a wallet already paid for an x402 shop item","parameters":[{"name":"wallet","in":"query","required":true,"schema":{"type":"string"}},{"name":"itemId","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Latest matching payment status for the wallet and item","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShopX402StatusByWalletItem"},"example":{"paid":true,"purchaseId":"purchase-1","txHash":"0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","paymentReference":"0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","paymentStatus":"settled","deliveryStatus":"delivered","statusEndpoint":"/shop/x402/purchases/0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","genericStatusEndpoint":"/shop/purchase-status/purchase-1","itemId":"keys:10","wallet":"0x1111111111111111111111111111111111111111"}}}},"400":{"description":"Invalid wallet or itemId query"}}}},"/shop/x402/buy":{"post":{"operationId":"buyShopX402","tags":["Gaming","x402"],"summary":"Buy a Clash of Coins game shop item with x402","description":"Settles an x402 USDC payment and credits the purchased item through the Clash of Coins backend delivery endpoint.","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.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ShopX402PaymentRequiredResponse"},{"$ref":"#/components/schemas/ShopX402SettlementErrorResponse"}]},"examples":{"PaymentRequired":{"value":{"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.","checkoutType":"shop","discountBps":1000,"discountPercent":"10","hasDiscount":true,"catalogFetchedAt":null,"catalogRevision":null,"protocol":"x402","error":"payment_required","recipient":{"nickname":"PlayerOne","address":null},"items":[{"itemId":"keys:10","quantity":1,"totalPriceUsd":"4.5","totalPriceAtomic":"90000","offer":{"id":"keys:10","title":"10 keys"}}],"totalQuantity":1,"totalPriceUsd":"4.5","totalPriceAtomic":"90000","paymentFieldHints":{"amountType":"string_atomic","nonceFormat":"hex_32bytes_with_0x_prefix","paidRetryHeader":"PAYMENT-SIGNATURE","preserveRequestBody":true,"acceptedMustEchoFromHeader":true},"userMessage":"Confirm to proceed with 10 keys for $4.5 USDC.","paymentRetry":{"header":"PAYMENT-SIGNATURE","preserveRequestBody":true,"requiredPaymentPayloadFields":["resource","accepted"],"facilitatorSettlement":"required"}}},"SettlementFailed":{"value":{"error":"insufficient_funds","reason":"insufficient balance","message":"The signature was valid, but facilitator settlement could not transfer the required amount.","required":"90000","requiredAmountType":"string_atomic","totalPriceUsd":"4.5","asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","paymentRecipient":"0x8b29DABD6fBb5A09DAcbC7978eaed66A8540721d","chainInfoEndpoint":"/shop/x402/chain-info","statusEndpoint":null,"statusByWalletItemEndpoint":"/shop/x402/status?wallet=0x1111111111111111111111111111111111111111&itemId=keys%3A10","paymentReference":null,"settlementTxHash":null,"payer":"0x1111111111111111111111111111111111111111","purchaseId":null,"paymentSettled":false,"hint":"The signature was valid, but settlement failed because the payer wallet does not currently hold enough USDC for this purchase.","paymentRetry":{"header":"PAYMENT-SIGNATURE","preserveRequestBody":true,"requiredPaymentPayloadFields":["resource","accepted"],"facilitatorSettlement":"required"}}}}}}}}},"get":{"summary":"Probe the x402 checkout endpoint","responses":{"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.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ShopX402PaymentRequiredResponse"},{"$ref":"#/components/schemas/ShopX402SettlementErrorResponse"}]},"examples":{"PaymentRequired":{"value":{"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.","checkoutType":"shop","discountBps":1000,"discountPercent":"10","hasDiscount":true,"catalogFetchedAt":null,"catalogRevision":null,"protocol":"x402","error":"payment_required","recipient":{"nickname":"PlayerOne","address":null},"items":[{"itemId":"keys:10","quantity":1,"totalPriceUsd":"4.5","totalPriceAtomic":"90000","offer":{"id":"keys:10","title":"10 keys"}}],"totalQuantity":1,"totalPriceUsd":"4.5","totalPriceAtomic":"90000","paymentFieldHints":{"amountType":"string_atomic","nonceFormat":"hex_32bytes_with_0x_prefix","paidRetryHeader":"PAYMENT-SIGNATURE","preserveRequestBody":true,"acceptedMustEchoFromHeader":true},"userMessage":"Confirm to proceed with 10 keys for $4.5 USDC.","paymentRetry":{"header":"PAYMENT-SIGNATURE","preserveRequestBody":true,"requiredPaymentPayloadFields":["resource","accepted"],"facilitatorSettlement":"required"}}},"SettlementFailed":{"value":{"error":"insufficient_funds","reason":"insufficient balance","message":"The signature was valid, but facilitator settlement could not transfer the required amount.","required":"90000","requiredAmountType":"string_atomic","totalPriceUsd":"4.5","asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","paymentRecipient":"0x8b29DABD6fBb5A09DAcbC7978eaed66A8540721d","chainInfoEndpoint":"/shop/x402/chain-info","statusEndpoint":null,"statusByWalletItemEndpoint":"/shop/x402/status?wallet=0x1111111111111111111111111111111111111111&itemId=keys%3A10","paymentReference":null,"settlementTxHash":null,"payer":"0x1111111111111111111111111111111111111111","purchaseId":null,"paymentSettled":false,"hint":"The signature was valid, but settlement failed because the payer wallet does not currently hold enough USDC for this purchase.","paymentRetry":{"header":"PAYMENT-SIGNATURE","preserveRequestBody":true,"requiredPaymentPayloadFields":["resource","accepted"],"facilitatorSettlement":"required"}}}}}}}}}},"/purchase-status/{purchaseId}":{"get":{"summary":"Get purchase status by purchase id","parameters":[{"name":"purchaseId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Purchase status","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":"Purchase still pending","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"}}}},"404":{"description":"Purchase not found"}}}},"/payments/history":{"get":{"summary":"List recent purchases (requires secret header)","parameters":[{"name":"X-HISTORY-SECRET","in":"header","required":true,"schema":{"type":"string"},"description":"Shared secret for history access"},{"name":"limit","in":"query","schema":{"type":"integer","default":50}}],"responses":{"200":{"description":"Purchase history list"},"401":{"description":"Unauthorized — missing or invalid secret header"}}}},"/shop/x402/purchases/{paymentReference}":{"get":{"summary":"Get x402 purchase status by payment reference","parameters":[{"name":"paymentReference","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Purchase status","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":"Purchase still pending","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"}}}},"404":{"description":"Purchase not found"}}}}},"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"}}},"ShopX402StatusByWalletItem":{"type":"object","required":["paid","purchaseId","txHash","paymentReference","itemId","wallet"],"properties":{"paid":{"type":"boolean"},"purchaseId":{"type":["string","null"]},"txHash":{"type":["string","null"]},"paymentReference":{"type":["string","null"]},"paymentStatus":{"type":"string"},"deliveryStatus":{"type":"string"},"statusEndpoint":{"type":"string"},"genericStatusEndpoint":{"type":"string"},"itemId":{"type":"string"},"wallet":{"type":"string"}}},"ShopX402ChainInfo":{"type":"object","required":["chainId","networkId","usdcAddress","paymentRecipient"],"properties":{"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"]}}},"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"}]}}