{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/porkbun-com/json-schema/porkbun-com-create-domain-request-schema.json",
  "title": "CreateDomainRequest",
  "x-generated": "2026-11-21",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/porkbun-com-openapi.json#/components/schemas/CreateDomainRequest",
  "type": "object",
  "required": [
    "apikey",
    "secretapikey",
    "cost",
    "agreeToTerms"
  ],
  "properties": {
    "apikey": {
      "type": "string"
    },
    "secretapikey": {
      "type": "string"
    },
    "cost": {
      "type": "integer",
      "description": "The registration cost in pennies (USD cents). Must exactly equal the total price for the domain at its minimum registration duration. Obtain this from /domain/checkDomain first."
    },
    "agreeToTerms": {
      "type": "string",
      "enum": [
        "yes",
        "1"
      ],
      "description": "Must be 'yes' or '1' to confirm agreement to the Domain Name Registration Agreement, Product Terms of Service, Data Processing Addendum, Privacy Policy, and automatic renewal terms."
    },
    "idnLanguage": {
      "type": "string",
      "description": "Required for an internationalized domain name (IDN) under a TLD whose registry needs its language: a code or language name from `idnLanguages`, as returned by /domain/checkDomain or by the IDN_LANGUAGE_REQUIRED error (any case). Ignored for plain ASCII names."
    },
    "whoisPrivacy": {
      "type": "boolean",
      "description": "Optional. Override WHOIS privacy for this registration. When omitted, the account-level default is used (set under Account Security Settings on porkbun.com/account — defaults to enabled). Pass `true` to force-enable privacy or `false` to register with public contact info. Strings `\"on\"`/`\"off\"`, `\"true\"`/`\"false\"`, `\"yes\"`/`\"no\"`, `\"1\"`/`\"0\"` are also accepted. Has no effect on TLDs that don't support WHOIS privacy (privacy stays off regardless)."
    },
    "payWith": {
      "type": "string",
      "enum": [
        "usdc",
        "card"
      ],
      "description": "Optional. `\"usdc\"` pays for this purchase directly in USDC on Base over x402 instead of from account credit. The first call answers HTTP 402 (`PAYMENT_REQUIRED`) with Coinbase's terms in the `PAYMENT-REQUIRED` header and charges nothing; an x402 client pays and repeats the same request with a `PAYMENT-SIGNATURE` header, and the purchase completes in that call. If it then fails, the payment stays on the account as account credit; it is not sent back to the wallet. If your wallet pays URLs itself instead, pay the 402's `x402Url` (or have a person pay `payUrl`) and repeat the request with `usdcCheckoutId`. See the guide: https://porkbun.com/llms/guides/pay-with-usdc-x402. `\"card\"` pays by card through a Stripe Link agent wallet over MPP instead, with a real hold: the 402 carries a single-use `payUrl` and a `cardPaymentId`; pay the link (it authorizes, not charges), then repeat with `cardPaymentId`; the hold is captured if the purchase succeeds and released if it fails. Guide: https://porkbun.com/llms/guides/pay-with-card-mpp"
    },
    "usdcCheckoutId": {
      "type": "string",
      "description": "With `payWith: \"usdc\"`: the `checkoutId` from an earlier `PAYMENT_REQUIRED`, once its `x402Url` or `payUrl` has been paid. Send it with otherwise the same request; the purchase completes if the checkout is paid and was opened for this purchase."
    },
    "cardPaymentId": {
      "type": "string",
      "description": "With `payWith: \"card\"`: the `cardPaymentId` from an earlier `PAYMENT_REQUIRED`, once its `payUrl` has been paid (the card is then held). Send it with otherwise the same request; the hold is captured if the purchase succeeds and released if not."
    },
    "dryRun": {
      "type": "boolean",
      "description": "Optional. When true, runs all pre-flight validation (availability, pricing, cost match, eligibility, funds, monthly spend limit, including the $100 default when none is set) and returns a preview with `dryRun: true` and `wouldSucceed` WITHOUT creating an order or charging. Nothing is registered and the rate-limit budget is not consumed. Use it to safely confirm an operation before committing."
    }
  }
}