{"openapi":"3.1.0","info":{"title":"Metoda Domains API","version":"1.1.0","description":"Search, buy and manage domain names at www.metodai.com — one yearly price, renewal costs the same. Built for programs and AI assistants (also an MCP server at https://www.metodai.com/mcp). Flow: /check → /auth (code by email → api_key) → PUT /account (owner details, once) → POST /card (owner saves a card with a monthly limit, once, optional) → POST /orders (paid with the saved card, else payment_url) → GET /orders/{id}?wait=25. A domain is sent to the registry only after Stripe confirms the payment.","contact":{"name":"Metoda LLC","url":"https://www.metodai.com/contact"},"termsOfService":"https://www.metodai.com/terms"},"servers":[{"url":"https://www.metodai.com/api/v1"}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"API key mdk_… from POST /auth or https://www.metodai.com/api-keys"}}},"paths":{"/prices":{"get":{"summary":"USD per year for every extension, announced price changes (next) and the restore fee for expired domains (restore_usd)","operationId":"getPrices","security":[],"responses":{"200":{"description":"Prices: per_year, next {tld: {from, price_usd}}, restore_usd, max_years, rules","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/check":{"get":{"summary":"Check availability of a name","operationId":"checkDomains","security":[],"parameters":[{"name":"name","in":"query","required":true,"schema":{"type":"string"},"example":"pixelstudio"},{"name":"tlds","in":"query","schema":{"type":"string"},"description":"Comma-separated, max 20","example":"com,io,co"}],"responses":{"200":{"description":"name (exactly what was checked) and results [{domain, status, price_usd}]; status: available | taken | premium_not_offered | not_allowed | not_offered_now | unknown (could not check now — retry later)","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"name":{"type":"string"},"results":{"type":"array","items":{"type":"object","properties":{"domain":{"type":"string"},"status":{"type":"string","enum":["available","taken","premium_not_offered","not_allowed","not_offered_now","unknown"]},"price_usd":{"type":"number"}}}}}}}}},"400":{"description":"Invalid input (names are never changed for you: an invalid name is refused with a suggestion)","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"401":{"description":"Missing or wrong API key","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"405":{"description":"Method not used on this path (see the Allow header)","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"409":{"description":"Cannot be done (taken, rule, details missing…)","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"429":{"description":"Rate limited — wait Retry-After seconds. Every response carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}}}}},"/auth":{"post":{"summary":"Sign in or create an account: email → 6-digit code by email; email + code → api_key","operationId":"signIn","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["email"],"properties":{"email":{"type":"string","format":"email"},"code":{"type":"string"},"totp":{"type":"string","description":"Only for accounts with two-step sign-in (error totp_required): current authenticator code or a backup code"},"key_name":{"type":"string"}}}}}},"responses":{"200":{"description":"Code sent, or api_key (+ mcp_url)","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid input (names are never changed for you: an invalid name is refused with a suggestion)","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"401":{"description":"Missing or wrong API key","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"405":{"description":"Method not used on this path (see the Allow header)","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"409":{"description":"Cannot be done (taken, rule, details missing…)","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"429":{"description":"Rate limited — wait Retry-After seconds. Every response carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}}}}},"/account":{"get":{"summary":"Account: owner details, saved card, key","operationId":"getAccount","security":[{"bearer":[]}],"responses":{"200":{"description":"Account","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid input (names are never changed for you: an invalid name is refused with a suggestion)","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"401":{"description":"Missing or wrong API key","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"405":{"description":"Method not used on this path (see the Allow header)","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"409":{"description":"Cannot be done (taken, rule, details missing…)","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"429":{"description":"Rate limited — wait Retry-After seconds. Every response carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}}}},"put":{"summary":"Set owner (registrant) details — only the fields given change","operationId":"setAccount","security":[{"bearer":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"kind":{"type":"string","enum":["individual","company"]},"full_name":{"type":"string"},"company":{"type":"string"},"company_no":{"type":"string"},"phone":{"type":"string","description":"With country code, e.g. +1 408 555 0100"},"street":{"type":"string"},"city":{"type":"string"},"postal":{"type":"string"},"state":{"type":"string"},"country":{"type":"string","description":"2-letter code, e.g. US"}}}}}},"responses":{"200":{"description":"Account","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid input (names are never changed for you: an invalid name is refused with a suggestion)","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"401":{"description":"Missing or wrong API key","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"405":{"description":"Method not used on this path (see the Allow header)","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"409":{"description":"Cannot be done (taken, rule, details missing…)","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"429":{"description":"Rate limited — wait Retry-After seconds. Every response carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}}}}},"/card":{"post":{"summary":"Card for automatic payments: setup_url where the owner saves a card with this monthly limit (a lower limit for a saved card applies at once)","operationId":"setupCard","security":[{"bearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["monthly_limit_usd"],"properties":{"monthly_limit_usd":{"type":"number","minimum":1,"maximum":2000}}}}}},"responses":{"200":{"description":"setup_url or the new limit","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid input (names are never changed for you: an invalid name is refused with a suggestion)","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"401":{"description":"Missing or wrong API key","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"405":{"description":"Method not used on this path (see the Allow header)","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"409":{"description":"Cannot be done (taken, rule, details missing…)","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"429":{"description":"Rate limited — wait Retry-After seconds. Every response carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}}}},"delete":{"summary":"Remove the saved card","operationId":"removeCard","security":[{"bearer":[]}],"responses":{"200":{"description":"Removed","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid input (names are never changed for you: an invalid name is refused with a suggestion)","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"401":{"description":"Missing or wrong API key","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"405":{"description":"Method not used on this path (see the Allow header)","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"409":{"description":"Cannot be done (taken, rule, details missing…)","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"429":{"description":"Rate limited — wait Retry-After seconds. Every response carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}}}}},"/orders":{"get":{"summary":"Last 25 orders","operationId":"listOrders","security":[{"bearer":[]}],"responses":{"200":{"description":"Orders","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid input (names are never changed for you: an invalid name is refused with a suggestion)","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"401":{"description":"Missing or wrong API key","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"405":{"description":"Method not used on this path (see the Allow header)","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"409":{"description":"Cannot be done (taken, rule, details missing…)","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"429":{"description":"Rate limited — wait Retry-After seconds. Every response carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}}}},"post":{"summary":"Register domains — paid with the saved card, or payment_url","operationId":"createOrder","security":[{"bearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["domains"],"properties":{"domains":{"type":"array","items":{"type":"string"},"minItems":1,"maxItems":10,"example":["pixelstudio.com"]},"years":{"type":"integer","minimum":1,"maximum":10,"default":1},"pay":{"type":"string","enum":["auto","link"],"default":"auto","description":"auto: saved card when possible (within the monthly limit), else payment_url; link: always payment_url"},"wait":{"type":"integer","minimum":0,"maximum":25,"default":20,"description":"After a card payment, seconds to wait for the registry"}}}}}},"responses":{"201":{"description":"Order","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"order":{"type":"object","description":"Fields that do not apply are left out.","properties":{"order_id":{"type":"integer"},"status":{"type":"string","enum":["awaiting_payment","payment_clearing","paid","cancelled","payment_check"]},"amount_usd":{"type":"number"},"paid_at":{"type":"string","format":"date-time"},"paid_with":{"type":"string","enum":["saved_card","stripe_checkout","paypal","bitcoin","usdc"]},"receipt_url":{"type":"string","description":"Stripe receipt"},"payment_url":{"type":"string","description":"Stripe page where the account owner pays (card or US bank account), valid one hour"},"card_not_used":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}},"next":{"type":"string","description":"What to do next"},"items":{"type":"array","items":{"type":"object","properties":{"domain":{"type":"string"},"years":{"type":"integer"},"action":{"type":"string","const":"renew"},"expires_at":{"type":"string","format":"date"},"status":{"type":"string","enum":["awaiting_payment","payment_clearing","processing","registered","renewed","failed_refund","cancelled"]}}}}}}}}}}},"400":{"description":"Invalid input (names are never changed for you: an invalid name is refused with a suggestion)","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"401":{"description":"Missing or wrong API key","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"405":{"description":"Method not used on this path (see the Allow header)","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"409":{"description":"Cannot be done (taken, rule, details missing…)","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"429":{"description":"Rate limited — wait Retry-After seconds. Every response carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}}}}},"/orders/{id}":{"get":{"summary":"Order status and payment confirmation","operationId":"getOrder","security":[{"bearer":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}},{"name":"wait","in":"query","schema":{"type":"integer","minimum":0,"maximum":25},"description":"Wait up to N seconds until it is final"}],"responses":{"200":{"description":"Order","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"order":{"type":"object","description":"Fields that do not apply are left out.","properties":{"order_id":{"type":"integer"},"status":{"type":"string","enum":["awaiting_payment","payment_clearing","paid","cancelled","payment_check"]},"amount_usd":{"type":"number"},"paid_at":{"type":"string","format":"date-time"},"paid_with":{"type":"string","enum":["saved_card","stripe_checkout","paypal","bitcoin","usdc"]},"receipt_url":{"type":"string","description":"Stripe receipt"},"payment_url":{"type":"string","description":"Stripe page where the account owner pays (card or US bank account), valid one hour"},"card_not_used":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}},"next":{"type":"string","description":"What to do next"},"items":{"type":"array","items":{"type":"object","properties":{"domain":{"type":"string"},"years":{"type":"integer"},"action":{"type":"string","const":"renew"},"expires_at":{"type":"string","format":"date"},"status":{"type":"string","enum":["awaiting_payment","payment_clearing","processing","registered","renewed","failed_refund","cancelled"]}}}}}}}}}}},"400":{"description":"Invalid input (names are never changed for you: an invalid name is refused with a suggestion)","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"401":{"description":"Missing or wrong API key","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"405":{"description":"Method not used on this path (see the Allow header)","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"409":{"description":"Cannot be done (taken, rule, details missing…)","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"429":{"description":"Rate limited — wait Retry-After seconds. Every response carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}}}}},"/domains":{"get":{"summary":"Domains of the account","operationId":"listDomains","security":[{"bearer":[]}],"responses":{"200":{"description":"Domains","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid input (names are never changed for you: an invalid name is refused with a suggestion)","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"401":{"description":"Missing or wrong API key","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"405":{"description":"Method not used on this path (see the Allow header)","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"409":{"description":"Cannot be done (taken, rule, details missing…)","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"429":{"description":"Rate limited — wait Retry-After seconds. Every response carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}}}}},"/domains/{domain}":{"get":{"summary":"Expiry, nameservers, renewal price","operationId":"getDomain","security":[{"bearer":[]}],"parameters":[{"name":"domain","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Domain","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid input (names are never changed for you: an invalid name is refused with a suggestion)","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"401":{"description":"Missing or wrong API key","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"405":{"description":"Method not used on this path (see the Allow header)","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"409":{"description":"Cannot be done (taken, rule, details missing…)","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"429":{"description":"Rate limited — wait Retry-After seconds. Every response carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}}}}},"/domains/{domain}/nameservers":{"put":{"summary":"Change nameservers","operationId":"setNameservers","security":[{"bearer":[]}],"parameters":[{"name":"domain","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["nameservers"],"properties":{"nameservers":{"type":"array","items":{"type":"string"},"minItems":2,"maxItems":4}}}}}},"responses":{"200":{"description":"Saved","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid input (names are never changed for you: an invalid name is refused with a suggestion)","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"401":{"description":"Missing or wrong API key","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"405":{"description":"Method not used on this path (see the Allow header)","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"409":{"description":"Cannot be done (taken, rule, details missing…)","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"429":{"description":"Rate limited — wait Retry-After seconds. Every response carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}}}}},"/domains/{domain}/renew":{"post":{"summary":"Renew — paid like an order","operationId":"renewDomain","security":[{"bearer":[]}],"parameters":[{"name":"domain","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"years":{"type":"integer","minimum":1,"maximum":10,"default":1},"pay":{"type":"string","enum":["auto","link"],"default":"auto","description":"auto: saved card when possible (within the monthly limit), else payment_url; link: always payment_url"},"wait":{"type":"integer","minimum":0,"maximum":25,"default":20,"description":"After a card payment, seconds to wait for the registry"}}}}}},"responses":{"201":{"description":"Order","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"order":{"type":"object","description":"Fields that do not apply are left out.","properties":{"order_id":{"type":"integer"},"status":{"type":"string","enum":["awaiting_payment","payment_clearing","paid","cancelled","payment_check"]},"amount_usd":{"type":"number"},"paid_at":{"type":"string","format":"date-time"},"paid_with":{"type":"string","enum":["saved_card","stripe_checkout","paypal","bitcoin","usdc"]},"receipt_url":{"type":"string","description":"Stripe receipt"},"payment_url":{"type":"string","description":"Stripe page where the account owner pays (card or US bank account), valid one hour"},"card_not_used":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}},"next":{"type":"string","description":"What to do next"},"items":{"type":"array","items":{"type":"object","properties":{"domain":{"type":"string"},"years":{"type":"integer"},"action":{"type":"string","const":"renew"},"expires_at":{"type":"string","format":"date"},"status":{"type":"string","enum":["awaiting_payment","payment_clearing","processing","registered","renewed","failed_refund","cancelled"]}}}}}}}}}}},"400":{"description":"Invalid input (names are never changed for you: an invalid name is refused with a suggestion)","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"401":{"description":"Missing or wrong API key","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"405":{"description":"Method not used on this path (see the Allow header)","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"409":{"description":"Cannot be done (taken, rule, details missing…)","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"429":{"description":"Rate limited — wait Retry-After seconds. Every response carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}}}
