{"openapi":"3.1.0","info":{"title":"Inlet","version":"1","description":"Crypto payments: create a payment in USD, the payer picks a network and coin, Inlet watches the chain and sends signed webhooks. Guide: /docs/integrate.md"},"servers":[{"url":"https://api.inlet.cash/v1"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"inl_test_… or inl_live_…"}},"schemas":{"Payment":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["waiting","detected","confirming","paid","underpaid","expired","late","refunded","cancelled"]},"price_amount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"price_currency":{"type":"string","const":"USD"},"order_id":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"checkout_url":{"type":"string"},"expires_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"paid_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]},"paid_attempt_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"success_url":{"anyOf":[{"type":"string"},{"type":"null"}]},"cancel_url":{"anyOf":[{"type":"string"},{"type":"null"}]},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"attempts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"chain":{"type":"string"},"token":{"type":"string"},"symbol":{"anyOf":[{"type":"string"},{"type":"null"}]},"address":{"type":"string"},"pay_amount":{"type":"string","pattern":"^\\d+$"},"pay_amount_display":{"type":"string"},"received_amount":{"type":"string","pattern":"^\\d+$"},"received_amount_display":{"type":"string"},"rate":{"type":"string"},"rate_source":{"type":"string","enum":["squidlor","coingecko","peg"]},"status":{"type":"string","enum":["waiting","detected","confirming","paid","underpaid","expired","late","refunded"]},"overpaid":{"type":"boolean"},"wrong_asset":{"type":"boolean"},"confirmation_tier":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"confirmations_required":{"anyOf":[{"anyOf":[{"type":"number"},{"type":"string"}]},{"type":"null"}]},"expires_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"uri":{"anyOf":[{"type":"string"},{"type":"null"}]},"deposits":{"type":"array","items":{"type":"object","properties":{"tx_hash":{"type":"string"},"token":{"type":"string"},"amount":{"type":"string","pattern":"^\\d+$"},"amount_display":{"type":"string"},"from":{"anyOf":[{"type":"string"},{"type":"null"}]},"block_number":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string","enum":["pending","confirmed","final","orphaned"]},"confirmations":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"explorer_url":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["tx_hash","token","amount","amount_display","from","block_number","status","confirmations","explorer_url"]}}},"required":["id","chain","token","symbol","address","pay_amount","pay_amount_display","received_amount","received_amount_display","rate","rate_source","status","overpaid","wrong_asset","confirmation_tier","confirmations_required","expires_at","uri","deposits"]}}},"required":["id","status","price_amount","price_currency","order_id","description","checkout_url","expires_at","paid_at","paid_attempt_id","success_url","cancel_url","metadata","created_at","attempts"]},"Error":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]},"CreatePayment":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"price_amount":{"type":"integer","minimum":1,"maximum":100000000},"price_currency":{"type":"string","const":"USD"},"order_id":{"type":"string","minLength":1,"maxLength":128},"description":{"type":"string","maxLength":500},"chain":{"type":"string"},"token":{"type":"string"},"success_url":{"type":"string","maxLength":2048,"format":"uri"},"cancel_url":{"type":"string","maxLength":2048,"format":"uri"},"webhook_url":{"type":"string","maxLength":2048,"format":"uri"},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["price_amount","price_currency","order_id"],"additionalProperties":false},"PaymentLink":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","pattern":"^lnk_[0-9A-Z]{26}$"},"slug":{"type":"string","pattern":"^[0-9a-z]{12}$"},"url":{"type":"string"},"kind":{"type":"string","enum":["fixed","open","tip","pos"]},"title":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"amount_usd_cents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"min_usd_cents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"max_usd_cents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"presets_usd_cents":{"type":"array","items":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"collect_email":{"type":"boolean"},"success_url":{"anyOf":[{"type":"string"},{"type":"null"}]},"max_uses":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"uses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"expires_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]},"active":{"type":"boolean"},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},"required":["id","slug","url","kind","title","description","amount_usd_cents","min_usd_cents","max_usd_cents","presets_usd_cents","collect_email","success_url","max_uses","uses","expires_at","active","created_at"]},"CreateLink":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"kind":{"type":"string","enum":["fixed","open","tip","pos"]},"title":{"type":"string","minLength":1,"maxLength":120},"description":{"type":"string","maxLength":500},"amount_usd_cents":{"type":"integer","minimum":100,"maximum":100000000},"min_usd_cents":{"type":"integer","minimum":100,"maximum":100000000},"max_usd_cents":{"type":"integer","minimum":100,"maximum":100000000},"presets_usd_cents":{"maxItems":6,"type":"array","items":{"type":"integer","minimum":100,"maximum":100000000}},"collect_email":{"type":"boolean"},"success_url":{"type":"string","maxLength":2048,"format":"uri"},"max_uses":{"type":"integer","minimum":1,"maximum":1000000},"expires_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},"required":["kind","title"],"additionalProperties":false},"PatchLink":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"active":{"type":"boolean"},"title":{"type":"string","minLength":1,"maxLength":120},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"success_url":{"anyOf":[{"type":"string","maxLength":2048,"format":"uri"},{"type":"null"}]},"max_uses":{"anyOf":[{"type":"integer","minimum":1,"maximum":1000000},{"type":"null"}]},"expires_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]}},"additionalProperties":false},"Statement":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"month":{"type":"string","pattern":"^\\d{4}-\\d{2}$"},"from":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"to":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"opening_balance_usd_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"closing_balance_usd_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"payments":{"type":"object","properties":{"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"gross_usd_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["count","gross_usd_cents"]},"credits":{"type":"object","properties":{"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"value_usd_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"fee_usd_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"net_usd_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["count","value_usd_cents","fee_usd_cents","net_usd_cents"]},"held":{"type":"object","properties":{"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"value_usd_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["count","value_usd_cents"]},"conversions":{"type":"object","properties":{"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"value_usd_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"swap_fee_usd_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"fee_usd_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"net_usd_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["count","value_usd_cents","swap_fee_usd_cents","fee_usd_cents","net_usd_cents"]},"reversals":{"type":"object","properties":{"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"net_usd_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["count","net_usd_cents"]},"clawback_change_usd_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"payouts":{"type":"object","properties":{"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"usd_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"requested_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"requested_usd_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"sent_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"usd_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"token":{"type":"string"},"symbol":{"type":"string"},"amount_display":{"type":"string"},"destination":{"type":"string"},"tx_hash":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","sent_at","usd_cents","token","symbol","amount_display","destination","tx_hash"]}}},"required":["count","usd_cents","requested_count","requested_usd_cents","items"]},"by_coin":{"type":"array","items":{"type":"object","properties":{"token":{"type":"string"},"symbol":{"type":"string"},"chain":{"type":"string"},"payments":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"received_display":{"type":"string"},"value_usd_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["token","symbol","chain","payments","received_display","value_usd_cents"]}},"reconciliation_gap_usd_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["month","from","to","opening_balance_usd_cents","closing_balance_usd_cents","payments","credits","held","conversions","reversals","clawback_change_usd_cents","payouts","by_coin","reconciliation_gap_usd_cents"]},"TaxInvoice":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"payment_id":{"type":"string"},"number":{"type":"string"},"issued_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"customer":{"type":"object","properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"tax_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"state_code":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["name","tax_id","state_code"]},"place_of_supply":{"type":"string","enum":["intra","inter"]},"currency":{"type":"string"},"fx":{"type":"object","properties":{"rate":{"type":"string"},"source":{"type":"string"},"date":{"type":"string"}},"required":["rate","source","date"]},"usd_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total":{"type":"string"},"taxable":{"type":"string"},"cgst":{"type":"string"},"sgst":{"type":"string"},"igst":{"type":"string"},"tax_rate_bps":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"tax_inclusive":{"type":"boolean"},"sac":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"seller":{"type":"object","properties":{"name":{"type":"string"},"legal_name":{"anyOf":[{"type":"string"},{"type":"null"}]},"tax_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"address":{"anyOf":[{"type":"string"},{"type":"null"}]},"state_code":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["name","legal_name","tax_id","address","state_code"]},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},"required":["id","payment_id","number","issued_at","customer","place_of_supply","currency","fx","usd_cents","total","taxable","cgst","sgst","igst","tax_rate_bps","tax_inclusive","sac","description","seller","created_at"]},"CreateInvoice":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"customer_name":{"type":"string","maxLength":200},"customer_tax_id":{"type":"string","maxLength":40},"customer_state_code":{"type":"string","pattern":"^[0-9]{2}$"},"place_of_supply":{"type":"string","enum":["intra","inter"]},"fx_rate":{"type":"string","pattern":"^\\d{1,5}(\\.\\d{1,6})?$"}},"required":["place_of_supply"],"additionalProperties":false},"Disbursement":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","pattern":"^dsb_[0-9A-Z]{26}$"},"merchant_id":{"type":"string","pattern":"^mer_[0-9A-Z]{26}$"},"token":{"type":"string"},"symbol":{"type":"string"},"chain":{"type":"string"},"title":{"type":"string"},"status":{"type":"string","enum":["pending_approval","approved","released","cancelled"]},"total_usd_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"item_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"approvals_required":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"approvals":{"type":"array","items":{"type":"object","properties":{"user_id":{"type":"string"},"approved_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},"required":["user_id","approved_at"]}},"approval_mac":{"anyOf":[{"type":"string"},{"type":"null"}]},"released_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]},"released_by":{"anyOf":[{"type":"string"},{"type":"null"}]},"cancelled_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]},"created_by":{"type":"string"},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"items":{"type":"array","items":{"type":"object","properties":{"item_no":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"destination":{"type":"string"},"usd_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"amount":{"type":"string","pattern":"^\\d+$"},"amount_display":{"type":"string"},"label":{"anyOf":[{"type":"string"},{"type":"null"}]},"payout":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["pending","signed","broadcast","sent","failed"]},"tx_hash":{"anyOf":[{"type":"string"},{"type":"null"}]},"error":{"anyOf":[{"type":"string"},{"type":"null"}]},"sent_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]}},"required":["id","status","tx_hash","error","sent_at"]},{"type":"null"}]}},"required":["item_no","destination","usd_cents","amount","amount_display","label","payout"]}},"progress":{"type":"object","properties":{"sent":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"failed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"open":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["sent","failed","open"]}},"required":["id","merchant_id","token","symbol","chain","title","status","total_usd_cents","item_count","approvals_required","approvals","approval_mac","released_at","released_by","cancelled_at","created_by","created_at","items","progress"]},"CreateDisbursement":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":120},"items":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"object","properties":{"destination":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$"},"usd_cents":{"type":"integer","minimum":100,"maximum":500000},"label":{"type":"string","maxLength":120}},"required":["destination","usd_cents"],"additionalProperties":false}}},"required":["title","items"],"additionalProperties":false},"Subscription":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","pattern":"^sub_[0-9A-Z]{26}$"},"merchant_id":{"type":"string","pattern":"^mer_[0-9A-Z]{26}$"},"customer":{"type":"object","properties":{"email":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["email","name"]},"title":{"type":"string"},"amount_usd_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"interval":{"type":"string","enum":["week","month","year"]},"interval_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"grace_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"status":{"type":"string","enum":["active","past_due","cancelled"]},"started_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"next_due_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"periods_invoiced":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"periods_paid":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"last_payment_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"success_url":{"anyOf":[{"type":"string"},{"type":"null"}]},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"cancelled_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"invoices":{"type":"array","items":{"type":"object","properties":{"payment_id":{"type":"string"},"period":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"status":{"type":"string","enum":["waiting","detected","confirming","paid","underpaid","expired","late","refunded","cancelled"]},"amount_usd_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"checkout_url":{"type":"string"},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"expires_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"paid_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]}},"required":["payment_id","period","status","amount_usd_cents","checkout_url","created_at","expires_at","paid_at"]}}},"required":["id","merchant_id","customer","title","amount_usd_cents","interval","interval_count","grace_days","status","started_at","next_due_at","periods_invoiced","periods_paid","last_payment_id","success_url","metadata","cancelled_at","created_at","invoices"]},"CreateSubscription":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"customer_email":{"type":"string","maxLength":254},"customer_name":{"type":"string","maxLength":200},"title":{"type":"string","minLength":1,"maxLength":120},"amount_usd_cents":{"type":"integer","minimum":100,"maximum":100000000},"interval":{"type":"string","enum":["week","month","year"]},"interval_count":{"type":"integer","minimum":1,"maximum":12},"grace_days":{"type":"integer","minimum":0,"maximum":30},"start_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"success_url":{"type":"string","maxLength":2048,"format":"uri"},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["customer_email","title","amount_usd_cents","interval"],"additionalProperties":false},"Event":{"type":"object","required":["id","type","created_at","data"],"properties":{"id":{"type":"string"},"type":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"string","enum":["payment.detected","payment.confirming","payment.paid","payment.underpaid","payment.overpaid","payment.expired","payment.late","payment.wrong_asset","payment.reorged","payment.refunded","payment.cancelled"]},"created_at":{"type":"string","format":"date-time"},"data":{"$ref":"#/components/schemas/Payment"}}}}},"webhooks":{"paymentEvent":{"post":{"summary":"Sent to your webhook_url on every payment change","description":"Verify Inlet-Signature (t=<unix>,v1=<hex HMAC-SHA256 of '<t>.<raw body>'>) with your webhook secret before trusting it. Delivered at least once; deduplicate on id. Retries at 1m, 5m, 30m, 2h, 6h, 12h.","parameters":[{"name":"Inlet-Signature","in":"header","required":true,"schema":{"type":"string"}},{"name":"Inlet-Event-Id","in":"header","required":true,"schema":{"type":"string"}},{"name":"Inlet-Event-Type","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"responses":{"200":{"description":"Any 2xx within 10 s acknowledges it"}}}}},"paths":{"/payments":{"post":{"summary":"Create a payment","parameters":[{"name":"Idempotency-Key","in":"header","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePayment"}}}},"responses":{"200":{"description":"Replayed (same Idempotency-Key and body)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Payment"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Payment"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"401":{"description":"Missing or bad key","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"422":{"description":"Not possible for this payment","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"503":{"description":"Price or chain unavailable","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}}}},"get":{"summary":"List payments","parameters":[{"name":"order_id","in":"query","schema":{"type":"string"}},{"name":"status","in":"query","schema":{"type":"string"}},{"name":"cursor","in":"query","schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"integer"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Payment"}},"next_cursor":{"type":["string","null"]}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"401":{"description":"Missing or bad key","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"422":{"description":"Not possible for this payment","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"503":{"description":"Price or chain unavailable","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}}}}},"/payments/{id}":{"get":{"summary":"Get a payment (the source of truth)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^pay_[0-9A-Z]{36}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Payment"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"401":{"description":"Missing or bad key","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"422":{"description":"Not possible for this payment","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"503":{"description":"Price or chain unavailable","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}}}}},"/payments/{id}/attempts":{"post":{"summary":"Issue an address for a chain and token","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^pay_[0-9A-Z]{36}$"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"chain":{"type":"string"},"token":{"type":"string"}},"required":["chain","token"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Payment"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"401":{"description":"Missing or bad key","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"422":{"description":"Not possible for this payment","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"503":{"description":"Price or chain unavailable","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}}}}},"/payments/{id}/cancel":{"post":{"summary":"Cancel before any money is seen","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^pay_[0-9A-Z]{36}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Payment"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"401":{"description":"Missing or bad key","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"422":{"description":"Not possible for this payment","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"503":{"description":"Price or chain unavailable","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}}}}},"/payments/{id}/accept":{"post":{"summary":"Accept an underpaid or late payment","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^pay_[0-9A-Z]{36}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Payment"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"401":{"description":"Missing or bad key","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"422":{"description":"Not possible for this payment","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"503":{"description":"Price or chain unavailable","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}}}}},"/payments/{id}/refund":{"post":{"summary":"Request a refund","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^pay_[0-9A-Z]{36}$"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"destination":{"type":"string"},"note":{"type":"string"}},"required":["destination"]}}}},"responses":{"202":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"401":{"description":"Missing or bad key","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"422":{"description":"Not possible for this payment","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"503":{"description":"Price or chain unavailable","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}}}}},"/links":{"post":{"summary":"Create a payment link (fixed price, open amount, or tip jar)","description":"A reusable public page at `url`. Opening it creates an ordinary payment (order_id `<slug>-<n>`, metadata.link_id) that your webhooks and lists see like any other.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateLink"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentLink"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"401":{"description":"Missing or bad key","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"422":{"description":"Not possible for this payment","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"503":{"description":"Price or chain unavailable","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}}}},"get":{"summary":"List payment links (newest first, at most 500)","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/PaymentLink"}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"401":{"description":"Missing or bad key","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"422":{"description":"Not possible for this payment","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"503":{"description":"Price or chain unavailable","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}}}}},"/links/{id}":{"get":{"summary":"Get a payment link","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^lnk_[0-9A-Z]{26}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentLink"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"401":{"description":"Missing or bad key","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"422":{"description":"Not possible for this payment","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"503":{"description":"Price or chain unavailable","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}}}},"patch":{"summary":"Switch a link off or on, or change its title, description, success URL, limit or expiry","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^lnk_[0-9A-Z]{26}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PatchLink"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentLink"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"401":{"description":"Missing or bad key","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"422":{"description":"Not possible for this payment","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"503":{"description":"Price or chain unavailable","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}}}}},"/exports/payments":{"get":{"summary":"Export payments (CSV or JSON) with the USD rate at payment time and the credit, fee and net","parameters":[{"name":"from","in":"query","required":true,"schema":{"type":"string","format":"date-time"}},{"name":"to","in":"query","required":true,"schema":{"type":"string","format":"date-time"}},{"name":"format","in":"query","schema":{"type":"string","enum":["csv","json"]}}],"responses":{"200":{"description":"text/csv (attachment) or { columns, rows }"},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"401":{"description":"Missing or bad key","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"422":{"description":"Not possible for this payment","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"503":{"description":"Price or chain unavailable","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}}}}},"/statements/{month}":{"get":{"summary":"The month's statement (YYYY-MM, UTC): balances, credits, fees, conversions, payouts; reconciles to the balance","parameters":[{"name":"month","in":"path","required":true,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Statement"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"401":{"description":"Missing or bad key","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"422":{"description":"Not possible for this payment","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"503":{"description":"Price or chain unavailable","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}}}}},"/payments/{id}/invoice":{"get":{"summary":"The payment's GST tax invoice","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^pay_[0-9A-Z]{36}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaxInvoice"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"401":{"description":"Missing or bad key","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"422":{"description":"Not possible for this payment","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"503":{"description":"Price or chain unavailable","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}}}},"post":{"summary":"Issue the one GST tax invoice a paid payment can have (Indian merchants; needs the tax profile)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^pay_[0-9A-Z]{36}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateInvoice"}}}},"responses":{"201":{"description":"Issued","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaxInvoice"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"401":{"description":"Missing or bad key","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"422":{"description":"Not possible for this payment","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"503":{"description":"Price or chain unavailable","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}}}}},"/disbursements":{"post":{"summary":"A mass payout: up to 500 recipients in your payout coin, from your balance (approved and released on the dashboard)","description":"Owners approve it there (two from the two-person threshold up) and release it; the signer verifies the approval on every item. Items are sent one at a time; each becomes a payout.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateDisbursement"}}}},"responses":{"201":{"description":"Created, waiting for approval","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Disbursement"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"401":{"description":"Missing or bad key","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"422":{"description":"Not possible for this payment","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"503":{"description":"Price or chain unavailable","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}}}},"get":{"summary":"List disbursements (newest first, items included)","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Disbursement"}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"401":{"description":"Missing or bad key","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"422":{"description":"Not possible for this payment","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"503":{"description":"Price or chain unavailable","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}}}}},"/disbursements/{id}":{"get":{"summary":"A disbursement with its items and progress","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^dsb_[0-9A-Z]{26}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Disbursement"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"401":{"description":"Missing or bad key","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"422":{"description":"Not possible for this payment","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"503":{"description":"Price or chain unavailable","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}}}}},"/disbursements/{id}/cancel":{"post":{"summary":"Cancel before release, or drop the items still pending after it","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^dsb_[0-9A-Z]{26}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Disbursement"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"401":{"description":"Missing or bad key","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"422":{"description":"Not possible for this payment","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"503":{"description":"Price or chain unavailable","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}}}}},"/subscriptions":{"post":{"summary":"A subscription: each period Inlet invoices the customer (a hosted payment that lives until the grace period ends) and emails the link","description":"A schedule, not a mandate: the customer pays each invoice (one signature on USDC). Paid on time keeps it active; unpaid past the grace period makes it past_due. Invoices arrive in your webhooks as payments with metadata.subscription_id and period.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSubscription"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Subscription"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"401":{"description":"Missing or bad key","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"422":{"description":"Not possible for this payment","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"503":{"description":"Price or chain unavailable","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}}}},"get":{"summary":"List subscriptions (newest first, invoices included)","parameters":[{"name":"status","in":"query","schema":{"type":"string","enum":["active","past_due","cancelled"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Subscription"}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"401":{"description":"Missing or bad key","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"422":{"description":"Not possible for this payment","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"503":{"description":"Price or chain unavailable","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}}}}},"/subscriptions/{id}":{"get":{"summary":"A subscription with its invoices","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^sub_[0-9A-Z]{26}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Subscription"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"401":{"description":"Missing or bad key","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"422":{"description":"Not possible for this payment","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"503":{"description":"Price or chain unavailable","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}}}}},"/subscriptions/{id}/cancel":{"post":{"summary":"Stop invoicing; an open unpaid invoice is cancelled","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^sub_[0-9A-Z]{26}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Subscription"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"401":{"description":"Missing or bad key","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"422":{"description":"Not possible for this payment","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"503":{"description":"Price or chain unavailable","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}}}}},"/currencies":{"get":{"summary":"Networks and coins available now","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"401":{"description":"Missing or bad key","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"422":{"description":"Not possible for this payment","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"503":{"description":"Price or chain unavailable","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}}}}},"/estimate":{"get":{"summary":"Preview the amount for a token","parameters":[{"name":"price_amount","in":"query","required":true,"schema":{"type":"string"}},{"name":"price_currency","in":"query","required":true,"schema":{"type":"string"}},{"name":"token","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"401":{"description":"Missing or bad key","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"422":{"description":"Not possible for this payment","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"503":{"description":"Price or chain unavailable","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}}}}},"/test/payments/{id}/simulate":{"post":{"summary":"Test mode only: drive a payment to an outcome without coins","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^pay_[0-9A-Z]{36}$"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"outcome":{"enum":["paid","underpaid","expired","late","wrong_asset"]}},"required":["outcome"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Payment"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"401":{"description":"Missing or bad key","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"422":{"description":"Not possible for this payment","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}},"503":{"description":"Price or chain unavailable","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","param"]}},"required":["error"]}}}}}}}}}