{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/lemonway/json-schema/lemonway-init-pay-pal-transaction-input-schema.json",
  "title": "InitPayPalTransactionInput",
  "description": "Init PayPal transaction input",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/lemonway-moneyins-paypal-api-openapi.yml#/components/schemas/InitPayPalTransactionInput",
  "required": [
    "redirections",
    "transaction",
    "items"
  ],
  "type": "object",
  "properties": {
    "redirections": {
      "$ref": "#/$defs/Redirections"
    },
    "transaction": {
      "$ref": "#/$defs/Transaction"
    },
    "amountBreakdown": {
      "$ref": "#/$defs/AmountBreakdown"
    },
    "delivery": {
      "$ref": "#/$defs/Delivery"
    },
    "items": {
      "description": "Items",
      "type": "array",
      "items": {
        "$ref": "#/$defs/PurchaseItem"
      }
    },
    "riskData": {
      "description": "Risk data",
      "type": "object",
      "additionalProperties": {
        "type": "string"
      }
    }
  },
  "$defs": {
    "AmountBreakdown": {
      "description": "The amount breakdown.",
      "type": "object",
      "properties": {
        "totalItems": {
          "format": "int32",
          "description": "The subtotal for all items.",
          "maximum": 2147483647,
          "minimum": 0,
          "type": "integer"
        },
        "totalItemTaxes": {
          "format": "int32",
          "description": "The total tax for all items.",
          "maximum": 2147483647,
          "minimum": 0,
          "type": "integer"
        },
        "shipping": {
          "format": "int32",
          "description": "The shipping fee for all items.",
          "maximum": 2147483647,
          "minimum": 0,
          "type": "integer"
        },
        "handling": {
          "format": "int32",
          "description": "The handling fee for all items.",
          "maximum": 2147483647,
          "minimum": 0,
          "type": "integer"
        },
        "insurance": {
          "format": "int32",
          "description": "The insurance fee for all items.",
          "maximum": 2147483647,
          "minimum": 0,
          "type": "integer"
        },
        "shippingDiscount": {
          "format": "int32",
          "description": "The shipping discount for all items.",
          "maximum": 2147483647,
          "minimum": 0,
          "type": "integer"
        },
        "discount": {
          "format": "int32",
          "description": "The discount for all items.",
          "maximum": 2147483647,
          "minimum": 0,
          "type": "integer"
        }
      }
    },
    "Delivery": {
      "description": "Delivery",
      "required": [
        "receiver",
        "address"
      ],
      "type": "object",
      "properties": {
        "receiver": {
          "$ref": "#/$defs/Receiver"
        },
        "address": {
          "$ref": "#/$defs/PaypalDeliveryAddress"
        }
      }
    },
    "PaypalDeliveryAddress": {
      "description": "Address",
      "required": [
        "country",
        "city",
        "street",
        "postCode"
      ],
      "type": "object",
      "properties": {
        "country": {
          "description": "ISO 3166-1 alpha-2",
          "maxLength": 2,
          "minLength": 2,
          "type": "string"
        },
        "city": {
          "description": "City",
          "maxLength": 140,
          "minLength": 0,
          "type": "string"
        },
        "street": {
          "description": "Number and street",
          "maxLength": 256,
          "minLength": 0,
          "type": "string"
        },
        "postCode": {
          "description": "Postcode/ZIP",
          "maxLength": 10,
          "minLength": 0,
          "type": "string"
        },
        "state": {
          "description": "Postcode/ZIP",
          "maxLength": 255,
          "minLength": 0,
          "type": "string"
        }
      }
    },
    "PurchaseItem": {
      "description": "Item",
      "required": [
        "merchantAccountId",
        "description",
        "quantity",
        "unitAmount",
        "type"
      ],
      "type": "object",
      "properties": {
        "merchantAccountId": {
          "description": "Merchant account id",
          "type": "string"
        },
        "description": {
          "description": "Description",
          "maxLength": 127,
          "minLength": 0,
          "type": "string"
        },
        "quantity": {
          "format": "int32",
          "description": "Quantity",
          "maximum": 2147483647,
          "minimum": 0,
          "type": "integer"
        },
        "unitAmount": {
          "format": "int32",
          "description": "Unit amount",
          "maximum": 2147483647,
          "minimum": 0,
          "type": "integer"
        },
        "type": {
          "format": "int32",
          "description": "Type<br/>1 = Physical.<br/>2 = Digital.<br/>",
          "enum": [
            1,
            2
          ],
          "type": "integer"
        },
        "taxAmount": {
          "format": "int32",
          "description": "Tax amount",
          "maximum": 2147483647,
          "minimum": 0,
          "type": "integer"
        }
      }
    },
    "Receiver": {
      "description": "Receiver",
      "required": [
        "fullName"
      ],
      "type": "object",
      "properties": {
        "fullName": {
          "description": "Full name",
          "maxLength": 255,
          "minLength": 0,
          "type": "string"
        }
      }
    },
    "Redirections": {
      "description": "Redirection urls",
      "required": [
        "returnUrl",
        "errorUrl",
        "cancelUrl"
      ],
      "type": "object",
      "properties": {
        "returnUrl": {
          "description": "Return URL",
          "maxLength": 2048,
          "minLength": 0,
          "type": "string"
        },
        "errorUrl": {
          "description": "Error URl",
          "maxLength": 2048,
          "minLength": 0,
          "type": "string"
        },
        "cancelUrl": {
          "description": "Cancel URL",
          "maxLength": 2048,
          "minLength": 0,
          "type": "string"
        }
      }
    },
    "Transaction": {
      "description": "Transcation",
      "required": [
        "reference",
        "accountId",
        "totalAmount",
        "commissionAmount"
      ],
      "type": "object",
      "properties": {
        "reference": {
          "description": "Reference",
          "type": "string"
        },
        "accountId": {
          "description": "Account Id",
          "type": "string"
        },
        "totalAmount": {
          "format": "int32",
          "description": "Total Amount",
          "type": "integer"
        },
        "commissionAmount": {
          "format": "int32",
          "description": "Commission Amount",
          "type": "integer"
        },
        "comment": {
          "description": "Comment",
          "type": "string"
        },
        "autoCommission": {
          "description": "Auto Commission",
          "type": "boolean"
        },
        "isPreAuth": {
          "type": "boolean"
        },
        "captureMode": {
          "format": "int32",
          "description": "Specifies the capture mode for the payment:\nAutomatic results in a Capture type, and Manual results in an Authorize type.<br/>1 = Automatic.<br/>2 = Manual.<br/>",
          "enum": [
            1,
            2
          ],
          "type": "integer"
        }
      }
    }
  }
}