{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/paypal/json-schema/paypal-recurring-series-schema.json",
  "title": "recurring_series",
  "description": "A recurring invoice series that automatically generates and sends invoices to customers on a scheduled basis. Contains all configuration, status, and metadata for the series.",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/paypal-recurring-invoices-api-openapi.yml#/components/schemas/recurring_series",
  "type": "object",
  "required": [
    "plan_detail",
    "recurring_info"
  ],
  "properties": {
    "id": {
      "description": "The unique identifier for the recurring invoice series. This ID is used to reference and manage the series in all API operations.",
      "type": "string",
      "minLength": 20,
      "maxLength": 20,
      "pattern": "^(RI-)[A-Z0-9]+$",
      "readOnly": true
    },
    "status": {
      "$ref": "#/$defs/recurring_status"
    },
    "plan_detail": {
      "$ref": "#/$defs/plan"
    },
    "recurring_info": {
      "$ref": "#/$defs/recurring_info"
    },
    "metadata": {
      "allOf": [
        {
          "$ref": "#/$defs/recurring_metadata"
        },
        {
          "description": "Audit and tracking information for the recurring series, including creation timestamp, last update timestamp and cancellation information if applicable."
        }
      ]
    },
    "links": {
      "description": "An array of request-related [HATEOAS links](/docs/api/reference/api-responses/#hateoas-links).",
      "type": "array",
      "minItems": 1,
      "maxItems": 5,
      "readOnly": true,
      "items": {
        "allOf": [
          {
            "$ref": "#/$defs/link_description"
          },
          {
            "title": "link_description"
          }
        ]
      }
    }
  },
  "$defs": {
    "address_portable": {
      "title": "Portable Postal Address (Medium-Grained)",
      "description": "The portable international postal address. Maps to [AddressValidationMetadata](https://github.com/googlei18n/libaddressinput/wiki/AddressValidationMetadata) and HTML 5.1 [Autofilling form controls: the autocomplete attribute](https://www.w3.org/TR/html51/sec-forms.html#autofilling-form-controls-the-autocomplete-attribute).",
      "type": "object",
      "required": [
        "country_code"
      ],
      "properties": {
        "address_line_1": {
          "description": "The first line of the address, such as number and street, for example, `173 Drury Lane`. Needed for data entry, and Compliance and Risk checks. This field needs to pass the full address.",
          "type": "string",
          "minLength": 0,
          "maxLength": 300,
          "pattern": "^.*$"
        },
        "address_line_2": {
          "description": "The second line of the address, for example, a suite or apartment number.",
          "type": "string",
          "minLength": 0,
          "maxLength": 300,
          "pattern": "^.*$"
        },
        "address_line_3": {
          "description": "The third line of the address, if needed. Examples include a street complement for Brazil, direction text, such as `next to Walmart`, or a landmark in an Indian address.",
          "type": "string",
          "minLength": 0,
          "maxLength": 100,
          "pattern": "^.*$"
        },
        "admin_area_4": {
          "description": "The neighborhood, ward, or district. This is smaller than `admin_area_level_3` or `sub_locality`. Value is:<ul><li>The postal sorting code that is used in Guernsey and many French territories, such as French Guiana.</li><li>The fine-grained administrative levels in China.</li></ul>",
          "type": "string",
          "minLength": 0,
          "maxLength": 100,
          "pattern": "^.*$"
        },
        "admin_area_3": {
          "description": "The sub-locality, suburb, neighborhood, or district. This is smaller than `admin_area_level_2`. Value is:<ul><li>Brazil. Suburb, *bairro*, or neighborhood.</li><li>India. Sub-locality or district. Street name information isn't always available, but a sub-locality or district can be a very small area.</li></ul>",
          "type": "string",
          "minLength": 0,
          "maxLength": 100,
          "pattern": "^.*$"
        },
        "admin_area_2": {
          "description": "A city, town, or village. Smaller than `admin_area_level_1`.",
          "type": "string",
          "minLength": 0,
          "maxLength": 120,
          "pattern": "^.*$"
        },
        "admin_area_1": {
          "description": "The highest-level sub-division in a country, which is usually a province, state, or ISO-3166-2 subdivision. This data is formatted for postal delivery, for example, `CA` and not `California`. Value, by country, is:<ul><li>UK. A county.</li><li>US. A state.</li><li>Canada. A province.</li><li>Japan. A prefecture.</li><li>Switzerland. A *kanton*.</li></ul>",
          "type": "string",
          "minLength": 0,
          "maxLength": 300,
          "pattern": "^.*$"
        },
        "postal_code": {
          "description": "The postal code, which is the ZIP code or equivalent. Typically required for countries with a postal code or an equivalent. See [postal code](https://en.wikipedia.org/wiki/Postal_code).",
          "type": "string",
          "minLength": 0,
          "maxLength": 60,
          "pattern": "^.*$"
        },
        "country_code": {
          "$ref": "#/$defs/country_code"
        },
        "address_details": {
          "title": "Address Details",
          "description": "The non-portable additional address details include fine-grain address information for Compliance, Risk, and other scenarios. This isn't portable with common third-party and open source applications. This can include data that is redundant with core fields. For example, `address_portable.address_line_1` is usually a combination of `address_details.street_number`, `street_name`, and `street_type`.",
          "type": "object",
          "properties": {
            "street_number": {
              "description": "The street number.",
              "type": "string",
              "minLength": 0,
              "maxLength": 100,
              "pattern": "^.*$"
            },
            "street_name": {
              "description": "The street name. Just `Drury` in `Drury Lane`.",
              "type": "string",
              "minLength": 0,
              "maxLength": 100,
              "pattern": "^.*$"
            },
            "street_type": {
              "description": "The street type. For example, avenue, boulevard, road, or expressway.",
              "type": "string",
              "minLength": 0,
              "maxLength": 100,
              "pattern": "^.*$"
            },
            "delivery_service": {
              "description": "The delivery service. Post office box, bag number, or post office name.",
              "type": "string",
              "minLength": 0,
              "maxLength": 100,
              "pattern": "^.*$"
            },
            "building_name": {
              "description": "A named locations that represents the premise. Usually a building name or number or collection of buildings with a common name or number. For example, <code>Craven House</code>.",
              "type": "string",
              "minLength": 0,
              "maxLength": 100,
              "pattern": "^.*$"
            },
            "sub_building": {
              "description": "The first-order entity below a named building or location that represents the sub-premise. Usually a single building within a collection of buildings with a common name. Can be a flat, story, floor, room, or apartment.",
              "type": "string",
              "minLength": 0,
              "maxLength": 100,
              "pattern": "^.*$"
            }
          }
        }
      }
    },
    "aggregated_discount": {
      "title": "aggregated_discount",
      "description": "The discount. Can be an item- or invoice-level discount, or both. Can be applied as a percent or amount. If you provide both amount and percent, amount takes precedent.",
      "type": "object",
      "properties": {
        "invoice_discount": {
          "$ref": "#/$defs/discount"
        },
        "item_discount": {
          "allOf": [
            {
              "$ref": "#/$defs/money"
            },
            {
              "description": "The discount as a percent or amount at item level. The item discount amount is subtracted from each item amount."
            }
          ]
        }
      }
    },
    "amount_summary_detail": {
      "title": "amount_summary_detail",
      "description": "The invoice amount summary of item total, discount, tax total, and shipping.",
      "type": "object",
      "properties": {
        "currency_code": {
          "$ref": "#/$defs/currency_code"
        },
        "value": {
          "description": "The value, which might be:<ul><li>An integer for currencies like `JPY` that are not typically fractional.</li><li>A decimal fraction for currencies like `TND` that are subdivided into thousandths.</li></ul>For the required number of decimal places for a currency code, see [Currency Codes](/docs/integration/direct/rest/currency-codes/).",
          "type": "string",
          "minLength": 0,
          "maxLength": 32,
          "pattern": "^((-?[0-9]+)|(-?([0-9]+)?[.][0-9]+))$"
        },
        "breakdown": {
          "$ref": "#/$defs/amount_with_breakdown"
        }
      }
    },
    "amount_with_breakdown": {
      "title": "amount_with_breakdown",
      "description": "The breakdown of the amount. Includes total item amount, total tax amount, custom amount, and shipping and discounts, if any.",
      "type": "object",
      "properties": {
        "item_total": {
          "allOf": [
            {
              "$ref": "#/$defs/money"
            },
            {
              "description": "The subtotal for all items. Must equal the sum of (`items[].unit_amount` * `items[].quantity`) for all items."
            }
          ]
        },
        "discount": {
          "$ref": "#/$defs/aggregated_discount"
        },
        "tax_total": {
          "allOf": [
            {
              "$ref": "#/$defs/money"
            },
            {
              "description": "The aggregated amount of the item and shipping taxes."
            }
          ]
        },
        "shipping": {
          "$ref": "#/$defs/shipping_cost"
        },
        "custom": {
          "$ref": "#/$defs/custom_amount"
        }
      }
    },
    "base_configuration": {
      "title": "base_configuration",
      "description": "The base configuration details. Includes tax information, tip, and partial payment.",
      "type": "object",
      "properties": {
        "tax_calculated_after_discount": {
          "description": "Indicates whether the tax is calculated before or after a discount. If `false`, the tax is calculated before a discount. If `true`, the tax is calculated after a discount.",
          "type": "boolean",
          "default": true
        },
        "tax_inclusive": {
          "description": "Indicates whether the unit price includes tax.",
          "type": "boolean",
          "default": false
        },
        "allow_tip": {
          "description": "Indicates whether the invoice enables the customer to enter a tip amount during payment. If `true`, the invoice shows a tip amount field so that the customer can enter a tip amount. If `false`, the invoice does not show a tip amount field.<blockquote><strong>Note:</strong> This feature is not available for users in `Hong Kong`, `Taiwan`, `India`, or `Japan`.</blockquote>",
          "type": "boolean",
          "default": false
        },
        "partial_payment": {
          "$ref": "#/$defs/partial_payment"
        }
      }
    },
    "billing_info": {
      "title": "billing_info",
      "description": "The billing information of the invoice recipient. Includes name, address, email, phone, and language.",
      "type": "object",
      "allOf": [
        {
          "$ref": "#/$defs/contact_name_address"
        },
        {
          "type": "object",
          "properties": {
            "email_address": {
              "allOf": [
                {
                  "$ref": "#/$defs/restrictive_email_address"
                },
                {
                  "description": "The invoice recipient email address. If you omit this value, the invoice is payable and a notification email is not sent."
                }
              ]
            },
            "phones": {
              "description": "The invoice recipient's phone numbers. Extension number is not supported.",
              "type": "array",
              "minItems": 0,
              "maxItems": 32767,
              "items": {
                "allOf": [
                  {
                    "$ref": "#/$defs/phone_detail"
                  },
                  {
                    "title": "phone"
                  }
                ]
              }
            },
            "additional_info": {
              "description": "Any additional information about the recipient.",
              "type": "string",
              "minLength": 0,
              "maxLength": 40,
              "pattern": "^[\\S\\s]*$"
            },
            "language": {
              "allOf": [
                {
                  "$ref": "#/$defs/language"
                },
                {
                  "description": "The language in which to show the invoice recipient's email message. Used only when the recipient does not have a PayPal account. If you omit the language and the recipient does not have a PayPal account, the email message is sent in the language of the merchant's PayPal account."
                }
              ]
            }
          }
        }
      ]
    },
    "business_name": {
      "title": "Business Name",
      "description": "The business name of the party.",
      "type": "object",
      "properties": {
        "business_name": {
          "description": "Required. The business name of the party.",
          "type": "string",
          "minLength": 0,
          "maxLength": 300,
          "pattern": "^.*$"
        },
        "orthography": {
          "$ref": "#/$defs/orthography"
        }
      }
    },
    "conditional_rule_relative_conditions": {
      "title": "conditional_rule_relative_conditions",
      "description": "Defines the time-based condition that triggers a conditional rule on a recurring invoice, expressed as a period relative to either the invoice issue date (for early payment discounts) or the invoice due date (for auto-cancellation).",
      "type": "string",
      "enum": [
        "THREE_DAYS_AFTER_ISSUE_DATE",
        "SEVEN_DAYS_AFTER_ISSUE_DATE",
        "FIFTEEN_DAYS_AFTER_ISSUE_DATE",
        "THIRTY_DAYS_AFTER_ISSUE_DATE",
        "ONE_DAY_AFTER_DUE_DATE",
        "SEVEN_DAYS_AFTER_DUE_DATE",
        "FIFTEEN_DAYS_AFTER_DUE_DATE",
        "THIRTY_DAYS_AFTER_DUE_DATE"
      ],
      "oneOf": [
        {
          "type": "string",
          "enum": [
            "THREE_DAYS_AFTER_ISSUE_DATE"
          ],
          "description": "The rule expires 3 days after the invoice issue date. Applicable for early payment discount rules."
        },
        {
          "type": "string",
          "enum": [
            "SEVEN_DAYS_AFTER_ISSUE_DATE"
          ],
          "description": "The rule expires 7 days after the invoice issue date. Applicable for early payment discount rules."
        },
        {
          "type": "string",
          "enum": [
            "FIFTEEN_DAYS_AFTER_ISSUE_DATE"
          ],
          "description": "The rule expires 15 days after the invoice issue date. Applicable for early payment discount rules."
        },
        {
          "type": "string",
          "enum": [
            "THIRTY_DAYS_AFTER_ISSUE_DATE"
          ],
          "description": "The rule expires 30 days after the invoice issue date. Applicable for early payment discount rules."
        },
        {
          "type": "string",
          "enum": [
            "ONE_DAY_AFTER_DUE_DATE"
          ],
          "description": "The rule takes effect 1 day after the invoice due date. Applicable for auto-cancellation rules."
        },
        {
          "type": "string",
          "enum": [
            "SEVEN_DAYS_AFTER_DUE_DATE"
          ],
          "description": "The rule takes effect 7 days after the invoice due date. Applicable for auto-cancellation rules."
        },
        {
          "type": "string",
          "enum": [
            "FIFTEEN_DAYS_AFTER_DUE_DATE"
          ],
          "description": "The rule takes effect 15 days after the invoice due date. Applicable for auto-cancellation rules."
        },
        {
          "type": "string",
          "enum": [
            "THIRTY_DAYS_AFTER_DUE_DATE"
          ],
          "description": "The rule takes effect 30 days after the invoice due date. Applicable for auto-cancellation rules."
        }
      ]
    },
    "configurable_theme": {
      "title": "Theme configuration",
      "description": "The theme configuration that defines the visual appearance of the invoice buyer experience and email. Pass an empty object to use the default theme.",
      "type": "object",
      "properties": {
        "primary_color": {
          "description": "The primary color chosen by the merchant for branding the invoice buyer experience and email. Accepts a hex color code in #RGB or #RRGGBB format.",
          "type": "string",
          "minLength": 4,
          "maxLength": 7,
          "pattern": "^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$"
        }
      }
    },
    "contact_name_address": {
      "title": "contact_information",
      "description": "The contact information of the user. Includes name and address.",
      "type": "object",
      "allOf": [
        {
          "$ref": "#/$defs/business_name"
        },
        {
          "type": "object",
          "properties": {
            "name": {
              "allOf": [
                {
                  "$ref": "#/$defs/person_name"
                },
                {
                  "description": "The first and Last name of the recipient."
                }
              ]
            },
            "address": {
              "allOf": [
                {
                  "$ref": "#/$defs/address_portable"
                },
                {
                  "description": "The address of the recipient."
                }
              ]
            }
          }
        }
      ]
    },
    "country_code": {
      "description": "The [2-character ISO 3166-1 code](/api/rest/reference/country-codes/) that identifies the country or region.<blockquote><strong>Note:</strong> The country code for Great Britain is <code>GB</code> and not <code>UK</code> as used in the top-level domain names for that country. Use the `C2` country code for China worldwide for comparable uncontrolled price (CUP) method, bank card, and cross-border transactions.</blockquote>",
      "type": "string",
      "minLength": 2,
      "maxLength": 2,
      "pattern": "^([A-Z]{2}|C2)$"
    },
    "currency_code": {
      "description": "The [3-character ISO-4217 currency code](/api/rest/reference/currency-codes/) that identifies the currency.",
      "type": "string",
      "minLength": 3,
      "maxLength": 3,
      "pattern": "^[\\S\\s]*$"
    },
    "custom_amount": {
      "title": "custom_amount",
      "description": "The custom amount to apply to an invoice. If you include a label, you must include a custom amount.",
      "type": "object",
      "required": [
        "label"
      ],
      "properties": {
        "label": {
          "description": "The label to the custom amount of the invoice.",
          "type": "string",
          "minLength": 0,
          "maxLength": 50,
          "pattern": "^[\\S\\s]*$"
        },
        "amount": {
          "allOf": [
            {
              "$ref": "#/$defs/money"
            },
            {
              "description": "The custom amount value. Value is from `-1000000` to `1000000`. Supports up to two decimal places."
            }
          ]
        }
      }
    },
    "date_no_time": {
      "description": "The stand-alone date, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.6). To represent special legal values, such as a date of birth, you should use dates with no associated time or time-zone data. Whenever possible, use the standard `date_time` type. This regular expression does not validate all dates. For example, February 31 is valid and nothing is known about leap years.",
      "type": "string",
      "minLength": 10,
      "maxLength": 10,
      "pattern": "^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$"
    },
    "date_time": {
      "description": "The date and time, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are required while fractional seconds are optional.<blockquote><strong>Note:</strong> The regular expression provides guidance but does not reject all invalid dates.</blockquote>",
      "type": "string",
      "minLength": 20,
      "maxLength": 64,
      "pattern": "^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])[T,t]([0-1][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)([.][0-9]+)?([Zz]|[+-][0-9]{2}:[0-9]{2})$"
    },
    "detail": {
      "title": "detail",
      "description": "The details of the invoice like notes, terms and conditions, memo, attachments.",
      "type": "object",
      "required": [
        "currency_code"
      ],
      "properties": {
        "reference": {
          "description": "The reference data. Includes a Purchase Order (PO) number.",
          "type": "string",
          "minLength": 1,
          "maxLength": 120,
          "pattern": "^[\\S\\s]*$"
        },
        "currency_code": {
          "$ref": "#/$defs/currency_code"
        },
        "note": {
          "description": "A note to the invoice recipient. Also appears on the invoice notification email.",
          "type": "string",
          "minLength": 1,
          "maxLength": 4000,
          "pattern": "^[\\S\\s]*$"
        },
        "terms_and_conditions": {
          "description": "The general terms of the invoice. Can include return or cancellation policy and other terms and conditions.",
          "type": "string",
          "minLength": 1,
          "maxLength": 4000,
          "pattern": "^[\\S\\s]*$"
        },
        "memo": {
          "description": "A private bookkeeping memo for the user.",
          "type": "string",
          "minLength": 1,
          "maxLength": 500,
          "pattern": "^[\\S\\s]*$"
        },
        "attachments": {
          "description": "An array of PayPal IDs for the files that are attached to an invoice.",
          "type": "array",
          "minItems": 0,
          "maxItems": 32767,
          "items": {
            "allOf": [
              {
                "$ref": "#/$defs/file_reference"
              },
              {
                "title": "attachment"
              }
            ]
          }
        }
      }
    },
    "discount": {
      "title": "discount",
      "description": "The discount as a percent or amount at invoice level. The invoice discount amount is subtracted from the item total.",
      "type": "object",
      "properties": {
        "percent": {
          "allOf": [
            {
              "$ref": "#/$defs/percentage"
            },
            {
              "description": "The discount as a percentage value. Value is from `0` to `100`. Supports up to five decimal places."
            }
          ]
        },
        "amount": {
          "allOf": [
            {
              "$ref": "#/$defs/money"
            },
            {
              "description": "The invoice level discount amount. Value is from `0` to `1000000`. Supports up to two decimal places."
            }
          ]
        }
      }
    },
    "email_address": {
      "description": "The internationalized email address.<blockquote><strong>Note:</strong> Up to 64 characters are allowed before and 255 characters are allowed after the <code>@</code> sign. However, the generally accepted maximum length for an email address is 254 characters. The pattern verifies that an unquoted <code>@</code> sign exists.</blockquote>",
      "type": "string",
      "minLength": 3,
      "maxLength": 254,
      "pattern": "^(?:[A-Za-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[A-Za-z0-9!#$%&'*+/=?^_`{|}~-]+)*|\"(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21\\x23-\\x5b\\x5d-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])*\")@(?:(?:[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?\\.)+[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?|\\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[A-Za-z0-9-]*[A-Za-z0-9]:(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21-\\x5a\\x53-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])+)\\])$"
    },
    "file_reference": {
      "title": "File Reference",
      "description": "The file reference. Can be a file in PayPal MediaServ, PayPal DMS, or another custom store.",
      "type": "object",
      "properties": {
        "id": {
          "description": "The ID of the referenced file.",
          "type": "string",
          "minLength": 1,
          "maxLength": 255,
          "pattern": "^.*$"
        },
        "reference_url": {
          "description": "The reference URL for the file.",
          "type": "string",
          "minLength": 1,
          "maxLength": 2000,
          "format": "uri"
        },
        "content_type": {
          "description": "The [Internet Assigned Numbers Authority (IANA) media type of the file](https://www.iana.org/assignments/media-types/media-types.xhtml).",
          "type": "string",
          "minLength": 0,
          "maxLength": 255,
          "pattern": "^.*$"
        },
        "create_time": {
          "allOf": [
            {
              "$ref": "#/$defs/date_time"
            },
            {
              "description": "The date and time when the file was created, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.6)."
            }
          ]
        },
        "size": {
          "description": "The size of the file, in bytes.",
          "type": "string",
          "minLength": 0,
          "maxLength": 100,
          "pattern": "^[0-9]+$"
        }
      }
    },
    "invoicer_info": {
      "title": "invoicer_info",
      "description": "The invoicer business information that appears on the invoice.",
      "type": "object",
      "allOf": [
        {
          "$ref": "#/$defs/contact_name_address"
        },
        {
          "type": "object",
          "properties": {
            "email_address": {
              "allOf": [
                {
                  "$ref": "#/$defs/restrictive_email_address"
                },
                {
                  "description": "The invoicer email address, which must be listed in the user's PayPal profile. If you omit this value, notifications are sent from and to the primary email address but do not appear on the invoice."
                }
              ]
            },
            "phones": {
              "description": "An array of invoicer's phone numbers. The invoicer can choose to hide the phone number on the invoice.",
              "type": "array",
              "minItems": 0,
              "maxItems": 32767,
              "items": {
                "allOf": [
                  {
                    "$ref": "#/$defs/phone_detail"
                  },
                  {
                    "title": "phone"
                  }
                ]
              }
            },
            "website": {
              "description": "The invoicer's website.",
              "type": "string",
              "minLength": 0,
              "maxLength": 2048,
              "format": "uri"
            },
            "tax_id": {
              "description": "The invoicer's tax ID.",
              "type": "string",
              "minLength": 0,
              "maxLength": 100,
              "pattern": "^[\\S\\s]*$"
            },
            "additional_notes": {
              "description": "Any additional information. Includes business hours.",
              "type": "string",
              "minLength": 0,
              "maxLength": 400,
              "pattern": "^[\\S\\s]*$"
            },
            "logo_url": {
              "description": "The full URL to an external logo image. The logo image must not be larger than 250 pixels wide by 90 pixels high.",
              "type": "string",
              "minLength": 0,
              "maxLength": 2000,
              "format": "uri"
            }
          }
        }
      ]
    },
    "item": {
      "title": "item",
      "description": "An array of invoice line item information. The maximum items for an invoice is `100`.",
      "type": "object",
      "required": [
        "name",
        "quantity",
        "unit_amount"
      ],
      "properties": {
        "id": {
          "description": "The ID of the invoice line item.",
          "type": "string",
          "minLength": 0,
          "maxLength": 22,
          "pattern": "^[\\S\\s]*$",
          "readOnly": true
        },
        "name": {
          "description": "The item name for the invoice line item.",
          "type": "string",
          "minLength": 0,
          "maxLength": 200,
          "pattern": "^[\\S\\s]*$"
        },
        "description": {
          "description": "The item description for the invoice line item.",
          "type": "string",
          "minLength": 0,
          "maxLength": 1000,
          "pattern": "^[\\S\\s]*$"
        },
        "quantity": {
          "description": "The quantity of the item that the invoicer provides to the payer. Value is from `-1000000` to `1000000`. Supports up to five decimal places.",
          "type": "string",
          "minLength": 0,
          "maxLength": 14,
          "pattern": "^\\d+(.\\d{1,5})?$"
        },
        "unit_amount": {
          "allOf": [
            {
              "$ref": "#/$defs/money"
            },
            {
              "description": "The unit price of the item. This does not include tax and discount. Value is from `-1000000` to `1000000`. Supports up to two decimal places."
            }
          ]
        },
        "tax": {
          "allOf": [
            {
              "$ref": "#/$defs/tax"
            },
            {
              "description": "The tax associated with the item. The tax amount is added to the item total. Value is from `0` to `100`. Supports up to five decimal places."
            }
          ]
        },
        "item_date": {
          "allOf": [
            {
              "$ref": "#/$defs/date_no_time"
            },
            {
              "description": "The date when the item or service was provided, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.6). For example, *yyyy*-*MM*-*dd*T*z*."
            }
          ]
        },
        "discount": {
          "$ref": "#/$defs/discount"
        },
        "unit_of_measure": {
          "allOf": [
            {
              "$ref": "#/$defs/unit_of_measure"
            },
            {
              "description": "The unit of measure for the invoiced item. For `AMOUNT` the `unit_amount` and `quantity` are not shown on the invoice.<blockquote><strong>Note:</strong> If your specify different `unit_of_measure` values for the same invoice, the invoice uses the first value.</blockquote>"
            }
          ]
        }
      }
    },
    "language": {
      "description": "The [language tag](https://tools.ietf.org/html/bcp47#section-2) for the language in which to localize the error-related strings, such as messages, issues, and suggested actions. The tag is made up of the [ISO 639-2 language code](https://www.loc.gov/standards/iso639-2/php/code_list.php), the optional [ISO-15924 script tag](https://www.unicode.org/iso15924/codelists.html), and the [ISO-3166 alpha-2 country code](/api/rest/reference/country-codes/) or [M49 region code](https://unstats.un.org/unsd/methodology/m49/).",
      "type": "string",
      "minLength": 2,
      "maxLength": 10,
      "pattern": "^[a-z]{2}(?:-[A-Z][a-z]{3})?(?:-(?:[A-Z]{2}|[0-9]{3}))?$"
    },
    "link_description": {
      "title": "Link Description",
      "description": "The request-related [HATEOAS link](/api/rest/responses/#hateoas-links) information.",
      "type": "object",
      "required": [
        "href",
        "rel"
      ],
      "properties": {
        "href": {
          "description": "The complete target URL. To make the related call, combine the method with this [URI Template-formatted](https://tools.ietf.org/html/rfc6570) link. For pre-processing, include the `$`, `(`, and `)` characters. The `href` is the key HATEOAS component that links a completed call with a subsequent call.",
          "type": "string",
          "minLength": 0,
          "maxLength": 20000,
          "pattern": "^.*$"
        },
        "rel": {
          "description": "The [link relation type](https://tools.ietf.org/html/rfc5988#section-4), which serves as an ID for a link that unambiguously describes the semantics of the link. See [Link Relations](https://www.iana.org/assignments/link-relations/link-relations.xhtml).",
          "type": "string",
          "minLength": 0,
          "maxLength": 100,
          "pattern": "^.*$"
        },
        "method": {
          "description": "The HTTP method required to make the related call.",
          "type": "string",
          "enum": [
            "CONNECT",
            "DELETE",
            "GET",
            "HEAD",
            "OPTIONS",
            "PATCH",
            "POST",
            "PUT"
          ],
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "CONNECT"
              ],
              "description": "The HTTP CONNECT method."
            },
            {
              "type": "string",
              "enum": [
                "DELETE"
              ],
              "description": "The HTTP DELETE method."
            },
            {
              "type": "string",
              "enum": [
                "GET"
              ],
              "description": "The HTTP GET method."
            },
            {
              "type": "string",
              "enum": [
                "HEAD"
              ],
              "description": "The HTTP HEAD method."
            },
            {
              "type": "string",
              "enum": [
                "OPTIONS"
              ],
              "description": "The HTTP OPTIONS method."
            },
            {
              "type": "string",
              "enum": [
                "PATCH"
              ],
              "description": "The HTTP PATCH method."
            },
            {
              "type": "string",
              "enum": [
                "POST"
              ],
              "description": "The HTTP POST method."
            },
            {
              "type": "string",
              "enum": [
                "PUT"
              ],
              "description": "The HTTP PUT method."
            }
          ]
        }
      }
    },
    "money": {
      "title": "Money",
      "description": "The currency and amount for a financial transaction, such as a balance or payment due.",
      "type": "object",
      "required": [
        "currency_code",
        "value"
      ],
      "properties": {
        "currency_code": {
          "$ref": "#/$defs/currency_code"
        },
        "value": {
          "description": "The value, which might be:<ul><li>An integer for currencies like `JPY` that are not typically fractional.</li><li>A decimal fraction for currencies like `TND` that are subdivided into thousandths.</li></ul>For the required number of decimal places for a currency code, see [Currency Codes](/api/rest/reference/currency-codes/).",
          "type": "string",
          "minLength": 0,
          "maxLength": 32,
          "pattern": "^((-?[0-9]+)|(-?([0-9]+)?[.][0-9]+))$"
        }
      }
    },
    "orthography": {
      "title": "Orthography Type",
      "description": "The orthography type based on the ISO 15924 names for scripts. Scipts are chosen based on [most widely used writing systems](https://www.worldatlas.com/articles/the-world-s-most-popular-writing-scripts.html).",
      "type": "string",
      "enum": [
        "Arab",
        "Armn",
        "Beng",
        "Cans",
        "Cyrl",
        "Deva",
        "Ethi",
        "Geor",
        "Grek",
        "Gujr",
        "Guru",
        "Hani",
        "Hebr",
        "Java",
        "Jpan",
        "Kana",
        "Khmr",
        "Knda",
        "Kore",
        "Laoo",
        "Latn",
        "Mlym",
        "Mong",
        "Mymr",
        "Orya",
        "Sinh",
        "Sund",
        "Syrc",
        "Taml",
        "Telu",
        "Thaa",
        "Thai",
        "Tibt",
        "Yiii",
        "Zyyy",
        "Zzzz"
      ],
      "oneOf": [
        {
          "type": "string",
          "enum": [
            "Arab"
          ],
          "description": "The Arabic language alphabet."
        },
        {
          "type": "string",
          "enum": [
            "Armn"
          ],
          "description": "The Armenian alphabet."
        },
        {
          "type": "string",
          "enum": [
            "Beng"
          ],
          "description": "The Bengali alphabet. Used in eastern India."
        },
        {
          "type": "string",
          "enum": [
            "Cans"
          ],
          "description": "The Unified Canadian Aboriginal Syllabics alphabet."
        },
        {
          "type": "string",
          "enum": [
            "Cyrl"
          ],
          "description": "The Slavic languages alphabet. Used in eastern Europe."
        },
        {
          "type": "string",
          "enum": [
            "Deva"
          ],
          "description": "The Devanagari (Nagari) alphabet."
        },
        {
          "type": "string",
          "enum": [
            "Ethi"
          ],
          "description": "The Ethiopic alphabet."
        },
        {
          "type": "string",
          "enum": [
            "Geor"
          ],
          "description": "The Georgian (Mkhedruli and Mtavruli) alphabet."
        },
        {
          "type": "string",
          "enum": [
            "Grek"
          ],
          "description": "The Greek alphabet."
        },
        {
          "type": "string",
          "enum": [
            "Gujr"
          ],
          "description": "The Gujurati language alphabet. Used in western India."
        },
        {
          "type": "string",
          "enum": [
            "Guru"
          ],
          "description": "The Gurmukhi alphabet. Used in the northern Indian state of Punjab."
        },
        {
          "type": "string",
          "enum": [
            "Hani"
          ],
          "description": "The Han (Hanzi, Kanji, Hanja) alphabet."
        },
        {
          "type": "string",
          "enum": [
            "Hebr"
          ],
          "description": "The Hebrew alphabet."
        },
        {
          "type": "string",
          "enum": [
            "Java"
          ],
          "description": "The Javanese alphabet."
        },
        {
          "type": "string",
          "enum": [
            "Jpan"
          ],
          "description": "The Japanese (alias for Han + Hiragana + Katakana) alphabet."
        },
        {
          "type": "string",
          "enum": [
            "Kana"
          ],
          "description": "An angular form of Japanese writing for words of foreign origin."
        },
        {
          "type": "string",
          "enum": [
            "Khmr"
          ],
          "description": "The Khmer alphabet."
        },
        {
          "type": "string",
          "enum": [
            "Knda"
          ],
          "description": "The Kannada alphabet. Used in the southern Indian state of Karnataka."
        },
        {
          "type": "string",
          "enum": [
            "Kore"
          ],
          "description": "Korean (alias for Hangul + Han)."
        },
        {
          "type": "string",
          "enum": [
            "Laoo"
          ],
          "description": "The Lao alphabet."
        },
        {
          "type": "string",
          "enum": [
            "Latn"
          ],
          "description": "The Latin alphabet."
        },
        {
          "type": "string",
          "enum": [
            "Mlym"
          ],
          "description": "The Malayalam alphabet. Used in the southern Indian state of Kerala."
        },
        {
          "type": "string",
          "enum": [
            "Mong"
          ],
          "description": "The Mongolian alphabet."
        },
        {
          "type": "string",
          "enum": [
            "Mymr"
          ],
          "description": "The Myanmar (Burmese) alphabet."
        },
        {
          "type": "string",
          "enum": [
            "Orya"
          ],
          "description": "The Oriya (Odia) alphabet. Used in the eastern Indian state of Odisha."
        },
        {
          "type": "string",
          "enum": [
            "Sinh"
          ],
          "description": "The Sinhala alphabet."
        },
        {
          "type": "string",
          "enum": [
            "Sund"
          ],
          "description": "The Sundanese alphabet."
        },
        {
          "type": "string",
          "enum": [
            "Syrc"
          ],
          "description": "The Syriac alphabet."
        },
        {
          "type": "string",
          "enum": [
            "Taml"
          ],
          "description": "The Tamil alphabet. Used in the southern Indian state of Tamilnadu."
        },
        {
          "type": "string",
          "enum": [
            "Telu"
          ],
          "description": "The Telugu language alphabet. Used in the southern Indian state of Andhra pradesh."
        },
        {
          "type": "string",
          "enum": [
            "Thaa"
          ],
          "description": "The Thaana (Maldivian) alphabet."
        },
        {
          "type": "string",
          "enum": [
            "Thai"
          ],
          "description": "The Thai alphabet. Used in Thailand."
        },
        {
          "type": "string",
          "enum": [
            "Tibt"
          ],
          "description": "The Tibetan alphabet."
        },
        {
          "type": "string",
          "enum": [
            "Yiii"
          ],
          "description": "The Yi alphabet."
        },
        {
          "type": "string",
          "enum": [
            "Zyyy"
          ],
          "description": "The orthography cannot be determined."
        },
        {
          "type": "string",
          "enum": [
            "Zzzz"
          ],
          "description": "The orthography is unknown."
        }
      ]
    },
    "override_payment_method_detail": {
      "title": "override_payment_method_detail",
      "description": "The details about a payment method override configured for the invoice via payment method overrides object.",
      "type": "object",
      "properties": {
        "payment_method_type": {
          "$ref": "#/$defs/override_payment_method_type"
        },
        "enabled": {
          "description": "Indicates whether the specified payment method is enabled for the invoice. When set to `true`, the payment method is available for the buyer to use. When set to `false`, the payment method is disabled.",
          "type": "boolean"
        },
        "rules": {
          "description": "The list of payment method override rules applied to the invoice via payment method overrides object. Each rule defines a specific restriction or behavior for the payment method, such as making it the exclusive payment option when the invoice total exceeds a system-defined threshold.",
          "type": "array",
          "minItems": 1,
          "maxItems": 10,
          "items": {
            "$ref": "#/$defs/override_payment_method_rule"
          }
        }
      }
    },
    "override_payment_method_rule": {
      "title": "override_payment_method_rule",
      "description": "The details about a payment method override rule applied to the invoice via payment method overrides object.",
      "type": "object",
      "required": [
        "rule_type",
        "rule_value"
      ],
      "properties": {
        "rule_type": {
          "$ref": "#/$defs/override_payment_method_rule_type"
        },
        "rule_value": {
          "description": "The value associated with the payment method override rule. For the `EXCLUSIVE_ABOVE_AMOUNT_THRESHOLD` rule type, set this to `true` to enable the rule or `false` to disable it.",
          "type": "string",
          "minLength": 1,
          "maxLength": 100,
          "pattern": "^[a-zA-Z0-9\\s,.]+$"
        }
      }
    },
    "override_payment_method_rule_type": {
      "title": "override_payment_method_rule_type",
      "description": "The type of rule that can be applied to a payment method configured via payment method overrides object on an invoice. Each rule controls how a payment method behaves based on the invoice total. <blockquote>System-defined threshold limits by payment method:<ol><li>PAY_BY_BANK - $1000</li></ol></blockquote>",
      "type": "string",
      "enum": [
        "EXCLUSIVE_ABOVE_AMOUNT_THRESHOLD",
        "ALLOW_ONLY_ACH"
      ],
      "oneOf": [
        {
          "type": "string",
          "enum": [
            "EXCLUSIVE_ABOVE_AMOUNT_THRESHOLD"
          ],
          "description": "When the invoice total exceeds the system-defined threshold, this rule restricts the invoice to accept only the specified payment method and disables all other payment methods. This rule is currently compatible only with the PAY_BY_BANK payment method."
        },
        {
          "type": "string",
          "enum": [
            "ALLOW_ONLY_ACH"
          ],
          "description": "Restricts the invoice to accept payment only via ACH bank transfer and disables all other payment methods."
        }
      ]
    },
    "override_payment_method_type": {
      "title": "override_payment_method_type",
      "description": "The payment method types that can be configured in the payment method overrides object for invoice payments.<blockquote><strong>Note:</strong> To use <code>PAY_BY_BANK</code>, you must first complete the onboarding process. Visit the <a href=\"https://www.paypal.com/unifiedonboarding/after-login?products=GUEST_ACH\">onboarding page</a> to get started. Once onboarding is complete, you can configure <code>PAY_BY_BANK</code> as a payment method.</blockquote>",
      "type": "string",
      "enum": [
        "PAY_BY_BANK",
        "ACH"
      ],
      "oneOf": [
        {
          "type": "string",
          "enum": [
            "PAY_BY_BANK"
          ],
          "description": "Enables the buyer to pay the invoice directly from their bank account. Available only for US-based merchants and invoices with USD currency."
        },
        {
          "type": "string",
          "enum": [
            "ACH"
          ],
          "description": "Enables the buyer to pay the invoice via ACH bank transfer."
        }
      ]
    },
    "partial_payment": {
      "title": "partial_payment",
      "description": "The partial payment details. Includes the minimum amount that the invoicer expects from the payer.",
      "type": "object",
      "properties": {
        "allow_partial_payment": {
          "description": "Indicates whether the invoice allows a partial payment. If `false`, the invoice must be paid in full. If `true`, the invoice allows partial payments.<blockquote><strong>Note:</strong> This feature is not available for users in `India`, `Brazil`, or `Israel`.</blockquote>",
          "type": "boolean",
          "default": false
        },
        "minimum_amount_due": {
          "allOf": [
            {
              "$ref": "#/$defs/money"
            },
            {
              "description": "The minimum amount allowed for a partial payment. Valid only when `allow_partial_payment` is `true`."
            }
          ]
        }
      }
    },
    "payment_term_type": {
      "title": "payment_term_type",
      "description": "The payment term. Payment can be due upon receipt, a specified date, or in a set number of days.",
      "type": "string",
      "enum": [
        "DUE_ON_RECEIPT",
        "DUE_ON_DATE_SPECIFIED",
        "NET_10",
        "NET_15",
        "NET_30",
        "NET_45",
        "NET_60",
        "NET_90",
        "NO_DUE_DATE"
      ],
      "oneOf": [
        {
          "type": "string",
          "enum": [
            "DUE_ON_RECEIPT"
          ],
          "description": "The payment for the invoice is due upon receipt of the invoice."
        },
        {
          "type": "string",
          "enum": [
            "DUE_ON_DATE_SPECIFIED"
          ],
          "description": "The payment for the invoice is due on the date specified in the invoice."
        },
        {
          "type": "string",
          "enum": [
            "NET_10"
          ],
          "description": "The payment for the invoice is due in 10 days."
        },
        {
          "type": "string",
          "enum": [
            "NET_15"
          ],
          "description": "The payment for the invoice is due in 15 days."
        },
        {
          "type": "string",
          "enum": [
            "NET_30"
          ],
          "description": "The payment for the invoice is due in 30 days."
        },
        {
          "type": "string",
          "enum": [
            "NET_45"
          ],
          "description": "The payment for the invoice is due in 45 days."
        },
        {
          "type": "string",
          "enum": [
            "NET_60"
          ],
          "description": "The payment for the invoice is due in 60 days."
        },
        {
          "type": "string",
          "enum": [
            "NET_90"
          ],
          "description": "The payment for the invoice is due in 90 days."
        },
        {
          "type": "string",
          "enum": [
            "NO_DUE_DATE"
          ],
          "description": "The invoice has no payment due date."
        }
      ]
    },
    "percentage": {
      "description": "The percentage, as a fixed-point, signed decimal number. For example, define a 19.99% interest rate as `19.99`.",
      "type": "string",
      "minLength": 0,
      "maxLength": 500,
      "pattern": "^((-?[0-9]+)|(-?([0-9]+)?[.][0-9]+))$"
    },
    "person_name": {
      "title": "Name",
      "description": "The name of a person.",
      "type": "object",
      "properties": {
        "prefix": {
          "description": "The prefix, or title, to the party's name.",
          "type": "string",
          "minLength": 0,
          "maxLength": 140,
          "pattern": "^.*$"
        },
        "given_name": {
          "description": "When the party is a person, the party's given, or first, name.",
          "type": "string",
          "minLength": 0,
          "maxLength": 140,
          "pattern": "^.*$"
        },
        "surname": {
          "description": "When the party is a person, the party's surname or family name. Also known as the last name. Required when the party is a person. Use also to store multiple surnames including the matronymic, or mother's, surname.",
          "type": "string",
          "minLength": 0,
          "maxLength": 140,
          "pattern": "^.*$"
        },
        "middle_name": {
          "description": "When the party is a person, the party's middle name. Use also to store multiple middle names including the patronymic, or father's, middle name.",
          "type": "string",
          "minLength": 0,
          "maxLength": 140,
          "pattern": "^.*$"
        },
        "suffix": {
          "description": "The suffix for the party's name.",
          "type": "string",
          "minLength": 0,
          "maxLength": 140,
          "pattern": "^.*$"
        },
        "full_name": {
          "description": "When the party is a person, the party's full name.",
          "type": "string",
          "minLength": 0,
          "maxLength": 300,
          "pattern": "^.*$"
        },
        "orthography": {
          "$ref": "#/$defs/orthography"
        }
      }
    },
    "phone": {
      "title": "Phone",
      "description": "The phone number in its canonical international [E.164 numbering plan format](https://www.itu.int/rec/T-REC-E.164/en).",
      "type": "object",
      "required": [
        "country_code",
        "national_number"
      ],
      "properties": {
        "country_code": {
          "description": "The country calling code (CC), in its canonical international [E.164 numbering plan format](https://www.itu.int/rec/T-REC-E.164/en). The combined length of the CC and the national number must not be greater than 15 digits. The national number consists of a national destination code (NDC) and subscriber number (SN).",
          "type": "string",
          "minLength": 1,
          "maxLength": 3,
          "pattern": "^[0-9]{1,3}?$"
        },
        "national_number": {
          "description": "The national number, in its canonical international [E.164 numbering plan format](https://www.itu.int/rec/T-REC-E.164/en). The combined length of the country calling code (CC) and the national number must not be greater than 15 digits. The national number consists of a national destination code (NDC) and subscriber number (SN).",
          "type": "string",
          "minLength": 1,
          "maxLength": 14,
          "pattern": "^[0-9]{1,14}?$"
        },
        "extension_number": {
          "description": "The extension number.",
          "type": "string",
          "minLength": 1,
          "maxLength": 15,
          "pattern": "^[0-9]{1,15}?$"
        }
      }
    },
    "phone_detail": {
      "title": "phone_detail",
      "description": "The phone details. Includes the phone number and type.",
      "type": "object",
      "required": [
        "phone_type"
      ],
      "allOf": [
        {
          "$ref": "#/$defs/phone"
        },
        {
          "type": "object",
          "properties": {
            "phone_type": {
              "title": "phone_type",
              "description": "The phone type.",
              "type": "string",
              "enum": [
                "FAX",
                "HOME",
                "MOBILE",
                "OTHER",
                "PAGER"
              ],
              "oneOf": [
                {
                  "type": "string",
                  "enum": [
                    "FAX"
                  ],
                  "description": "Fax number."
                },
                {
                  "type": "string",
                  "enum": [
                    "HOME"
                  ],
                  "description": "Home phone number."
                },
                {
                  "type": "string",
                  "enum": [
                    "MOBILE"
                  ],
                  "description": "Mobile phone number."
                },
                {
                  "type": "string",
                  "enum": [
                    "OTHER"
                  ],
                  "description": "Other phone number."
                },
                {
                  "type": "string",
                  "enum": [
                    "PAGER"
                  ],
                  "description": "Pager number."
                }
              ]
            }
          }
        }
      ]
    },
    "plan": {
      "title": "plan",
      "description": "The scheduling and recurrence configuration that defines when and how often invoices are automatically generated and sent to customers in a recurring series.",
      "type": "object",
      "required": [
        "frequency"
      ],
      "properties": {
        "total_cycles": {
          "description": "The total number of billing cycles (invoices) that will be generated in this recurring series. Once all cycles are completed, the series automatically expires. Note: if not set, then the series will be indefinite.",
          "type": "integer",
          "minimum": 0,
          "maximum": 99
        },
        "frequency": {
          "allOf": [
            {
              "$ref": "#/$defs/plan_frequency"
            },
            {
              "description": "The billing frequency that determines the time interval between successive invoice generations. Defines how often invoices are sent to the customer (e.g., weekly, monthly, yearly)."
            }
          ]
        },
        "start_series_date": {
          "allOf": [
            {
              "$ref": "#/$defs/date_no_time"
            },
            {
              "description": "The date when the recurring series begins and the first invoice is generated. Must be specified in yyyy-MM-DD format and cannot be a past date. The start date must be either today or a future date. Note: If it is not explicitly passed then the system will assume current date as start series date."
            }
          ]
        },
        "next_occurrence_date": {
          "allOf": [
            {
              "$ref": "#/$defs/date_no_time"
            },
            {
              "description": "The calculated date when the next invoice in the series will be automatically generated and sent. This date is determined based on the frequency and the last invoice sent date.",
              "readOnly": true
            }
          ]
        },
        "completed_cycles": {
          "description": "The number of billing cycles (invoices) that have already been generated and sent in this recurring series. This counter increments with each invoice sent and helps track progress toward the total cycles.",
          "type": "integer",
          "minimum": 0,
          "maximum": 2147483647,
          "readOnly": true
        }
      }
    },
    "plan_frequency": {
      "title": "plan_frequency",
      "description": "The frequency of the recurring invoice series cycle.",
      "type": "object",
      "required": [
        "interval_count",
        "interval_unit"
      ],
      "properties": {
        "interval_unit": {
          "description": "The time unit for the recurring invoice cycle interval. Used together with interval_count to determine the frequency of invoice generation.",
          "type": "string",
          "enum": [
            "DAY",
            "WEEK",
            "MONTH",
            "YEAR"
          ],
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "DAY"
              ],
              "description": "A daily cycle."
            },
            {
              "type": "string",
              "enum": [
                "WEEK"
              ],
              "description": "A weekly cycle."
            },
            {
              "type": "string",
              "enum": [
                "MONTH"
              ],
              "description": "A monthly cycle."
            },
            {
              "type": "string",
              "enum": [
                "YEAR"
              ],
              "description": "A yearly cycle."
            }
          ]
        },
        "interval_count": {
          "description": "The number of intervals between each recurring invoice cycle. For example, an interval_count of 2 with interval_unit of MONTH means the invoice recurs every 2 months.",
          "type": "integer",
          "minimum": 1,
          "maximum": 52,
          "default": 1
        }
      }
    },
    "recipient_info": {
      "title": "recipient_info",
      "description": "The billing and shipping information. Includes name, email, address, phone, and language.",
      "type": "object",
      "properties": {
        "billing_info": {
          "$ref": "#/$defs/billing_info"
        },
        "shipping_info": {
          "allOf": [
            {
              "$ref": "#/$defs/contact_name_address"
            },
            {
              "description": "The recipient's shipping information. Includes the user's contact information, which includes name and address."
            }
          ]
        }
      }
    },
    "recurring_auto_cancellation": {
      "title": "recurring_auto_cancellation",
      "description": "The auto cancellation details for a recurring invoice. Since a series has no fixed issue date or due date, the cancellation trigger is expressed as a condition relative to each occurrence's due date rather than a single resolved calendar date.",
      "type": "object",
      "properties": {
        "condition": {
          "allOf": [
            {
              "$ref": "#/$defs/conditional_rule_relative_conditions"
            },
            {
              "description": "The condition, relative to each occurrence's due date, after which the invoice is automatically cancelled if it remains unpaid."
            }
          ]
        }
      }
    },
    "recurring_configuration": {
      "title": "configuration",
      "description": "The invoice configuration details. Includes partial payment, tip, and tax calculated after discount.",
      "type": "object",
      "allOf": [
        {
          "$ref": "#/$defs/base_configuration"
        },
        {
          "type": "object",
          "properties": {
            "template_id": {
              "description": "The template ID. The template determines the layout of the invoice. <blockquote>You can either use an existing template ID or create a new template via the create template API and then use the newly created template's ID.</blockquote>",
              "type": "string",
              "minLength": 22,
              "maxLength": 22,
              "pattern": "^(TEMP-)[A-Z0-9]+$",
              "default": "PayPal system template"
            },
            "payment_method_overrides": {
              "description": "The payment method override configurations for the recurring invoice. Defines which payment methods are enabled and any rules that control payment behavior. When provided during series creation or update, this array replaces any existing payment method override configuration for the series. <blockquote><strong>Note: </strong>Payment method availability depends on the merchant's country, the buyer's country, and the invoice amount. Override configurations only take effect if the specified payment method is available for the invoice.</blockquote>",
              "type": "array",
              "minItems": 1,
              "maxItems": 15,
              "items": {
                "$ref": "#/$defs/override_payment_method_detail"
              }
            },
            "theme": {
              "allOf": [
                {
                  "$ref": "#/$defs/configurable_theme"
                },
                {
                  "description": "The theme configuration that defines the visual appearance of the invoice's payer view page."
                }
              ]
            }
          }
        }
      ]
    },
    "recurring_early_payment_discount": {
      "title": "recurring_early_payment_discount",
      "description": "The early payment discount for a recurring invoice. Since a series has no fixed issue date or due date, the discount window is expressed as a condition relative to each occurrence's issue date rather than a single resolved calendar date.",
      "type": "object",
      "properties": {
        "condition": {
          "allOf": [
            {
              "$ref": "#/$defs/conditional_rule_relative_conditions"
            },
            {
              "description": "The condition, relative to each occurrence's issue date, before which payment must be made to qualify for the discount."
            }
          ]
        },
        "percent": {
          "allOf": [
            {
              "$ref": "#/$defs/percentage"
            },
            {
              "description": "The early payment discount percentage value."
            }
          ]
        },
        "amount": {
          "allOf": [
            {
              "$ref": "#/$defs/money"
            },
            {
              "description": "The early payment discount amount value."
            }
          ]
        }
      }
    },
    "recurring_info": {
      "title": "recurring_info",
      "description": "Comprehensive information about a recurring invoice series, including invoice details, participant information, line items, and amount calculations.",
      "type": "object",
      "required": [
        "detail",
        "primary_recipients"
      ],
      "properties": {
        "detail": {
          "allOf": [
            {
              "$ref": "#/$defs/recurring_series_detail"
            },
            {
              "description": "The recurring series configuration details, including payment terms and scheduling information."
            }
          ]
        },
        "invoicer": {
          "allOf": [
            {
              "$ref": "#/$defs/invoicer_info"
            },
            {
              "description": "The merchant or business information for the party issuing the recurring invoices. Includes business name, contact details (email, address, phone, fax), tax identification number, additional notes, and logo URL."
            }
          ]
        },
        "primary_recipients": {
          "description": "The primary recipient of the recurring invoices. Contains billing and shipping information including the recipient's name, email address, physical address, phone number, and preferred language.",
          "type": "array",
          "minItems": 1,
          "maxItems": 1,
          "items": {
            "allOf": [
              {
                "$ref": "#/$defs/recipient_info"
              },
              {
                "title": "primary_recipient"
              }
            ]
          }
        },
        "additional_recipients": {
          "description": "Additional email addresses to receive carbon copy (CC) notifications when invoices in this series are sent.",
          "type": "array",
          "minItems": 1,
          "maxItems": 100,
          "items": {
            "allOf": [
              {
                "$ref": "#/$defs/email_address"
              },
              {
                "title": "additional_recipient"
              }
            ]
          }
        },
        "items": {
          "description": "The line items that will appear on each invoice in the recurring series. Each item includes product or service details, quantity, unit price, and any applicable discounts or taxes.",
          "type": "array",
          "minItems": 1,
          "maxItems": 100,
          "items": {
            "$ref": "#/$defs/item"
          }
        },
        "configuration": {
          "allOf": [
            {
              "$ref": "#/$defs/recurring_configuration"
            },
            {
              "description": "Configuration settings for invoices in this series. Defines whether partial payments are allowed, tip options, and whether tax is calculated before or after applying discounts."
            }
          ]
        },
        "amount": {
          "allOf": [
            {
              "$ref": "#/$defs/amount_summary_detail"
            },
            {
              "description": "The calculated amount breakdown for each invoice in the series, including subtotal of all items, total discounts applied, tax amounts, and shipping costs. Note: Only invoice-level discount, shipping, and custom amounts are accepted. The rest of the fields are not mandatory and are ignored if set. They are automatically computed irrespective of the values set in the request."
            }
          ]
        }
      }
    },
    "recurring_metadata": {
      "title": "recurring_metadata",
      "description": "Comprehensive audit and tracking metadata that captures key lifecycle events and actions performed on the recurring invoice series, including creation, updates and cancellation.",
      "type": "object",
      "readOnly": true,
      "allOf": [
        {
          "$ref": "#/$defs/template_metadata"
        },
        {
          "type": "object",
          "properties": {
            "canceled_time": {
              "allOf": [
                {
                  "$ref": "#/$defs/date_time"
                },
                {
                  "description": "The date and time when the recurring series was canceled, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.6). Only populated if the series has been cancelled.",
                  "readOnly": true
                }
              ]
            }
          }
        }
      ]
    },
    "recurring_payment_term": {
      "title": "recurring_payment_term",
      "description": "The payment term of the recurring invoice. Payment can be due upon receipt, in a set number of days, or have no due date. Also includes the conditional rules (early payment discount, auto cancellation) associated with the recurring invoice.",
      "type": "object",
      "properties": {
        "term_type": {
          "$ref": "#/$defs/payment_term_type"
        },
        "conditional_rules": {
          "$ref": "#/$defs/recurring_payment_term_conditional_rules"
        }
      }
    },
    "recurring_payment_term_conditional_rules": {
      "title": "recurring_payment_term_conditional_rules",
      "description": "The conditional rules associated with the recurring invoice. Includes early payment discount and auto cancellation details, expressed relative to each occurrence rather than as a single resolved date since a series has no fixed issue date or due date.",
      "type": "object",
      "properties": {
        "early_payment_discount": {
          "$ref": "#/$defs/recurring_early_payment_discount"
        },
        "auto_cancellation": {
          "$ref": "#/$defs/recurring_auto_cancellation"
        }
      }
    },
    "recurring_series_detail": {
      "title": "recurring_series_detail",
      "description": "The detailed information for a recurring invoice series, including payment terms and other configuration settings.",
      "type": "object",
      "allOf": [
        {
          "$ref": "#/$defs/detail"
        },
        {
          "type": "object",
          "properties": {
            "payment_term": {
              "allOf": [
                {
                  "$ref": "#/$defs/recurring_payment_term"
                },
                {
                  "description": "The payment terms that define when payment is due for invoices in this series."
                }
              ]
            },
            "tip_presets": {
              "description": "Specifies the predefined tip options configured by the invoicer. These preset values are shown to customers at checkout as suggested tipping amounts, in addition to the option to enter a custom tip.",
              "type": "array",
              "minItems": 1,
              "maxItems": 3,
              "items": {
                "$ref": "#/$defs/tip_preset"
              }
            }
          }
        }
      ]
    },
    "recurring_status": {
      "description": "The lifecycle status of a recurring invoice series. Determines the operational state and whether invoices are actively being generated.",
      "type": "string",
      "enum": [
        "DRAFT",
        "ACTIVE",
        "CANCELLED",
        "EXPIRED"
      ],
      "readOnly": true,
      "oneOf": [
        {
          "type": "string",
          "enum": [
            "DRAFT"
          ],
          "description": "The recurring series is in draft state. No invoices are generated or sent until the series is activated. The series configuration can be edited while in draft status."
        },
        {
          "type": "string",
          "enum": [
            "ACTIVE"
          ],
          "description": "The recurring series is active and operational. Invoices are automatically generated and sent to recipients according to the configured schedule and payment plan."
        },
        {
          "type": "string",
          "enum": [
            "CANCELLED"
          ],
          "description": "The recurring series has been canceled and is no longer active. No additional invoices will be generated or sent. This action is typically irreversible."
        },
        {
          "type": "string",
          "enum": [
            "EXPIRED"
          ],
          "description": "The recurring series has reached its scheduled end date or maximum number of invoices and is now expired. No additional invoices will be generated or sent."
        }
      ]
    },
    "restrictive_email_address": {
      "description": "The internationalized email address with more restrictive rules. This version restricts the local-part to a dot-atom as defined in https://www.ietf.org/rfc/rfc5322.txt. It does not allow for a quoted-string or an obs-local-part. <ul><li>Allows alphanumeric and RFC-allowed special characters, !#$%&'*+-/=?^_`{|}~</li><li>Ensures that the local part does not start with dot (.), have consecutive dots, or end with dot. Ensures that the domain part does not have consecutive dots.</li><li>Ensures that the local part does not exceed 64 characters.</li></ul><blockquote><strong>Note:</strong> Up to 64 characters are allowed before and 255 characters are allowed after the <code>@</code> sign. However, the generally accepted maximum length for an email address is 254 characters. The pattern verifies that an unquoted <code>@</code> sign exists.</blockquote>",
      "type": "string",
      "minLength": 3,
      "maxLength": 254,
      "pattern": "^(?!\\.)(?:[A-Za-z0-9!#$&'*\\/=?^`{|}~_%+-]|\\.(?!\\.)){1,64}(?<!\\.)@(?:[A-Za-z0-9-]|\\.(?!\\.))+\\.[a-zA-Z]{2,}$"
    },
    "shipping_cost": {
      "title": "shipping_cost",
      "description": "The shipping fee for all items. Includes tax on shipping.",
      "type": "object",
      "properties": {
        "amount": {
          "allOf": [
            {
              "$ref": "#/$defs/money"
            },
            {
              "description": "The shipping amount. Value is from `0` to `1000000`. Supports up to two decimal places."
            }
          ]
        },
        "tax": {
          "allOf": [
            {
              "$ref": "#/$defs/tax"
            },
            {
              "description": "The tax associated with the shipping."
            }
          ]
        }
      }
    },
    "tax": {
      "title": "tax",
      "description": "The tax information. Includes the tax name and tax rate of invoice items. The tax amount is added to the item total.",
      "type": "object",
      "required": [
        "name",
        "percent"
      ],
      "properties": {
        "name": {
          "description": "The name of the tax applied on the invoice items.",
          "type": "string",
          "minLength": 0,
          "maxLength": 100,
          "pattern": "^[\\s\\S]*$"
        },
        "percent": {
          "allOf": [
            {
              "$ref": "#/$defs/percentage"
            },
            {
              "description": "The tax rate. Value is from `0` to `100`. Supports up to five decimal places."
            }
          ]
        },
        "amount": {
          "allOf": [
            {
              "$ref": "#/$defs/money"
            },
            {
              "description": "The calculated tax amount. The tax amount is added to the item total.",
              "readOnly": true
            }
          ]
        },
        "tax_note": {
          "description": "The tax note used to track the tax related data.",
          "type": "string",
          "minLength": 0,
          "maxLength": 40,
          "pattern": "^[\\s\\S]*$"
        }
      }
    },
    "template_metadata": {
      "title": "template_metadata",
      "description": "The audit metadata. Captures all template actions on create and update.",
      "type": "object",
      "properties": {
        "create_time": {
          "allOf": [
            {
              "$ref": "#/$defs/date_time"
            },
            {
              "description": "The date and time when the resource was created, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.6).",
              "readOnly": true
            }
          ]
        },
        "created_by": {
          "description": "The email address of the account that created the resource.",
          "type": "string",
          "minLength": 0,
          "maxLength": 2147483647,
          "pattern": "^[\\S\\s]*$",
          "readOnly": true
        },
        "last_update_time": {
          "allOf": [
            {
              "$ref": "#/$defs/date_time"
            },
            {
              "description": "The date and time when the resource was last edited, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.6).",
              "readOnly": true
            }
          ]
        },
        "last_updated_by": {
          "description": "The email address of the account that last edited the resource.",
          "type": "string",
          "minLength": 0,
          "maxLength": 2147483647,
          "pattern": "^[\\S\\s]*$",
          "readOnly": true
        }
      }
    },
    "tip_preset": {
      "title": "tip_preset",
      "description": "Defines a tip option that can be presented to the customer as a percentage of the invoice total. **Note:** This preset represents a tip configuration where the percentage value is applied during checkout to calculate the tip amount.",
      "type": "object",
      "properties": {
        "percent": {
          "allOf": [
            {
              "$ref": "#/$defs/percentage"
            },
            {
              "description": "The tip percentage ranging from `0` to `100` inclusive. Supports up to five decimal places."
            }
          ]
        }
      }
    },
    "unit_of_measure": {
      "title": "unit_of_measure",
      "description": "The unit of measure for the invoiced item.",
      "type": "string",
      "enum": [
        "QUANTITY",
        "HOURS",
        "AMOUNT"
      ],
      "oneOf": [
        {
          "type": "string",
          "enum": [
            "QUANTITY"
          ],
          "description": "The unit of measure is quantity. This invoice template is typically used for physical goods."
        },
        {
          "type": "string",
          "enum": [
            "HOURS"
          ],
          "description": "The unit of measure is hours. This invoice template is typically used for services."
        },
        {
          "type": "string",
          "enum": [
            "AMOUNT"
          ],
          "description": "The unit of measure is amount. This invoice template is typically used when only amount is required."
        }
      ]
    }
  }
}