{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/adadiamonds-com/json-schema/adadiamonds-com-ucp-checkout-request-schema.json",
  "title": "UcpCheckoutRequest",
  "x-generated": "2026-10-31",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/adadiamonds-com-openapi.json#/components/schemas/UcpCheckoutRequest",
  "type": "object",
  "required": [
    "line_items"
  ],
  "properties": {
    "line_items": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "required": [
          "item"
        ],
        "properties": {
          "item": {
            "type": "object",
            "required": [
              "id"
            ],
            "properties": {
              "id": {
                "type": "string"
              }
            }
          },
          "quantity": {
            "type": "integer",
            "minimum": 1,
            "default": 1
          }
        }
      }
    },
    "buyer": {
      "$ref": "#/$defs/UcpBuyer"
    },
    "context": {
      "type": "object",
      "properties": {
        "language": {
          "type": "string"
        }
      }
    },
    "fulfillment": {
      "type": "object",
      "properties": {
        "methods": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "shipping"
                ]
              },
              "selected_destination_id": {
                "type": "string"
              },
              "destinations": {
                "type": "array",
                "items": {
                  "$ref": "#/$defs/UcpPostalAddress"
                }
              },
              "groups": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "selected_option_id": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "$defs": {
    "UcpBuyer": {
      "type": "object",
      "properties": {
        "first_name": {
          "type": "string"
        },
        "last_name": {
          "type": "string"
        },
        "email": {
          "type": "string",
          "format": "email"
        },
        "phone_number": {
          "type": "string"
        }
      }
    },
    "UcpPostalAddress": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "first_name": {
          "type": "string"
        },
        "last_name": {
          "type": "string"
        },
        "full_name": {
          "type": "string"
        },
        "street_address": {
          "type": "string"
        },
        "extended_address": {
          "type": "string"
        },
        "address_locality": {
          "type": "string"
        },
        "address_region": {
          "type": "string"
        },
        "postal_code": {
          "type": "string"
        },
        "address_country": {
          "type": "string"
        },
        "phone_number": {
          "type": "string"
        }
      }
    }
  }
}