{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/pluggy/json-schema/pluggy-bill-schema.json",
  "title": "Bill",
  "description": "Response with information related to a credit card bill",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/pluggy-bill-api-openapi.yml#/components/schemas/Bill",
  "properties": {
    "id": {
      "type": "string",
      "description": "Primary identifier"
    },
    "dueDate": {
      "type": "string",
      "format": "date-time",
      "description": "Due date of the bill, displayed for payment by the customer"
    },
    "billClosingDate": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "Date when the bill was closed"
    },
    "totalAmount": {
      "type": "number",
      "description": "Total bill amount"
    },
    "totalAmountCurrencyCode": {
      "type": "string",
      "description": "Code referencing the currency of the bill"
    },
    "minimumPaymentAmount": {
      "type": "number",
      "description": "Minimum payment amount of the bill"
    },
    "allowsInstallments": {
      "type": "boolean",
      "description": "Indicates whether the bill allows installment payments (true) or not (false)"
    },
    "financeCharges": {
      "type": "array",
      "description": "List of charges associated to the bill",
      "items": {
        "$ref": "#/$defs/BillFinanceCharge"
      }
    },
    "payments": {
      "type": "array",
      "description": "List of payments associated to the bill",
      "items": {
        "$ref": "#/$defs/BillPayment"
      }
    }
  },
  "type": "object",
  "required": [
    "id",
    "dueDate",
    "totalAmount",
    "totalAmountCurrencyCode",
    "financeCharges",
    "payments"
  ],
  "$defs": {
    "BillFinanceCharge": {
      "description": "Response with information related to a credit card bill finance charge",
      "properties": {
        "id": {
          "type": "string",
          "description": "Primary identifier"
        },
        "type": {
          "enum": [
            "LATE_PAYMENT_REMUNERATIVE_INTEREST",
            "LATE_PAYMENT_FEE",
            "LATE_PAYMENT_INTEREST",
            "IOF",
            "OTHER"
          ],
          "type": "string",
          "description": "Denomination of the charges that apply to the postpaid payment account bill"
        },
        "amount": {
          "type": "number",
          "description": "Amount charged for the charge/fee"
        },
        "currencyCode": {
          "type": "string",
          "description": "Code referencing the currency of the charge"
        },
        "additionalInfo": {
          "type": "string",
          "description": "Free field, mandatory to fill if 'OTHER' type of charge is selected"
        }
      },
      "type": "object",
      "required": [
        "id",
        "type",
        "amount",
        "currencyCode"
      ]
    },
    "BillPayment": {
      "description": "Response with information related to a credit card bill payment",
      "properties": {
        "id": {
          "type": "string",
          "description": "Primary identifier"
        },
        "valueType": {
          "enum": [
            "INSTALLMENT_PAYMENT",
            "FULL_PAYMENT",
            "OTHER_PAYMENT"
          ],
          "type": "string",
          "description": "Classifies the payment value type"
        },
        "paymentDate": {
          "type": "string",
          "format": "date-time",
          "description": "Date when the payment was made"
        },
        "paymentMode": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "DEBIT_ACCOUNT",
            "BANK_SLIP",
            "PAYROLL_DEDUCTION",
            "PIX",
            null
          ],
          "description": "Payment mode used"
        },
        "amount": {
          "type": "number",
          "description": "Payment amount"
        },
        "currencyCode": {
          "type": "string",
          "description": "Code referencing the currency of the payment"
        }
      },
      "type": "object",
      "required": [
        "id",
        "valueType",
        "paymentDate",
        "amount",
        "currencyCode"
      ]
    }
  }
}