{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/machinesignal-it/json-schema/machinesignal-it-order-intent-request-schema.json",
  "title": "OrderIntentRequest",
  "x-generated": "2026-10-30",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/api.machinesignal.it-openapi.json#/components/schemas/OrderIntentRequest",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "buyer_business_name",
    "buyer_country",
    "buyer_vat_or_tax_identifier",
    "buyer_sdi_or_pec",
    "buyer_billing_address",
    "buyer_contact_email",
    "product_code",
    "price_eur",
    "stamp_duty_eur",
    "total_due_eur",
    "currency",
    "requested_outputs",
    "b2b_italy_confirmation",
    "terms_privacy_refund_acceptance",
    "onerous_clauses_specific_approval",
    "jurisdiction_forum",
    "buyer_authorizes_business_card_payment"
  ],
  "properties": {
    "buyer_business_name": {
      "type": "string",
      "minLength": 2
    },
    "buyer_country": {
      "const": "IT"
    },
    "buyer_vat_or_tax_identifier": {
      "type": "string",
      "minLength": 6
    },
    "buyer_sdi_or_pec": {
      "type": "string",
      "minLength": 6
    },
    "buyer_billing_address": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "line1",
        "postal_code",
        "city",
        "province",
        "country"
      ],
      "properties": {
        "line1": {
          "type": "string"
        },
        "postal_code": {
          "type": "string"
        },
        "city": {
          "type": "string"
        },
        "province": {
          "type": "string"
        },
        "country": {
          "const": "IT"
        }
      }
    },
    "buyer_contact_email": {
      "type": "string",
      "format": "email"
    },
    "product_code": {
      "enum": [
        "MS-DEC-250",
        "MS-ACT-25"
      ]
    },
    "price_eur": {
      "enum": [
        49,
        399
      ]
    },
    "stamp_duty_eur": {
      "enum": [
        0,
        2
      ]
    },
    "total_due_eur": {
      "enum": [
        49,
        401
      ]
    },
    "currency": {
      "const": "EUR"
    },
    "requested_outputs": {
      "enum": [
        250,
        25
      ]
    },
    "b2b_italy_confirmation": {
      "const": true
    },
    "terms_privacy_refund_acceptance": {
      "const": true
    },
    "onerous_clauses_specific_approval": {
      "const": true
    },
    "jurisdiction_forum": {
      "const": "Court of Milan, Italy"
    },
    "buyer_authorizes_business_card_payment": {
      "const": true
    },
    "source_product_code": {
      "const": "MS-DEC-250"
    },
    "source_order_intent_id": {
      "type": "string"
    },
    "source_delivery_id": {
      "type": "string"
    },
    "qualified_record_refs": {
      "type": "array",
      "minItems": 25,
      "maxItems": 25,
      "uniqueItems": true,
      "items": {
        "type": "string"
      }
    },
    "continuation_entitlement": {
      "type": "string",
      "minLength": 64
    }
  },
  "allOf": [
    {
      "if": {
        "properties": {
          "product_code": {
            "const": "MS-DEC-250"
          }
        }
      },
      "then": {
        "properties": {
          "price_eur": {
            "const": 49
          },
          "stamp_duty_eur": {
            "const": 0
          },
          "total_due_eur": {
            "const": 49
          },
          "requested_outputs": {
            "const": 250
          }
        }
      }
    },
    {
      "if": {
        "properties": {
          "product_code": {
            "const": "MS-ACT-25"
          }
        }
      },
      "then": {
        "required": [
          "source_product_code",
          "source_order_intent_id",
          "source_delivery_id",
          "qualified_record_refs",
          "continuation_entitlement"
        ],
        "properties": {
          "price_eur": {
            "const": 399
          },
          "stamp_duty_eur": {
            "const": 2
          },
          "total_due_eur": {
            "const": 401
          },
          "requested_outputs": {
            "const": 25
          }
        }
      }
    }
  ]
}