{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/paypal/json-schema/paypal-payment-resource-request-schema.json",
  "title": "Create Payment Resource Request.",
  "description": "Create payment resource details.",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/paypal-payment-resources-api-openapi.yml#/components/schemas/payment_resource_request",
  "type": "object",
  "allOf": [
    {
      "$ref": "#/$defs/payment_resource_entity"
    }
  ],
  "$defs": {
    "adjustable_quantity": {
      "type": "object",
      "title": "Adjustable Quantity",
      "description": "Allows customers to change the quantity of this item during checkout.",
      "properties": {
        "maximum": {
          "type": "integer",
          "description": "The maximum quantity customers can select. Must be between 1 and 100. Setting this value enables the quantity picker at checkout.",
          "minimum": 1,
          "maximum": 100
        }
      },
      "required": [
        "maximum"
      ]
    },
    "currency_code": {
      "description": "The [three-character ISO-4217 currency code](/api/rest/reference/currency-codes/) that identifies the currency.",
      "type": "string",
      "format": "ppaas_common_currency_code_v2",
      "minLength": 3,
      "maxLength": 3
    },
    "customer_note": {
      "type": "object",
      "title": "Customer Note",
      "description": "Label for a custom field to collect additional information from customers about this item (e.g., \"Engraving text\" or \"Special instructions\"). Can be set as mandatory.",
      "properties": {
        "required": {
          "type": "boolean",
          "description": "Whether this custom field is required for checkout. Set to true to make the field mandatory."
        },
        "label": {
          "description": "The label displayed to customers for this custom input field (e.g., \"Enter engraving text\" or \"Delivery instructions\").",
          "type": "string",
          "minLength": 1,
          "maxLength": 127,
          "pattern": "^.*$"
        }
      }
    },
    "customer_note_list": {
      "type": "array",
      "minItems": 1,
      "maxItems": 1,
      "description": "Label for a custom field to collect additional information from customers about this item (e.g., \"Engraving text\" or \"Special instructions\"). Can be set as mandatory.",
      "items": {
        "$ref": "#/$defs/customer_note"
      }
    },
    "dimension": {
      "type": "object",
      "title": "Variant of Payment Resource",
      "description": "Variant dimension structure with multiple options. Each variant can have multiple options, and only one variant can be marked as primary.",
      "properties": {
        "name": {
          "type": "string",
          "description": "The name of the variant dimension (e.g., \"Size\", \"Color\").",
          "minLength": 1,
          "maxLength": 64,
          "pattern": "^.*$"
        },
        "primary": {
          "type": "boolean",
          "description": "Only one dimension has <code>primary</code> set to true. Only options in the primary dimension can have <code>unit_amount</code>."
        },
        "options": {
          "$ref": "#/$defs/dimension_option_list"
        }
      },
      "required": [
        "name",
        "primary",
        "options"
      ]
    },
    "dimension_list": {
      "type": "array",
      "description": "List of variant dimensions available for this product. Each dimension can have multiple options.",
      "minItems": 1,
      "maxItems": 5,
      "items": {
        "$ref": "#/$defs/dimension"
      }
    },
    "dimension_option": {
      "type": "object",
      "title": "Option available for the item.",
      "description": "Option available for the item.",
      "properties": {
        "label": {
          "type": "string",
          "description": "The display label for this option (e.g., \"Large\").",
          "minLength": 1,
          "maxLength": 200,
          "pattern": "^.*$"
        },
        "unit_amount": {
          "description": "Unit Price of this option, including value and currency code.",
          "$ref": "#/$defs/money"
        }
      },
      "required": [
        "label"
      ]
    },
    "dimension_option_list": {
      "type": "array",
      "description": "List of option available.",
      "minItems": 1,
      "maxItems": 10,
      "items": {
        "$ref": "#/$defs/dimension_option"
      }
    },
    "integration_mode": {
      "title": "Integration Mode",
      "description": "Determines how the payment resource is presented to customers. Currently, only LINK is supported, which generates a PayPal-hosted payment page with a shareable URL. This value is immutable after creation.",
      "type": "string",
      "pattern": "^[A-Z0-9_]+$",
      "minLength": 1,
      "maxLength": 20,
      "enum": [
        "LINK"
      ],
      "oneOf": [
        {
          "type": "string",
          "enum": [
            "LINK"
          ],
          "description": "Generates a hosted payment page accessible via URL. Currently the only supported mode."
        }
      ]
    },
    "line_item": {
      "type": "object",
      "title": "Line Item of Payment Resource",
      "description": "List of individual item in payment resource.",
      "properties": {
        "name": {
          "type": "string",
          "description": "The product or service name displayed to customers during checkout.",
          "minLength": 1,
          "maxLength": 127,
          "pattern": "^.*$"
        },
        "product_id": {
          "type": "string",
          "description": "Your internal identifier for this product.",
          "minLength": 1,
          "maxLength": 50,
          "pattern": "^.*$"
        },
        "description": {
          "type": "string",
          "description": "Detailed information about the product or service shown to customers during checkout. Use this to provide additional context, specifications, or terms.",
          "minLength": 1,
          "maxLength": 2048,
          "pattern": "^.*$"
        },
        "unit_amount": {
          "description": "The price per unit of this item, including the numeric value and currency code.",
          "$ref": "#/$defs/money"
        },
        "taxes": {
          "$ref": "#/$defs/tax_list"
        },
        "shipping": {
          "$ref": "#/$defs/shipping_list"
        },
        "collect_shipping_address": {
          "type": "boolean",
          "description": "Prompts customers for a shipping address during checkout for this item. Set to true for physical goods that require delivery, false for digital goods."
        },
        "customer_notes": {
          "$ref": "#/$defs/customer_note_list"
        },
        "variants": {
          "description": "Product variants such as size, color, or material presented to customers during checkout. Each variant (e.g., \"Size\") can have up to 10 options (e.g., \"S\", \"M\", \"L\", \"XL\"). Supports up to 5 variants total. One variant can be designated as primary to enable different prices per option.",
          "$ref": "#/$defs/variants"
        },
        "adjustable_quantity": {
          "description": "Allows customers to change the quantity of this item during checkout.",
          "$ref": "#/$defs/adjustable_quantity"
        }
      }
    },
    "line_item_list": {
      "type": "array",
      "minItems": 1,
      "maxItems": 20,
      "description": "List of individual item in payment resource.",
      "items": {
        "$ref": "#/$defs/line_item"
      }
    },
    "money": {
      "type": "object",
      "title": "Money",
      "description": "The currency and amount for a financial transaction, such as a balance or payment due.",
      "properties": {
        "currency_code": {
          "$ref": "#/$defs/currency_code"
        },
        "value": {
          "type": "string",
          "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/).",
          "maxLength": 32,
          "pattern": "^((-?[0-9]+)|(-?([0-9]+)?[.][0-9]+))$"
        }
      },
      "required": [
        "currency_code",
        "value"
      ]
    },
    "payment_resource_entity": {
      "type": "object",
      "title": "Payment Resource Entity",
      "description": "Payment resource details.",
      "properties": {
        "integration_mode": {
          "$ref": "#/$defs/integration_mode"
        },
        "type": {
          "$ref": "#/$defs/payment_resource_type"
        },
        "reusable": {
          "$ref": "#/$defs/reusable"
        },
        "return_url": {
          "type": "string",
          "description": "URL to which the customer is redirected after completing the transaction.",
          "minLength": 1,
          "maxLength": 1024,
          "pattern": "^.*$",
          "format": "uri"
        },
        "line_items": {
          "$ref": "#/$defs/line_item_list"
        }
      },
      "required": [
        "integration_mode",
        "type"
      ]
    },
    "payment_resource_type": {
      "title": "Payment Resource Type",
      "description": "The type of payment resource. Once a payment resource is created, this field cannot be changed.",
      "type": "string",
      "pattern": "^[A-Z0-9_]+$",
      "minLength": 1,
      "maxLength": 20,
      "enum": [
        "BUY_NOW"
      ],
      "oneOf": [
        {
          "type": "string",
          "enum": [
            "BUY_NOW"
          ],
          "description": "Single-item purchase with immediate payment completion. Creates a payment resource for one product or service that processes payment in real-time during checkout."
        }
      ]
    },
    "reusable": {
      "title": "Reusable",
      "description": "Indicates if the payment resource can be used multiple times or only once.",
      "type": "string",
      "pattern": "^[A-Z0-9_]+$",
      "minLength": 1,
      "maxLength": 20,
      "default": "MULTIPLE",
      "enum": [
        "MULTIPLE"
      ],
      "oneOf": [
        {
          "type": "string",
          "enum": [
            "MULTIPLE"
          ],
          "description": "The payment resource can be used multiple times."
        }
      ]
    },
    "shipping": {
      "type": "object",
      "title": "Shipping",
      "description": "Shipping fee for this item. Shipping fee is displayed separately to customers during checkout.",
      "properties": {
        "type": {
          "description": "The method used to calculate shipping costs.",
          "type": "string",
          "pattern": "^[A-Z0-9_]+$",
          "minLength": 1,
          "maxLength": 32,
          "enum": [
            "FLAT",
            "PERCENTAGE",
            "PREFERENCE"
          ],
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "FLAT"
              ],
              "description": "Applies a fixed shipping fee regardless of quantity (e.g., $5.00 whether customer buys 1 or 10 units)."
            },
            {
              "type": "string",
              "enum": [
                "PERCENTAGE"
              ],
              "description": "Percentage shipping type eg \"10\" for 10%."
            },
            {
              "type": "string",
              "enum": [
                "PREFERENCE"
              ],
              "description": "Calculates shipping based on the merchant's PayPal account shipping settings. Requires merchant to have shipping rates configured in their PayPal Business Settings."
            }
          ]
        },
        "value": {
          "description": "The shipping value or reference. For FLAT, enter the fixed cost (e.g., \"5\" for $5.00). For PREFERENCE, must be set to \"PROFILE\".",
          "type": "string",
          "minLength": 1,
          "maxLength": 20,
          "pattern": "^.*$"
        }
      },
      "required": [
        "type",
        "value"
      ]
    },
    "shipping_list": {
      "type": "array",
      "minItems": 1,
      "maxItems": 1,
      "description": "Shipping fee for this item. Shipping fee is displayed separately to customers during checkout.",
      "items": {
        "$ref": "#/$defs/shipping"
      }
    },
    "tax": {
      "type": "object",
      "title": "Tax",
      "description": "Taxes applied to this item. Tax is displayed separately to customers during checkout.",
      "properties": {
        "name": {
          "type": "string",
          "description": "Internal label for this tax (e.g., \"Sales Tax\", \"VAT\"). Not visible to customer.",
          "minLength": 1,
          "maxLength": 127,
          "pattern": "^.*$"
        },
        "type": {
          "description": "The method used to calculate this tax.",
          "type": "string",
          "pattern": "^[A-Z0-9_]+$",
          "minLength": 1,
          "maxLength": 32,
          "enum": [
            "PERCENTAGE",
            "PREFERENCE"
          ],
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "PERCENTAGE"
              ],
              "description": "Applies a flat percentage to the item amount (e.g., 10% sales tax)."
            },
            {
              "type": "string",
              "enum": [
                "PREFERENCE"
              ],
              "description": "Calculates tax based on the merchant's PayPal account tax settings. Requires merchant to have tax rates configured in their PayPal account Settings."
            }
          ]
        },
        "value": {
          "description": "The tax amount or reference. For PERCENTAGE, enter the numeric percentage value (e.g., \"10\" for 10%). For PREFERENCE, must be set to \"PROFILE\". Maximum 20 characters.",
          "type": "string",
          "minLength": 1,
          "maxLength": 20,
          "pattern": "^.*$"
        }
      },
      "required": [
        "type",
        "value"
      ]
    },
    "tax_list": {
      "type": "array",
      "minItems": 1,
      "maxItems": 1,
      "description": "Taxes applied to this item. Tax is displayed separately to customers during checkout.",
      "items": {
        "$ref": "#/$defs/tax"
      }
    },
    "variants": {
      "type": "object",
      "title": "Variant of Payment Resource",
      "description": "Product variants such as size, color, or material presented to customers during checkout. Each variant (e.g., \"Size\") can have up to 10 options (e.g., \"S\", \"M\", \"L\", \"XL\"). Supports up to 5 variants total. One variant can be designated as primary to enable different prices per option.",
      "properties": {
        "dimensions": {
          "$ref": "#/$defs/dimension_list"
        }
      },
      "required": [
        "dimensions"
      ]
    }
  }
}