{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/curlec/json-schema/curlec-payment-link-schema.json",
  "title": "PaymentLink",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/curlec-payment-links-api-openapi.yml#/components/schemas/PaymentLink",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Unique payment link identifier. Prefix: plink_"
    },
    "entity": {
      "type": "string",
      "enum": [
        "payment_link"
      ]
    },
    "amount": {
      "type": "integer",
      "description": "Payment amount in smallest currency unit (paise for INR). Three-decimal currencies (KWD, BHD, OMR): drop last decimal digit (e.g. 295.991 KWD → 295990). Zero-decimal currencies (JPY): pass value as-is."
    },
    "amount_paid": {
      "type": "integer",
      "description": "Total amount paid by customer."
    },
    "currency": {
      "type": "string",
      "default": "INR",
      "description": "ISO 4217 currency code. UPI Payment Links only support INR."
    },
    "accept_partial": {
      "type": "boolean",
      "description": "Allow partial payments. Not supported for UPI links."
    },
    "first_min_partial_amount": {
      "type": "integer",
      "description": "Minimum amount required for the first partial payment."
    },
    "description": {
      "type": "string",
      "description": "Brief description. Max 2048 characters."
    },
    "reference_id": {
      "type": "string",
      "description": "Your unique tracking reference. Max 40 characters. Must be unique per link."
    },
    "expire_by": {
      "type": "integer",
      "description": "Unix timestamp when link expires. Default: 6 months from creation. Must be at least 15 minutes in the future."
    },
    "expired_at": {
      "type": "integer",
      "description": "Unix timestamp when link actually expired."
    },
    "cancelled_at": {
      "type": "integer",
      "description": "Unix timestamp when link was cancelled."
    },
    "status": {
      "type": "string",
      "enum": [
        "created",
        "partially_paid",
        "expired",
        "cancelled",
        "paid"
      ],
      "description": "created: awaiting payment. partially_paid: one or more partial payments received. expired: past expiry with no full payment. cancelled: manually cancelled. paid: fully paid."
    },
    "upi_link": {
      "type": "boolean",
      "description": "true if this is a UPI Payment Link, false for standard."
    },
    "short_url": {
      "type": "string",
      "description": "Shareable short URL for the payment link."
    },
    "callback_url": {
      "type": "string",
      "description": "Redirect URL after payment completion."
    },
    "callback_method": {
      "type": "string",
      "enum": [
        "get"
      ]
    },
    "customer": {
      "type": "object",
      "description": "Customer contact details. These are not auto-populated on the checkout page — customer must enter them manually.",
      "properties": {
        "name": {
          "type": "string"
        },
        "email": {
          "type": "string"
        },
        "contact": {
          "type": "string"
        }
      }
    },
    "notify": {
      "type": "object",
      "properties": {
        "sms": {
          "type": "boolean",
          "description": "true: Razorpay sends SMS notification. false: merchant handles."
        },
        "email": {
          "type": "boolean",
          "description": "true: Razorpay sends email notification. false: merchant handles."
        }
      }
    },
    "reminder_enable": {
      "type": "boolean",
      "description": "Send automatic payment reminders."
    },
    "payments": {
      "type": "array",
      "description": "Captured payment records. Populated only after successful payment capture.",
      "items": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "integer"
          },
          "payment_id": {
            "type": "string"
          },
          "plink_id": {
            "type": "string"
          },
          "method": {
            "type": "string",
            "enum": [
              "netbanking",
              "card",
              "wallet",
              "upi",
              "emi",
              "bank_transfer"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "captured"
            ]
          },
          "created_at": {
            "type": "integer"
          },
          "updated_at": {
            "type": "integer"
          }
        }
      }
    },
    "notes": {
      "$ref": "#/$defs/Notes"
    },
    "order_id": {
      "type": "string"
    },
    "user_id": {
      "type": "string",
      "description": "Identifier for the user role that created the link."
    },
    "created_at": {
      "type": "integer"
    },
    "updated_at": {
      "type": "integer"
    }
  },
  "$defs": {
    "Notes": {
      "type": "object",
      "description": "Key-value pairs for storing custom metadata. Maximum 15 pairs. Each key and value must not exceed 256 characters.",
      "additionalProperties": {
        "type": "string"
      },
      "maxProperties": 15
    }
  }
}