{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/send21-io/json-schema/send21-io-draft-response-schema.json",
  "title": "DraftResponse",
  "x-generated": "2026-10-31",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/send21-io-openapi.json#/components/schemas/DraftResponse",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "receiverAddress": {
      "type": [
        "string",
        "null"
      ]
    },
    "senderAddress": {
      "type": [
        "string",
        "null"
      ]
    },
    "network": {
      "$ref": "#/$defs/PaymentNetwork"
    },
    "amountSats": {
      "type": "integer",
      "format": "int64"
    },
    "amountBtc": {
      "type": [
        "string",
        "null"
      ]
    },
    "fiatCurrency": {
      "type": [
        "string",
        "null"
      ]
    },
    "fiatAmount": {
      "type": [
        "number",
        "null"
      ],
      "format": "double"
    },
    "quote": {
      "$ref": "#/$defs/QuoteInfo"
    },
    "platformFeeSats": {
      "type": "integer",
      "format": "int64"
    },
    "platformFeeAddress": {
      "type": [
        "string",
        "null"
      ]
    },
    "platformFee": {
      "$ref": "#/$defs/PlatformFeeInfo"
    },
    "paymentMethod": {
      "$ref": "#/$defs/PaymentMethod"
    },
    "bolt11": {
      "type": [
        "string",
        "null"
      ]
    },
    "memo": {
      "type": [
        "string",
        "null"
      ]
    },
    "status": {
      "$ref": "#/$defs/DraftStatus"
    },
    "paidTxId": {
      "type": [
        "string",
        "null"
      ]
    },
    "requiredConfirmations": {
      "type": "integer",
      "format": "int32"
    },
    "expiresAt": {
      "type": "string",
      "format": "date-time"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "sek": {
      "$ref": "#/$defs/SekValueInfo"
    },
    "feeOutputs": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/FeeOutputInfo"
      }
    },
    "currency": {
      "$ref": "#/$defs/PaymentCurrency"
    },
    "tokenAddress": {
      "type": [
        "string",
        "null"
      ]
    },
    "feeAccrued": {
      "type": "boolean"
    },
    "isFeeSettlement": {
      "type": "boolean"
    },
    "paymentUri": {
      "type": [
        "string",
        "null"
      ]
    },
    "amountMismatch": {
      "$ref": "#/$defs/AmountMismatchInfo"
    },
    "lightningAddress": {
      "type": [
        "string",
        "null"
      ]
    },
    "lightningConfirmable": {
      "type": "boolean"
    },
    "paymentRequestId": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid"
    },
    "amountBaseUnits": {
      "type": "integer",
      "format": "int64"
    },
    "core": {
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": {
        "nullable": true
      }
    },
    "coreSha256": {
      "type": [
        "string",
        "null"
      ]
    },
    "changeSignals": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "string"
      }
    },
    "changeNotes": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "string"
      }
    },
    "shortfallPolicy": {
      "$ref": "#/$defs/ShortfallPolicyDto"
    },
    "confirmedAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    }
  },
  "additionalProperties": false,
  "$defs": {
    "AmountMismatchInfo": {
      "type": "object",
      "properties": {
        "txId": {
          "type": [
            "string",
            "null"
          ]
        },
        "expectedBaseUnits": {
          "type": "integer",
          "format": "int64"
        },
        "receivedBaseUnits": {
          "type": "integer",
          "format": "int64"
        },
        "differenceBaseUnits": {
          "type": "integer",
          "format": "int64"
        },
        "receivedFormatted": {
          "type": [
            "string",
            "null"
          ]
        },
        "differenceFormatted": {
          "type": [
            "string",
            "null"
          ]
        },
        "confirmations": {
          "type": "integer",
          "format": "int32"
        },
        "detectedAt": {
          "type": "string",
          "format": "date-time"
        },
        "acceptedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "acceptReason": {
          "type": [
            "string",
            "null"
          ]
        },
        "acceptedBy": {
          "type": [
            "string",
            "null"
          ]
        },
        "reviewState": {
          "type": [
            "string",
            "null"
          ]
        },
        "rejectedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "rejectReason": {
          "type": [
            "string",
            "null"
          ]
        },
        "rejectedBy": {
          "type": [
            "string",
            "null"
          ]
        },
        "reviewReason": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "additionalProperties": false
    },
    "DraftStatus": {
      "enum": [
        "AwaitingPayment",
        "Seen",
        "Confirmed",
        "Expired",
        "Cancelled"
      ],
      "type": "string"
    },
    "FeeOutputInfo": {
      "type": "object",
      "properties": {
        "recipient": {
          "type": [
            "string",
            "null"
          ]
        },
        "address": {
          "type": [
            "string",
            "null"
          ]
        },
        "sats": {
          "type": "integer",
          "format": "int64"
        },
        "sharePercent": {
          "type": "number",
          "format": "double"
        }
      },
      "additionalProperties": false
    },
    "PaymentCurrency": {
      "enum": [
        "Btc",
        "Usdc",
        "Usdt",
        "Eurc",
        "Sol",
        "Eth"
      ],
      "type": "string"
    },
    "PaymentMethod": {
      "enum": [
        "MultiOutput",
        "Lightning"
      ],
      "type": "string"
    },
    "PaymentNetwork": {
      "enum": [
        "Mainnet",
        "Testnet4",
        "Signet",
        "Regtest",
        "Solana",
        "SolanaDevnet",
        "Ethereum",
        "EthereumSepolia",
        "Base",
        "BaseSepolia",
        "Arbitrum",
        "ArbitrumSepolia",
        "Polygon",
        "PolygonAmoy"
      ],
      "type": "string"
    },
    "PlatformFeeInfo": {
      "type": "object",
      "properties": {
        "percent": {
          "type": [
            "number",
            "null"
          ],
          "format": "double"
        },
        "usd": {
          "type": [
            "number",
            "null"
          ],
          "format": "double"
        },
        "sats": {
          "type": "integer",
          "format": "int64"
        },
        "waived": {
          "type": "boolean"
        },
        "usdPerBtc": {
          "type": [
            "number",
            "null"
          ],
          "format": "double"
        },
        "rateSource": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "additionalProperties": false
    },
    "QuoteInfo": {
      "type": "object",
      "properties": {
        "source": {
          "type": [
            "string",
            "null"
          ]
        },
        "rate": {
          "type": "number",
          "format": "double"
        },
        "lockedAt": {
          "type": "string",
          "format": "date-time"
        },
        "expiresAt": {
          "type": "string",
          "format": "date-time"
        },
        "schema": {
          "type": [
            "string",
            "null"
          ]
        },
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "draftId": {
          "type": "string",
          "format": "uuid"
        },
        "network": {
          "$ref": "#/$defs/PaymentNetwork"
        },
        "currency": {
          "$ref": "#/$defs/PaymentCurrency"
        },
        "tokenAddress": {
          "type": [
            "string",
            "null"
          ]
        },
        "cryptoAmountBaseUnits": {
          "type": "integer",
          "format": "int64"
        },
        "platformFeeBaseUnits": {
          "type": "integer",
          "format": "int64"
        },
        "fiatAmount": {
          "type": "number",
          "format": "double"
        },
        "fiatCurrency": {
          "type": [
            "string",
            "null"
          ]
        },
        "rateSource": {
          "type": [
            "string",
            "null"
          ]
        },
        "bolt11": {
          "type": [
            "string",
            "null"
          ]
        },
        "lockedUntil": {
          "type": "string",
          "format": "date-time"
        },
        "sha256": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "additionalProperties": false
    },
    "SekValueInfo": {
      "type": "object",
      "properties": {
        "ratePerBtc": {
          "type": "number",
          "format": "double"
        },
        "rateSource": {
          "type": [
            "string",
            "null"
          ]
        },
        "amount": {
          "type": [
            "number",
            "null"
          ],
          "format": "double"
        },
        "platformFee": {
          "type": [
            "number",
            "null"
          ],
          "format": "double"
        },
        "vatRatePercent": {
          "type": [
            "number",
            "null"
          ],
          "format": "double"
        },
        "platformFeeVat": {
          "type": [
            "number",
            "null"
          ],
          "format": "double"
        }
      },
      "additionalProperties": false
    },
    "ShortfallPolicyDto": {
      "type": "object",
      "properties": {
        "absorbUpToPercent": {
          "type": "number",
          "format": "double"
        },
        "absorbedBy": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "additionalProperties": false
    }
  }
}