{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/curlec/json-schema/curlec-bill-schema.json",
  "title": "Bill",
  "description": "A Razorpay Billme digital receipt/bill. Used for retail, food & beverage, events, ecommerce, and other use cases.",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/curlec-bills-api-openapi.yml#/components/schemas/Bill",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Bill ID with prefix bill_"
    },
    "business_type": {
      "type": "string",
      "enum": [
        "ecommerce",
        "retail",
        "food_and_beverage",
        "events"
      ]
    },
    "business_category": {
      "type": "string"
    },
    "customer": {
      "type": "object",
      "properties": {
        "contact": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "email": {
          "type": "string"
        },
        "customer_id": {
          "type": "string"
        },
        "addresses": {
          "type": "array",
          "items": {
            "type": "object"
          }
        }
      }
    },
    "employee": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        }
      }
    },
    "loyalty": {
      "type": "object",
      "properties": {
        "points": {
          "type": "integer"
        },
        "redeemed_points": {
          "type": "integer"
        }
      }
    },
    "store_code": {
      "type": "string"
    },
    "receipt_timestamp": {
      "type": "integer",
      "description": "Unix timestamp of the transaction"
    },
    "receipt_number": {
      "type": "string"
    },
    "receipt_type": {
      "type": "string",
      "enum": [
        "tax_invoice",
        "sales_invoice",
        "bill_of_supply",
        "credit_note",
        "debit_note"
      ]
    },
    "receipt_delivery": {
      "type": "string",
      "enum": [
        "digital",
        "print",
        "digital_and_print"
      ]
    },
    "tags": {
      "type": "object"
    },
    "bar_code_number": {
      "type": "string"
    },
    "qr_code_number": {
      "type": "string"
    },
    "billing_pos_number": {
      "type": "string"
    },
    "pos_category": {
      "type": "string"
    },
    "order_number": {
      "type": "string"
    },
    "order_service_type": {
      "type": "string",
      "enum": [
        "dine_in",
        "takeaway",
        "delivery"
      ]
    },
    "delivery_status_url": {
      "type": "string"
    },
    "line_items": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "quantity": {
            "type": "number"
          },
          "unit_amount": {
            "type": "integer"
          },
          "unit": {
            "type": "string"
          },
          "hsn_code": {
            "type": "string"
          },
          "product_code": {
            "type": "string"
          },
          "total_amount": {
            "type": "integer"
          },
          "taxes": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "sub_items": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "tags": {
            "type": "object"
          }
        }
      }
    },
    "receipt_summary": {
      "type": "object",
      "properties": {
        "total_quantity": {
          "type": "number"
        },
        "sub_total_amount": {
          "type": "integer"
        },
        "currency": {
          "type": "string"
        },
        "net_payable_amount": {
          "type": "integer"
        },
        "payment_status": {
          "type": "string"
        },
        "discounts": {
          "type": "array",
          "items": {
            "type": "object"
          }
        },
        "taxes": {
          "type": "array",
          "items": {
            "type": "object"
          }
        }
      }
    },
    "taxes": {
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    "payments": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "method": {
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "amount": {
            "type": "integer"
          },
          "payment_reference_id": {
            "type": "string"
          },
          "financier_data": {
            "type": "object"
          }
        }
      }
    },
    "event": {
      "type": "object",
      "description": "Event details for events business type"
    },
    "irn": {
      "type": "string",
      "description": "Invoice Reference Number for GST e-invoicing"
    },
    "receipt_url": {
      "type": "string"
    },
    "created_at": {
      "type": "integer"
    }
  }
}