{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/orboni-com/json-schema/orboni-com-payment-link-schema.json",
  "title": "PaymentLink",
  "description": "A payment link.",
  "x-generated": "2026-11-19",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/orboni-com-openapi.yml#/components/schemas/PaymentLink",
  "type": "object",
  "required": [
    "id",
    "object",
    "livemode",
    "url",
    "active",
    "status",
    "amount",
    "currency",
    "custom_amount",
    "min_amount",
    "max_amount",
    "max_payments",
    "payments_paid",
    "expires_at",
    "description",
    "details",
    "success_url",
    "created"
  ],
  "properties": {
    "id": {
      "type": "string",
      "pattern": "^plink_[A-Za-z0-9]{24}$"
    },
    "object": {
      "const": "payment_link"
    },
    "livemode": {
      "type": "boolean"
    },
    "url": {
      "type": "string",
      "format": "uri",
      "description": "The address to share."
    },
    "active": {
      "type": "boolean",
      "description": "The switch you turn; `status` says whether it takes payments."
    },
    "status": {
      "type": "string",
      "enum": [
        "active",
        "inactive",
        "expired",
        "completed"
      ],
      "description": "`active`; `inactive` — switched off; `expired` — past `expires_at`; `completed` — `payments_paid` reached `max_payments`."
    },
    "amount": {
      "type": [
        "integer",
        "null"
      ],
      "description": "In the currency’s smallest unit; with `custom_amount`, the amount suggested to the buyer, or null."
    },
    "currency": {
      "type": "string",
      "enum": [
        "usd",
        "eur",
        "gbp",
        "chf",
        "pln",
        "czk",
        "huf",
        "ron",
        "dkk",
        "sek",
        "nok",
        "isk",
        "try",
        "jpy",
        "krw",
        "cny",
        "hkd",
        "sgd",
        "inr",
        "idr",
        "myr",
        "php",
        "thb",
        "ils",
        "aud",
        "nzd",
        "cad",
        "mxn",
        "brl",
        "zar",
        "uah",
        "ars",
        "clp",
        "aed",
        "sar",
        "twd",
        "vnd"
      ]
    },
    "custom_amount": {
      "type": "boolean",
      "description": "The buyer types the amount."
    },
    "min_amount": {
      "type": [
        "integer",
        "null"
      ],
      "description": "With `custom_amount`: the least the buyer may pay; null otherwise or for the default."
    },
    "max_amount": {
      "type": [
        "integer",
        "null"
      ],
      "description": "With `custom_amount`: the most the buyer may pay; null otherwise or for the default."
    },
    "max_payments": {
      "type": [
        "integer",
        "null"
      ],
      "description": "It takes no new payment once this many are paid."
    },
    "payments_paid": {
      "type": "integer",
      "minimum": 0,
      "description": "Its sessions that completed."
    },
    "expires_at": {
      "type": [
        "integer",
        "null"
      ],
      "description": "It takes no new payment from then on. Unix seconds."
    },
    "description": {
      "type": "string"
    },
    "details": {
      "type": [
        "string",
        "null"
      ]
    },
    "success_url": {
      "type": [
        "string",
        "null"
      ],
      "format": "uri"
    },
    "created": {
      "type": "integer",
      "description": "When it was made. Unix seconds."
    }
  }
}