{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/shieldz-cash/json-schema/shieldz-cash-invoice-create-schema.json",
  "title": "InvoiceCreate",
  "description": "Send amount_usd_cents, or line_items and the total is computed from them.",
  "x-generated": "2026-11-24",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/shieldz-cash-openapi.json#/components/schemas/InvoiceCreate",
  "type": "object",
  "properties": {
    "amount_usd_cents": {
      "type": "integer",
      "minimum": 100,
      "maximum": 10000000,
      "description": "Amount in USD cents. Omit when sending line_items."
    },
    "line_items": {
      "type": "array",
      "maxItems": 20,
      "items": {
        "type": "object",
        "properties": {
          "price": {
            "type": "string",
            "description": "A price ID (price_…) from your catalog."
          },
          "price_data": {
            "type": "object",
            "required": [
              "name",
              "unit_amount_usd_cents"
            ],
            "properties": {
              "name": {
                "type": "string"
              },
              "unit_amount_usd_cents": {
                "type": "integer",
                "minimum": 0
              }
            },
            "description": "An inline price, for items not in your catalog."
          },
          "quantity": {
            "type": "integer",
            "minimum": 1,
            "maximum": 999,
            "default": 1
          },
          "amount_usd_cents": {
            "type": "integer",
            "description": "Only for a price where the customer chooses the amount."
          }
        }
      }
    },
    "client_reference_id": {
      "type": "string",
      "maxLength": 200,
      "description": "Your order or cart id, echoed on the invoice and webhooks."
    },
    "return_url": {
      "type": "string",
      "format": "uri",
      "description": "Public https URL the paid checkout returns the buyer to. success_url is accepted as an alias."
    },
    "memo": {
      "type": "string"
    },
    "customer_email": {
      "type": "string",
      "format": "email"
    },
    "expires_in_seconds": {
      "type": "integer",
      "minimum": 300,
      "maximum": 86400,
      "default": 3600
    },
    "idempotency_key": {
      "type": "string",
      "description": "Replaying the same key returns the original invoice."
    },
    "metadata": {
      "type": "object",
      "additionalProperties": true,
      "description": "Arbitrary JSON, echoed back on webhooks."
    },
    "settlement": {
      "$ref": "#/$defs/Settlement"
    }
  },
  "$defs": {
    "Settlement": {
      "type": "object",
      "properties": {
        "chain": {
          "type": "string"
        },
        "asset": {
          "type": "string"
        },
        "address": {
          "type": "string"
        }
      }
    }
  }
}