{"openapi":"3.1.0","info":{"title":"Crypto Merchant API","version":"1.0.0","summary":"Invoices, payment links, balances, accepted coins and sticky wallets for a custodial crypto payment gateway.","description":"JSON over HTTPS with a secret key. Amounts are strings. Payouts are made in the portal, not through the API, and there is no refund call: refunds use private refund links made in the portal. Documentation: https://cryptomerchant.online/docs/api and https://cryptomerchant.online/docs/webhooks.","termsOfService":"https://cryptomerchant.online/terms","contact":{"name":"Crypto Merchant support","url":"https://cryptomerchant.online/contact","email":"support@cryptomerchant.online"}},"externalDocs":{"description":"API reference","url":"https://cryptomerchant.online/docs/api"},"servers":[{"url":"https://cryptomerchant.online/api/v1"}],"security":[{"secretKey":[]}],"tags":[{"name":"Invoices"},{"name":"Payment links"},{"name":"Balances"},{"name":"Coins"},{"name":"Sticky wallets","description":"Per-customer deposit addresses. Chosen at sign-up; other accounts get 403 sticky_wallets_unavailable."}],"paths":{"/invoices":{"post":{"tags":["Invoices"],"operationId":"createInvoice","summary":"Create an invoice","description":"With coin set, the address is assigned and the rate locked at once. Without it, the invoice starts as open and the customer picks a coin on checkout_url.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceCreate"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Invoice"}}}},"400":{"description":"invalid_json, invalid_request, invalid_amount, amount_too_small, invalid_asset or asset_not_accepted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key (unauthorized)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"This account is suspended (account_suspended)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"tags":["Invoices"],"operationId":"listInvoices","summary":"List invoices, newest first","parameters":[{"name":"status","in":"query","schema":{"$ref":"#/components/schemas/InvoiceStatus"}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":20}},{"name":"starting_after","in":"query","schema":{"type":"string"},"description":"Return invoices after this id, from the previous page."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["object","data"],"properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Invoice"}},"has_more":{"type":"boolean"}}}}}},"400":{"description":"invalid_request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key (unauthorized)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"This account is suspended (account_suspended)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/invoices/{id}":{"get":{"tags":["Invoices"],"operationId":"getInvoice","summary":"Retrieve an invoice","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Invoice id"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Invoice"}}}},"401":{"description":"Missing or invalid API key (unauthorized)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"This account is suspended (account_suspended)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/invoices/{id}/cancel":{"post":{"tags":["Invoices"],"operationId":"cancelInvoice","summary":"Cancel an invoice before any payment","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Invoice id"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Invoice"}}}},"400":{"description":"invalid_state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key (unauthorized)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"This account is suspended (account_suspended)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/payment-links":{"post":{"tags":["Payment links"],"operationId":"createPaymentLink","summary":"Create a payment link","description":"Leave amount out for a link where the customer enters the amount.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentLinkCreate"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentLink"}}}},"400":{"description":"invalid_json or invalid_request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key (unauthorized)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"This account is suspended (account_suspended)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"tags":["Payment links"],"operationId":"listPaymentLinks","summary":"List your latest 100 payment links, newest first","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["object","data"],"properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/PaymentLink"}}}}}}},"401":{"description":"Missing or invalid API key (unauthorized)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"This account is suspended (account_suspended)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/balances":{"get":{"tags":["Balances"],"operationId":"getBalances","summary":"What you hold in each coin, and your gas balance","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Balances"}}}},"401":{"description":"Missing or invalid API key (unauthorized)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"This account is suspended (account_suspended)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/coins":{"get":{"tags":["Coins"],"operationId":"listCoins","summary":"The coins your account accepts","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["object","data"],"properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Coin"}}}}}}},"401":{"description":"Missing or invalid API key (unauthorized)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"This account is suspended (account_suspended)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sticky-wallets":{"post":{"tags":["Sticky wallets"],"operationId":"createStickyWallet","summary":"Get or create a customer's sticky wallet","description":"Safe to repeat: the same reference returns the same addresses (201 when it was just made, 200 after that). label and metadata, when sent, replace the stored ones.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StickyWalletCreate"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StickyWallet"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StickyWallet"}}}},"400":{"description":"invalid_json or invalid_request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key (unauthorized)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"This account is suspended (account_suspended)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"tags":["Sticky wallets"],"operationId":"listStickyWallets","summary":"List sticky wallets, newest first","parameters":[{"name":"reference","in":"query","schema":{"type":"string"},"description":"Find one customer's wallet by your own reference."},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":20}},{"name":"starting_after","in":"query","schema":{"type":"string"},"description":"Return sticky wallets after this id, from the previous page."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["object","data"],"properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/StickyWallet"}},"has_more":{"type":"boolean"}}}}}},"401":{"description":"Missing or invalid API key (unauthorized)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"This account is suspended (account_suspended)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sticky-wallets/{id}":{"get":{"tags":["Sticky wallets"],"operationId":"getStickyWallet","summary":"Retrieve a sticky wallet","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Sticky wallet id (sw_…)"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StickyWallet"}}}},"401":{"description":"Missing or invalid API key (unauthorized)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"This account is suspended (account_suspended)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/deposits":{"get":{"tags":["Sticky wallets"],"operationId":"listDeposits","summary":"List deposits to sticky wallets, newest first","parameters":[{"name":"sticky_wallet","in":"query","schema":{"type":"string"},"description":"Only this sticky wallet (sw_…)."},{"name":"status","in":"query","schema":{"enum":["pending","confirmed","dropped"]}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":20}},{"name":"starting_after","in":"query","schema":{"type":"string"},"description":"Return deposits after this id, from the previous page."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["object","data"],"properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Deposit"}},"has_more":{"type":"boolean"}}}}}},"400":{"description":"invalid_request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key (unauthorized)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"This account is suspended (account_suspended)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"webhooks":{"invoice.created":{"post":{"summary":"invoice.created","operationId":"webhook_invoice_created","parameters":[{"name":"CM-Signature","in":"header","required":true,"schema":{"type":"string"},"description":"t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" with the endpoint secret>. Reject timestamps older than five minutes."},{"name":"CM-Event-Id","in":"header","required":true,"schema":{"type":"string"},"description":"The same as id in the body, and the same on every retry. Use it to skip duplicates."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id","type","created","data"],"properties":{"id":{"type":"string","description":"Event id"},"type":{"const":"invoice.created"},"created":{"type":"integer","description":"Unix seconds"},"data":{"$ref":"#/components/schemas/Invoice"}}}}}},"responses":{"2XX":{"description":"Received. Anything else, or no reply within 10 seconds, is retried after 1, 5 and 15 minutes, then 1, 3, 6, 12 and 24 hours."}}}},"invoice.confirming":{"post":{"summary":"invoice.confirming","operationId":"webhook_invoice_confirming","parameters":[{"name":"CM-Signature","in":"header","required":true,"schema":{"type":"string"},"description":"t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" with the endpoint secret>. Reject timestamps older than five minutes."},{"name":"CM-Event-Id","in":"header","required":true,"schema":{"type":"string"},"description":"The same as id in the body, and the same on every retry. Use it to skip duplicates."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id","type","created","data"],"properties":{"id":{"type":"string","description":"Event id"},"type":{"const":"invoice.confirming"},"created":{"type":"integer","description":"Unix seconds"},"data":{"$ref":"#/components/schemas/Invoice"}}}}}},"responses":{"2XX":{"description":"Received. Anything else, or no reply within 10 seconds, is retried after 1, 5 and 15 minutes, then 1, 3, 6, 12 and 24 hours."}}}},"invoice.paid":{"post":{"summary":"invoice.paid","operationId":"webhook_invoice_paid","parameters":[{"name":"CM-Signature","in":"header","required":true,"schema":{"type":"string"},"description":"t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" with the endpoint secret>. Reject timestamps older than five minutes."},{"name":"CM-Event-Id","in":"header","required":true,"schema":{"type":"string"},"description":"The same as id in the body, and the same on every retry. Use it to skip duplicates."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id","type","created","data"],"properties":{"id":{"type":"string","description":"Event id"},"type":{"const":"invoice.paid"},"created":{"type":"integer","description":"Unix seconds"},"data":{"$ref":"#/components/schemas/Invoice"}}}}}},"responses":{"2XX":{"description":"Received. Anything else, or no reply within 10 seconds, is retried after 1, 5 and 15 minutes, then 1, 3, 6, 12 and 24 hours."}}}},"invoice.underpaid":{"post":{"summary":"invoice.underpaid","operationId":"webhook_invoice_underpaid","parameters":[{"name":"CM-Signature","in":"header","required":true,"schema":{"type":"string"},"description":"t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" with the endpoint secret>. Reject timestamps older than five minutes."},{"name":"CM-Event-Id","in":"header","required":true,"schema":{"type":"string"},"description":"The same as id in the body, and the same on every retry. Use it to skip duplicates."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id","type","created","data"],"properties":{"id":{"type":"string","description":"Event id"},"type":{"const":"invoice.underpaid"},"created":{"type":"integer","description":"Unix seconds"},"data":{"$ref":"#/components/schemas/Invoice"}}}}}},"responses":{"2XX":{"description":"Received. Anything else, or no reply within 10 seconds, is retried after 1, 5 and 15 minutes, then 1, 3, 6, 12 and 24 hours."}}}},"invoice.expired":{"post":{"summary":"invoice.expired","operationId":"webhook_invoice_expired","parameters":[{"name":"CM-Signature","in":"header","required":true,"schema":{"type":"string"},"description":"t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" with the endpoint secret>. Reject timestamps older than five minutes."},{"name":"CM-Event-Id","in":"header","required":true,"schema":{"type":"string"},"description":"The same as id in the body, and the same on every retry. Use it to skip duplicates."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id","type","created","data"],"properties":{"id":{"type":"string","description":"Event id"},"type":{"const":"invoice.expired"},"created":{"type":"integer","description":"Unix seconds"},"data":{"$ref":"#/components/schemas/Invoice"}}}}}},"responses":{"2XX":{"description":"Received. Anything else, or no reply within 10 seconds, is retried after 1, 5 and 15 minutes, then 1, 3, 6, 12 and 24 hours."}}}},"invoice.cancelled":{"post":{"summary":"invoice.cancelled","operationId":"webhook_invoice_cancelled","parameters":[{"name":"CM-Signature","in":"header","required":true,"schema":{"type":"string"},"description":"t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" with the endpoint secret>. Reject timestamps older than five minutes."},{"name":"CM-Event-Id","in":"header","required":true,"schema":{"type":"string"},"description":"The same as id in the body, and the same on every retry. Use it to skip duplicates."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id","type","created","data"],"properties":{"id":{"type":"string","description":"Event id"},"type":{"const":"invoice.cancelled"},"created":{"type":"integer","description":"Unix seconds"},"data":{"$ref":"#/components/schemas/Invoice"}}}}}},"responses":{"2XX":{"description":"Received. Anything else, or no reply within 10 seconds, is retried after 1, 5 and 15 minutes, then 1, 3, 6, 12 and 24 hours."}}}},"invoice.refunded":{"post":{"summary":"invoice.refunded","operationId":"webhook_invoice_refunded","parameters":[{"name":"CM-Signature","in":"header","required":true,"schema":{"type":"string"},"description":"t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" with the endpoint secret>. Reject timestamps older than five minutes."},{"name":"CM-Event-Id","in":"header","required":true,"schema":{"type":"string"},"description":"The same as id in the body, and the same on every retry. Use it to skip duplicates."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id","type","created","data"],"properties":{"id":{"type":"string","description":"Event id"},"type":{"const":"invoice.refunded"},"created":{"type":"integer","description":"Unix seconds"},"data":{"$ref":"#/components/schemas/Invoice"}}}}}},"responses":{"2XX":{"description":"Received. Anything else, or no reply within 10 seconds, is retried after 1, 5 and 15 minutes, then 1, 3, 6, 12 and 24 hours."}}}},"deposit.pending":{"post":{"summary":"deposit.pending","operationId":"webhook_deposit_pending","parameters":[{"name":"CM-Signature","in":"header","required":true,"schema":{"type":"string"},"description":"t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" with the endpoint secret>. Reject timestamps older than five minutes."},{"name":"CM-Event-Id","in":"header","required":true,"schema":{"type":"string"},"description":"The same as id in the body, and the same on every retry. Use it to skip duplicates."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id","type","created","data"],"properties":{"id":{"type":"string","description":"Event id"},"type":{"const":"deposit.pending"},"created":{"type":"integer","description":"Unix seconds"},"data":{"$ref":"#/components/schemas/Deposit"}}}}}},"responses":{"2XX":{"description":"Received. Anything else, or no reply within 10 seconds, is retried after 1, 5 and 15 minutes, then 1, 3, 6, 12 and 24 hours."}}}},"deposit.confirmed":{"post":{"summary":"deposit.confirmed","operationId":"webhook_deposit_confirmed","parameters":[{"name":"CM-Signature","in":"header","required":true,"schema":{"type":"string"},"description":"t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" with the endpoint secret>. Reject timestamps older than five minutes."},{"name":"CM-Event-Id","in":"header","required":true,"schema":{"type":"string"},"description":"The same as id in the body, and the same on every retry. Use it to skip duplicates."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id","type","created","data"],"properties":{"id":{"type":"string","description":"Event id"},"type":{"const":"deposit.confirmed"},"created":{"type":"integer","description":"Unix seconds"},"data":{"$ref":"#/components/schemas/Deposit"}}}}}},"responses":{"2XX":{"description":"Received. Anything else, or no reply within 10 seconds, is retried after 1, 5 and 15 minutes, then 1, 3, 6, 12 and 24 hours."}}}},"deposit.dropped":{"post":{"summary":"deposit.dropped","operationId":"webhook_deposit_dropped","parameters":[{"name":"CM-Signature","in":"header","required":true,"schema":{"type":"string"},"description":"t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" with the endpoint secret>. Reject timestamps older than five minutes."},{"name":"CM-Event-Id","in":"header","required":true,"schema":{"type":"string"},"description":"The same as id in the body, and the same on every retry. Use it to skip duplicates."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id","type","created","data"],"properties":{"id":{"type":"string","description":"Event id"},"type":{"const":"deposit.dropped"},"created":{"type":"integer","description":"Unix seconds"},"data":{"$ref":"#/components/schemas/Deposit"}}}}}},"responses":{"2XX":{"description":"Received. Anything else, or no reply within 10 seconds, is retried after 1, 5 and 15 minutes, then 1, 3, 6, 12 and 24 hours."}}}},"payout.sent":{"post":{"summary":"payout.sent","operationId":"webhook_payout_sent","parameters":[{"name":"CM-Signature","in":"header","required":true,"schema":{"type":"string"},"description":"t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" with the endpoint secret>. Reject timestamps older than five minutes."},{"name":"CM-Event-Id","in":"header","required":true,"schema":{"type":"string"},"description":"The same as id in the body, and the same on every retry. Use it to skip duplicates."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id","type","created","data"],"properties":{"id":{"type":"string","description":"Event id"},"type":{"const":"payout.sent"},"created":{"type":"integer","description":"Unix seconds"},"data":{"$ref":"#/components/schemas/Payout"}}}}}},"responses":{"2XX":{"description":"Received. Anything else, or no reply within 10 seconds, is retried after 1, 5 and 15 minutes, then 1, 3, 6, 12 and 24 hours."}}}},"payout.failed":{"post":{"summary":"payout.failed","operationId":"webhook_payout_failed","parameters":[{"name":"CM-Signature","in":"header","required":true,"schema":{"type":"string"},"description":"t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" with the endpoint secret>. Reject timestamps older than five minutes."},{"name":"CM-Event-Id","in":"header","required":true,"schema":{"type":"string"},"description":"The same as id in the body, and the same on every retry. Use it to skip duplicates."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id","type","created","data"],"properties":{"id":{"type":"string","description":"Event id"},"type":{"const":"payout.failed"},"created":{"type":"integer","description":"Unix seconds"},"data":{"$ref":"#/components/schemas/Payout"}}}}}},"responses":{"2XX":{"description":"Received. Anything else, or no reply within 10 seconds, is retried after 1, 5 and 15 minutes, then 1, 3, 6, 12 and 24 hours."}}}},"swap.completed":{"post":{"summary":"swap.completed","operationId":"webhook_swap_completed","parameters":[{"name":"CM-Signature","in":"header","required":true,"schema":{"type":"string"},"description":"t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" with the endpoint secret>. Reject timestamps older than five minutes."},{"name":"CM-Event-Id","in":"header","required":true,"schema":{"type":"string"},"description":"The same as id in the body, and the same on every retry. Use it to skip duplicates."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id","type","created","data"],"properties":{"id":{"type":"string","description":"Event id"},"type":{"const":"swap.completed"},"created":{"type":"integer","description":"Unix seconds"},"data":{"$ref":"#/components/schemas/Swap"}}}}}},"responses":{"2XX":{"description":"Received. Anything else, or no reply within 10 seconds, is retried after 1, 5 and 15 minutes, then 1, 3, 6, 12 and 24 hours."}}}}},"components":{"securitySchemes":{"secretKey":{"type":"http","scheme":"bearer","description":"A secret key from Developers in the portal (cm_live_…). Keep it on your server."}},"schemas":{"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","examples":["invalid_json","invalid_request","unauthorized","account_suspended","merchant_not_live","invalid_amount","amount_too_small","invalid_asset","asset_not_accepted","invalid_state","not_found","sticky_wallets_unavailable","server_error"]},"message":{"type":"string","description":"For people, not for matching on."}}}}},"CoinRef":{"type":"object","required":["id","symbol","network"],"properties":{"id":{"type":"string","description":"Coin id, such as USDT.TRON"},"symbol":{"type":"string"},"network":{"type":"string"}}},"Coin":{"type":"object","required":["id","symbol","name","network","decimals"],"properties":{"id":{"type":"string","examples":["ETH.ETH","USDT.ETH","USDC.ETH","BNB.BSC","USDT.BSC","USDC.BSC","POL.POLYGON","USDT.POLYGON","USDC.POLYGON","ETH.BASE","USDC.BASE","ETH.ARBITRUM","USDT.ARBITRUM","USDC.ARBITRUM","TRX.TRON","USDT.TRON","BTC.BTC","LTC.LTC","SOL.SOL","USDC.SOL","USDT.SOL","TON.TON","XRP.XRP"]},"symbol":{"type":"string"},"name":{"type":"string"},"network":{"type":"string"},"decimals":{"type":"integer"}}},"InvoiceStatus":{"enum":["open","awaiting_payment","confirming","underpaid","paid","expired","cancelled","refunded"]},"InvoiceCreate":{"type":"object","required":["amount"],"properties":{"amount":{"type":["number","string"],"description":"The price, worth at least 0.50 US dollars. At most 10,000,000."},"currency":{"type":"string","minLength":3,"maxLength":10,"description":"The currency of amount."},"description":{"type":"string","maxLength":300},"order_id":{"type":"string","maxLength":120},"customer_email":{"type":"string","format":"email"},"customer_name":{"type":"string","maxLength":120},"redirect_url":{"type":"string","format":"uri"},"metadata":{"type":"object","additionalProperties":true,"description":"At most 4 KB. Returned unchanged."},"coin":{"type":"string","description":"Pre-select a coin id from GET /coins."}}},"Invoice":{"type":"object","properties":{"id":{"type":"string","description":"Invoice id (inv_…)"},"object":{"const":"invoice"},"status":{"$ref":"#/components/schemas/InvoiceStatus"},"amount":{"type":"string","description":"The price you asked for"},"currency":{"type":"string"},"amount_usd":{"type":"string"},"description":{"type":["string","null"]},"order_id":{"type":["string","null"]},"customer_email":{"type":["string","null"]},"metadata":{"type":"object","additionalProperties":true},"coin":{"oneOf":[{"$ref":"#/components/schemas/CoinRef"},{"type":"null"}],"description":"The coin paid or selected"},"requested_coin":{"oneOf":[{"$ref":"#/components/schemas/CoinRef"},{"type":"null"}],"description":"Set when the customer paid in another coin or network and it was counted"},"pay_address":{"type":["string","null"]},"pay_amount":{"type":["string","null"],"description":"The exact amount the customer is asked to send, including network_fee_amount"},"network_fee_amount":{"type":"string","description":"The gas fee the customer pays for moving this payment, in the coin. Part of pay_amount; not your revenue"},"network_fee_usd":{"type":"string"},"rate_usd":{"type":["string","null"]},"received_amount":{"type":"string"},"received_usd":{"type":"string"},"overpaid_amount":{"type":"string","description":"Extra sent above the invoice, held for the customer to withdraw from the invoice page"},"refunded_amount":{"type":"string","description":"The total refunded"},"checkout_url":{"type":"string","format":"uri"},"redirect_url":{"type":["string","null"]},"expires_at":{"type":"string","format":"date-time"},"paid_at":{"type":["string","null"],"format":"date-time"},"created_at":{"type":"string","format":"date-time"}}},"PaymentLinkCreate":{"type":"object","required":["title"],"properties":{"title":{"type":"string","minLength":1,"maxLength":120},"amount":{"type":["number","string"],"description":"Leave out to let the customer enter the amount."},"currency":{"type":"string","minLength":3,"maxLength":10,"default":"USD"},"description":{"type":"string","maxLength":300}}},"PaymentLink":{"type":"object","properties":{"id":{"type":"string"},"object":{"const":"payment_link"},"title":{"type":"string"},"description":{"type":["string","null"]},"amount":{"type":["string","null"]},"currency":{"type":"string"},"active":{"type":"boolean"},"url":{"type":"string","format":"uri"},"created_at":{"type":"string","format":"date-time"}}},"Balances":{"type":"object","properties":{"object":{"const":"balance"},"data":{"type":"array","items":{"type":"object","properties":{"coin":{"type":"string","description":"Coin id"},"symbol":{"type":"string"},"network":{"type":"string"},"amount":{"type":"string"},"usd":{"type":"string"}}}},"total_usd":{"type":"string"},"gas_balance_usd":{"type":"string","description":"Prepaid US dollars for gas fees. Can't be withdrawn as cash"}}},"StickyWalletCreate":{"type":"object","required":["reference"],"properties":{"reference":{"type":"string","minLength":1,"maxLength":120,"description":"Your own id for this customer."},"label":{"type":["string","null"],"maxLength":120},"metadata":{"type":["object","null"],"additionalProperties":true,"description":"At most 4 KB."}}},"StickyWallet":{"type":"object","properties":{"id":{"type":"string","description":"Sticky wallet id (sw_…)"},"object":{"const":"sticky_wallet"},"reference":{"type":"string"},"label":{"type":["string","null"]},"metadata":{"type":"object","additionalProperties":true},"addresses":{"type":"array","items":{"type":"object","properties":{"network":{"type":"string"},"address":{"type":"string"},"coins":{"type":"array","items":{"$ref":"#/components/schemas/CoinRef"}}}}},"pending_networks":{"type":"array","items":{"type":"string"},"description":"Networks whose address is still being made."},"created_at":{"type":"string","format":"date-time"}}},"Deposit":{"type":"object","properties":{"id":{"type":"string"},"object":{"const":"deposit"},"status":{"enum":["pending","confirmed","dropped"]},"sticky_wallet":{"type":["object","null"],"additionalProperties":true},"coin":{"$ref":"#/components/schemas/CoinRef"},"address":{"type":"string"},"amount":{"type":"string"},"amount_usd":{"type":"string"},"fee":{"type":"string"},"net_amount":{"type":["string","null"],"description":"amount minus fee, once credited"},"from_address":{"type":["string","null"]},"tx_hash":{"type":"string"},"explorer_url":{"type":["string","null"]},"confirmations":{"type":"integer"},"detected_at":{"type":"string","format":"date-time"},"confirmed_at":{"type":["string","null"],"format":"date-time"}}},"Swap":{"type":"object","description":"Sent in swap.completed, when a swap into your holding coin finishes.","properties":{"id":{"type":"string"},"object":{"const":"swap"},"from":{"type":"string","description":"Coin id"},"to":{"type":"string","description":"Coin id"},"amount_in":{"type":"string"},"amount_out":{"type":"string"},"destination":{"type":"string","description":"\"pool\", or the address the swapped coins were sent to"},"tx_hash":{"type":["string","null"]}}},"Payout":{"type":"object","description":"Sent in payout.sent and payout.failed. Payouts are made in the portal.","properties":{"id":{"type":"string"},"object":{"const":"payout"},"coin":{"type":"string","description":"Coin id"},"amount":{"type":"string"},"network_fee":{"type":"string"},"to_address":{"type":"string"},"status":{"type":"string"},"tx_hash":{"type":["string","null"]},"auto":{"type":"boolean"},"partner_share":{"type":"boolean"},"created_at":{"type":"string","format":"date-time"}}}}}}