{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/curlec/json-schema/curlec-order-schema.json",
  "title": "Order",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/curlec-orders-api-openapi.yml#/components/schemas/Order",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Unique order identifier. Prefix: order_"
    },
    "entity": {
      "type": "string",
      "enum": [
        "order"
      ]
    },
    "amount": {
      "type": "integer",
      "description": "Order amount in paise. Example: 50000 = ₹500."
    },
    "amount_paid": {
      "type": "integer",
      "description": "Total amount paid against this order (paise)."
    },
    "amount_due": {
      "type": "integer",
      "description": "Remaining unpaid amount (paise)."
    },
    "currency": {
      "type": "string",
      "description": "ISO 4217 currency code. Example: INR."
    },
    "receipt": {
      "type": "string",
      "description": "Your internal receipt or order reference number."
    },
    "status": {
      "type": "string",
      "enum": [
        "created",
        "attempted",
        "paid"
      ],
      "description": "created: awaiting payment. attempted: payment attempted but not captured. paid: fully paid."
    },
    "attempts": {
      "type": "integer",
      "description": "Number of payment attempts made."
    },
    "notes": {
      "$ref": "#/$defs/Notes"
    },
    "created_at": {
      "type": "integer",
      "description": "Unix timestamp of order creation."
    },
    "offer_id": {
      "type": "string"
    },
    "offers": {
      "type": "array",
      "items": {
        "type": "string"
      }
    }
  },
  "$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
    }
  }
}