{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/agentaos-ai/json-schema/agentaos-ai-payment-link-list-response-schema.json",
  "title": "PaymentLinkListResponse",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/agentaos-ai-payment-links-api-openapi.yml#/components/schemas/PaymentLinkListResponse",
  "type": "object",
  "properties": {
    "items": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/PaymentLink"
      }
    },
    "total": {
      "type": "integer"
    },
    "hasMore": {
      "type": "boolean"
    }
  },
  "required": [
    "items",
    "total",
    "hasMore"
  ],
  "$defs": {
    "CheckoutField": {
      "type": "object",
      "description": "An extra field collected at checkout.",
      "properties": {
        "key": {
          "type": "string",
          "maxLength": 64
        },
        "label": {
          "type": "string",
          "maxLength": 128
        },
        "type": {
          "type": "string",
          "enum": [
            "text",
            "email",
            "tel",
            "select"
          ]
        },
        "required": {
          "type": "boolean"
        },
        "placeholder": {
          "type": "string",
          "maxLength": 256
        },
        "options": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "For `type: select` only."
        }
      },
      "required": [
        "key",
        "label",
        "type",
        "required"
      ]
    },
    "PaymentLink": {
      "type": "object",
      "additionalProperties": true,
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Payment link UUID."
        },
        "org_id": {
          "type": "string",
          "format": "uuid"
        },
        "user_id": {
          "type": "string",
          "format": "uuid"
        },
        "secure_link_id": {
          "type": "string",
          "description": "Public ID used in the checkout URL."
        },
        "amount": {
          "type": "number",
          "description": "Currency units."
        },
        "currency": {
          "type": "string",
          "description": "Settlement currency or token."
        },
        "description": {
          "type": [
            "string",
            "null"
          ]
        },
        "metadata": {
          "type": "object",
          "description": "Your custom data."
        },
        "checkout_fields": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/CheckoutField"
          }
        },
        "webhook_url": {
          "type": [
            "string",
            "null"
          ]
        },
        "success_url": {
          "type": [
            "string",
            "null"
          ]
        },
        "cancel_url": {
          "type": [
            "string",
            "null"
          ]
        },
        "tax_rate_id": {
          "type": [
            "string",
            "null"
          ],
          "format": "uuid"
        },
        "status": {
          "type": "string",
          "enum": [
            "active",
            "cancelled"
          ]
        },
        "payment_count": {
          "type": "integer",
          "description": "Successful payments against this link so far."
        },
        "supported_networks": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "expires_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time"
        },
        "name": {
          "type": [
            "string",
            "null"
          ]
        },
        "image_url": {
          "type": [
            "string",
            "null"
          ]
        },
        "max_uses": {
          "type": [
            "integer",
            "null"
          ],
          "description": "null means unlimited."
        },
        "seller_mode": {
          "type": "string",
          "enum": [
            "mor",
            "crypto"
          ],
          "description": "mor (card + bank) or crypto (on-chain). The snake_case column equivalent of the computed `sellerMode`."
        },
        "type": {
          "type": "string",
          "enum": [
            "one_time",
            "subscription"
          ]
        },
        "billing_interval": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "month",
            "year",
            null
          ]
        },
        "trial_period_days": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Free-trial length in days, or `null` when the link has no trial."
        },
        "trial_amount": {
          "type": [
            "number",
            "null"
          ],
          "description": "Price of the trial period in currency units, or `null` for a free trial (or no trial)."
        },
        "environment": {
          "type": "string",
          "enum": [
            "test",
            "live"
          ]
        },
        "checkoutUrl": {
          "type": "string",
          "description": "Full URL to share with buyers. Computed, camelCase, no snake_case equivalent."
        },
        "sellerMode": {
          "type": "string",
          "enum": [
            "mor",
            "crypto"
          ]
        }
      },
      "required": [
        "id",
        "org_id",
        "user_id",
        "secure_link_id",
        "amount",
        "currency",
        "description",
        "metadata",
        "checkout_fields",
        "webhook_url",
        "success_url",
        "cancel_url",
        "tax_rate_id",
        "status",
        "payment_count",
        "supported_networks",
        "expires_at",
        "created_at",
        "updated_at",
        "name",
        "image_url",
        "max_uses",
        "seller_mode",
        "type",
        "billing_interval",
        "environment",
        "checkoutUrl",
        "sellerMode"
      ]
    }
  }
}