{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/recurly/json-schema/recurly-account-schema.json",
  "title": "Account",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/recurly-v2-v2.29-api.yaml#/components/schemas/Account",
  "allOf": [
    {
      "$ref": "#/$defs/AccountMini"
    },
    {
      "properties": {
        "parent_account": {
          "type": "string",
          "description": "The URL of the parent for the specified account."
        },
        "child_accounts": {
          "type": "string",
          "description": "The URL of the child accounts for the specified account."
        },
        "bill_to": {
          "type": "string",
          "description": "`self` or `parent`. Determines whether all charges are billed using parent's billing information or the account itself.  If bill_to = parent, all invoices resulting in charges and credits originating from a child will be created on the parent account. (e.g creating a subscription on the child account will be billed to parent and invoiced on the parent account)"
        },
        "adjustments": {
          "type": "string",
          "description": "The URL of adjustments for the specified account."
        },
        "account_balance": {
          "type": "string",
          "description": "The URL of the account balance for the specified account."
        },
        "billing_info": {
          "type": "string",
          "description": "The URL of billing info for the specified account."
        },
        "invoices": {
          "type": "string",
          "description": "The URL of invoices for the specified account."
        },
        "redemption": {
          "type": "string",
          "description": "The URL of the coupon redemption for the specified account."
        },
        "subscriptions": {
          "type": "string",
          "description": "The URL of subscriptions for the specified account."
        },
        "transactions": {
          "type": "string",
          "description": "The URL of transactions for the specified account."
        },
        "notes": {
          "type": "string",
          "description": "The URL of notes on the account"
        },
        "state": {
          "type": "string",
          "description": "The state of accounts to return: `active` or `closed`."
        },
        "username": {
          "type": "string",
          "description": "The username of the account."
        },
        "cc_emails": {
          "type": "string",
          "description": "Additional email address that should receive account correspondence. These should be separated only by commas. These CC emails will receive all emails that the `email` field also receives."
        },
        "company_name": {
          "type": "string",
          "description": "The company name of the account."
        },
        "vat_number": {
          "type": "string",
          "description": "The VAT number of the account (to avoid having the VAT applied)."
        },
        "tax_exempt": {
          "type": "boolean",
          "description": "The tax status of the account. `true` exempts tax on the account, `false` applies tax on the account."
        },
        "address": {
          "type": "object",
          "description": "The nested address information of the account: `address1`, `address2`, `city`, `state`, `zip`, `country`, `phone`."
        },
        "shipping_address": {
          "type": "object",
          "description": "The nested shipping address information of the account: `first_name`, `last_name`, `company_name`, `email`, `phone`, `vat_number`,  `address1`, `address2`, `city`, `state`, `zip`, `country`, `nickname`. You can pass in up to 20 account shipping addresses along with the request to create a new account. When providing a shipping address, the following are required: first_name, last_name, address1, city, state, zip, and country."
        },
        "accept_language": {
          "type": "string",
          "description": "The ISO 639-1 language code from the user's browser, indicating their preferred language and locale. This attribute is different from `preferred_locale` and does not determine which language emails sent on behalf of the merchant."
        },
        "hosted_login_token": {
          "type": "string",
          "description": "The unique token for automatically logging the account in to the hosted management pages. You may automatically log the user into their hosted management pages by directing the user to: `https://:subdomain.recurly.com/account/:hosted_login_token`."
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "description": "The date and time the account was created in Recurly."
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "description": "The date and time the account or its billing info was last updated."
        },
        "closed_at": {
          "type": "string",
          "format": "date-time",
          "description": "For closed accounts, the date and time it was closed."
        },
        "has_live_subscription": {
          "type": "boolean",
          "description": "True if the account has at least one live subscription."
        },
        "has_active_subscription": {
          "type": "boolean",
          "description": "True if the account has at least one active subscription."
        },
        "has_future_subscription": {
          "type": "boolean",
          "description": "True if the account has at least one future subscription."
        },
        "has_canceled_subscription": {
          "type": "boolean",
          "description": "True if the account has at least one canceled subscription."
        },
        "has_paused_subscription": {
          "type": "string",
          "description": "True if the account has at least one paused subscription."
        },
        "has_past_due_invoice": {
          "type": "boolean",
          "description": "True if the account has at least one past due invoice."
        },
        "preferred_locale": {
          "type": "string",
          "description": "Used to determine the language and locale of emails sent on behalf of the merchant to the customer. The list of locales is restricted to those the merchant has enabled on the site."
        },
        "preferred_time_zone": {
          "type": "string",
          "description": "The [IANA time zone name](https://docs.recurly.com/docs/email-time-zones-and-time-stamps#supported-api-iana-time-zone-names) used to determine the time zone of emails sent on behalf of the merchant to the customer."
        },
        "dunning_campaign_id": {
          "type": "string",
          "description": "The uuid of the associated dunning campaign of the account."
        },
        "override_business_entity_id": {
          "type": "string",
          "description": "The uuid of the associated business entity of the account. Available when the `Multiple Business Entities` feature is enabled."
        },
        "custom_fields": {
          "$ref": "#/$defs/CustomFields"
        }
      }
    }
  ],
  "$defs": {
    "AccountCode": {
      "type": "string",
      "description": "The unique identifier of the account."
    },
    "AccountMini": {
      "allOf": [
        {
          "$ref": "#/$defs/AccountWithCodeOnly"
        },
        {
          "properties": {
            "first_name": {
              "allOf": [
                {
                  "$ref": "#/$defs/FirstName"
                },
                {
                  "description": "The first name of the account."
                }
              ]
            },
            "last_name": {
              "allOf": [
                {
                  "$ref": "#/$defs/LastName"
                },
                {
                  "description": "The last name of the account."
                }
              ]
            },
            "email": {
              "allOf": [
                {
                  "$ref": "#/$defs/Email"
                },
                {
                  "description": "The email address of the account."
                }
              ]
            }
          }
        }
      ]
    },
    "AccountWithCodeOnly": {
      "type": "object",
      "title": "Account",
      "required": [
        "account_code"
      ],
      "properties": {
        "account_code": {
          "$ref": "#/$defs/AccountCode"
        }
      }
    },
    "CustomField": {
      "type": "object",
      "required": [
        "name",
        "value"
      ],
      "properties": {
        "name": {
          "type": "string",
          "maxLength": 50,
          "pattern": "/^[a-z0-9_-]+$/i",
          "title": "Field name",
          "description": "Fields must be created in the UI before values can be assigned to them."
        },
        "value": {
          "type": "string",
          "maxLength": 255,
          "title": "Field value",
          "description": "Any values that resemble a credit card number or security code (CVV/CVC) will be rejected."
        }
      }
    },
    "CustomFields": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/CustomField"
      },
      "title": "Custom Fields",
      "description": "The custom fields will only be altered when they are included in a request. Sending an empty array will not remove any existing values. To remove a field send the name with a null or empty value."
    },
    "Email": {
      "type": "string",
      "maxLength": 255
    },
    "FirstName": {
      "type": "string",
      "title": "First name"
    },
    "LastName": {
      "type": "string",
      "title": "Last name"
    }
  }
}