{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "enum": [
        "form140_workbook"
      ]
    },
    "@entity": {
      "type": "string",
      "enum": [
        "workbook"
      ]
    },
    "sheets": {
      "type": "array",
      "items": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "enum": [
                  "payer_sheet"
                ]
              },
              "@entity": {
                "type": "string",
                "enum": [
                  "sheet"
                ]
              },
              "blocks": {
                "type": "array",
                "items": {
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string",
                          "enum": [
                            "payer_list"
                          ]
                        },
                        "@entity": {
                          "type": "string",
                          "enum": [
                            "list"
                          ]
                        },
                        "items": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "tan": {
                                "type": "string",
                                "pattern": "[A-Z]{4}[0-9]{5}[A-Z]{1}",
                                "description": "TAN of the deductor. Should be all capital"
                              },
                              "pan": {
                                "type": "string",
                                "pattern": "[A-Z]{3}[PCFTGHLABJ]{1}[A-Z]{1}[0-9]{4}[A-Z]{1}",
                                "description": "PAN of the Deductor. Allow Enum: PANNOTREQD"
                              },
                              "name": {
                                "type": "string",
                                "pattern": "^(?=.*[A-Za-z0-9])(?!.*\\^)[\\x20-\\x7E]{1,75}$",
                                "minLength": 1,
                                "maxLength": 75,
                                "description": "Name of the Deductor"
                              },
                              "street": {
                                "type": "string",
                                "description": "No Special Characters"
                              },
                              "area": {
                                "type": "string",
                                "description": "No  Special Characters"
                              },
                              "city": {
                                "type": "string",
                                "description": "No  Special Characters"
                              },
                              "state": {
                                "type": "string",
                                "enum": [
                                  "ANDAMAN AND NICOBAR ISLANDS",
                                  "ANDHRA PRADESH",
                                  "ARUNACHAL PRADESH",
                                  "ASSAM",
                                  "BIHAR",
                                  "CHANDIGARH",
                                  "DADRA & NAGAR HAVELI AND DAMAN & DIU",
                                  "DELHI",
                                  "GOA",
                                  "GUJARAT",
                                  "HARYANA",
                                  "HIMACHAL PRADESH",
                                  "JAMMU & KASHMIR",
                                  "KARNATAKA",
                                  "KERALA",
                                  "LAKSHWADEEP",
                                  "MADHYA PRADESH",
                                  "MAHARASHTRA",
                                  "MANIPUR",
                                  "MEGHALAYA",
                                  "MIZORAM",
                                  "NAGALAND",
                                  "ODISHA",
                                  "PONDICHERRY",
                                  "PUNJAB",
                                  "RAJASTHAN",
                                  "SIKKIM",
                                  "TAMIL NADU",
                                  "TRIPURA",
                                  "UTTAR PRADESH",
                                  "WEST BENGAL",
                                  "CHHATTISGARH",
                                  "UTTARAKHAND",
                                  "JHARKHAND",
                                  "TELANGANA",
                                  "LADAKH"
                                ],
                                "description": "State where the deductor belongs to."
                              },
                              "postal_code": {
                                "type": "string",
                                "pattern": "[0-9]{6}",
                                "description": "Pincode of the deductor's address"
                              },
                              "email": {
                                "type": "string",
                                "pattern": "^(?!@)(?=.*@)(?=.*\\.).+$",
                                "description": "Email of the Deductor for communication"
                              },
                              "mobile": {
                                "type": "string",
                                "pattern": "[1-9]{1}[0-9]{9,14}",
                                "description": "Mobile Number of the Deductor for communication."
                              },
                              "gstin": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "pattern": "[0-9]{2}[a-zA-Z]{5}[0-9]{4}[a-zA-Z]{1}[1-9A-Za-z]{1}[CZ]{1}[0-9a-zA-Z]{1}$|^[0-9]{4}[a-zA-Z]{3}[0-9]{5}[uUnNo]{2}[0-9a-zA-Z]{1}",
                                "description": "GST Number of the Deductor (If available)"
                              },
                              "country": {
                                "type": "string",
                                "description": "Country or region name of the deductor."
                              },
                              "country_code": {
                                "type": "string",
                                "pattern": "[0-9]{1,5}",
                                "description": "Calling code of the deductor contact number."
                              },
                              "deductor_type": {
                                "type": "string",
                                "description": "Deductor category from Annexure 4."
                              }
                            },
                            "additionalProperties": true
                          }
                        }
                      },
                      "required": [
                        "name",
                        "@entity",
                        "items"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string",
                          "enum": [
                            "responsible_person_list"
                          ]
                        },
                        "@entity": {
                          "type": "string",
                          "enum": [
                            "list"
                          ]
                        },
                        "items": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "designation": {
                                "type": "string",
                                "pattern": "^(?![. ]+$)[^~!@#$%^&*()_+,/?;:’”[\\]{}\\\\]+$",
                                "description": "Cannot be blank/only dots/only spaces or include following characters (`~!@#$%^&*( )_+,./?;:’”[{]}\\)"
                              },
                              "name": {
                                "type": "string",
                                "pattern": "^(?![. ]+$)[^~!@#$%^&*()_+,/?;:’”[\\]{}\\\\]+$",
                                "description": "Cannot be blank/only dots/only spaces or include following characters (`~!@#$%^&*( )_+,./?;:’”[{]}\\)"
                              },
                              "pan": {
                                "type": "string",
                                "pattern": "[A-Z]{3}[PCFTGHLABJ]{1}[A-Z]{1}[0-9]{4}[A-Z]{1}",
                                "description": "PAN of the Responsible Person"
                              },
                              "street": {
                                "type": "string",
                                "description": "Noo Special Characters"
                              },
                              "area": {
                                "type": "string",
                                "description": "Noo Special Characters"
                              },
                              "city": {
                                "type": "string",
                                "description": "Noo Special Characters"
                              },
                              "state": {
                                "type": "string",
                                "enum": [
                                  "ANDAMAN AND NICOBAR ISLANDS",
                                  "ANDHRA PRADESH",
                                  "ARUNACHAL PRADESH",
                                  "ASSAM",
                                  "BIHAR",
                                  "CHANDIGARH",
                                  "DADRA & NAGAR HAVELI AND DAMAN & DIU",
                                  "DELHI",
                                  "GOA",
                                  "GUJARAT",
                                  "HARYANA",
                                  "HIMACHAL PRADESH",
                                  "JAMMU & KASHMIR",
                                  "KARNATAKA",
                                  "KERALA",
                                  "LAKSHWADEEP",
                                  "MADHYA PRADESH",
                                  "MAHARASHTRA",
                                  "MANIPUR",
                                  "MEGHALAYA",
                                  "MIZORAM",
                                  "NAGALAND",
                                  "ODISHA",
                                  "PONDICHERRY",
                                  "PUNJAB",
                                  "RAJASTHAN",
                                  "SIKKIM",
                                  "TAMIL NADU",
                                  "TRIPURA",
                                  "UTTAR PRADESH",
                                  "WEST BENGAL",
                                  "CHHATTISGARH",
                                  "UTTARAKHAND",
                                  "JHARKHAND",
                                  "TELANGANA",
                                  "LADAKH"
                                ],
                                "description": "State where the Responsible Person resides"
                              },
                              "postal_code": {
                                "type": "string",
                                "pattern": "[0-9]{6}",
                                "description": "Pincode of the Responsbile Person's address"
                              },
                              "email": {
                                "type": "string",
                                "pattern": "^(?!@)(?=.*@)(?=.*\\.).+$",
                                "description": "Email of the Responsible Person for communication"
                              },
                              "mobile": {
                                "type": "string",
                                "pattern": "[1-9]{1}[0-9]{9,14}",
                                "description": "Mobile Number of the Responsible Person for communication."
                              },
                              "country": {
                                "type": "string",
                                "description": "Country or region name of the responsible person."
                              },
                              "country_code": {
                                "type": "string",
                                "pattern": "[0-9]{1,5}",
                                "description": "Calling code of the responsible person contact number."
                              }
                            },
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "name",
                        "@entity",
                        "items"
                      ]
                    }
                  ]
                }
              }
            },
            "required": [
              "name",
              "@entity",
              "blocks"
            ]
          },
          {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "enum": [
                  "payee_sheet"
                ]
              },
              "@entity": {
                "type": "string",
                "enum": [
                  "sheet"
                ]
              },
              "blocks": {
                "type": "array",
                "items": {
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string",
                          "enum": [
                            "payee_table"
                          ]
                        },
                        "@entity": {
                          "type": "string",
                          "enum": [
                            "table"
                          ]
                        },
                        "header": {
                          "type": "array",
                          "items": [
                            {
                              "type": "string",
                              "enum": [
                                "sr_no"
                              ]
                            },
                            {
                              "type": "string",
                              "enum": [
                                "pan"
                              ]
                            },
                            {
                              "type": "string",
                              "enum": [
                                "name"
                              ]
                            }
                          ],
                          "additionalItems": false,
                          "minItems": 3,
                          "maxItems": 3
                        },
                        "rows": {
                          "type": "array",
                          "items": {
                            "type": "array",
                            "items": [
                              {
                                "type": "integer",
                                "minimum": 1,
                                "description": "Running Identifier of the Payee in the workboook"
                              },
                              {
                                "type": "string",
                                "pattern": "^(?:[A-Z]{3}[PCFTGHLABJ][A-Z][0-9]{4}[A-Z]|PANNOTAVBL|PANAPPLIED|PANINVALID)$",
                                "minLength": 10,
                                "maxLength": 10,
                                "description": "PAN of the Payee. Allow \"PANNOTAVBL\", \"PANAPPLIED\", \"PANINVALID\""
                              },
                              {
                                "type": "string",
                                "pattern": "^(?!.*\\^)[\\x20-\\x7E]{1,75}$",
                                "minLength": 1,
                                "maxLength": 75,
                                "description": "Name of the Payee"
                              }
                            ],
                            "additionalItems": false,
                            "minItems": 3,
                            "maxItems": 3
                          }
                        }
                      },
                      "required": [
                        "name",
                        "@entity",
                        "header",
                        "rows"
                      ]
                    }
                  ]
                }
              }
            },
            "required": [
              "name",
              "@entity",
              "blocks"
            ]
          },
          {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "enum": [
                  "challan_sheet"
                ]
              },
              "@entity": {
                "type": "string",
                "enum": [
                  "sheet"
                ]
              },
              "blocks": {
                "type": "array",
                "items": {
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string",
                          "enum": [
                            "challan_table"
                          ]
                        },
                        "@entity": {
                          "type": "string",
                          "enum": [
                            "table"
                          ]
                        },
                        "header": {
                          "type": "array",
                          "items": [
                            {
                              "type": "string",
                              "enum": [
                                "challan_serial"
                              ]
                            },
                            {
                              "type": "string",
                              "enum": [
                                "bsr_code"
                              ]
                            },
                            {
                              "type": "string",
                              "enum": [
                                "paid_date_epoch"
                              ]
                            },
                            {
                              "type": "string",
                              "enum": [
                                "minor_head"
                              ]
                            },
                            {
                              "type": "string",
                              "enum": [
                                "total_tax_deducted"
                              ]
                            },
                            {
                              "type": "string",
                              "enum": [
                                "interest"
                              ]
                            },
                            {
                              "type": "string",
                              "enum": [
                                "late_filing_fees"
                              ]
                            },
                            {
                              "type": "string",
                              "enum": [
                                "other_penalty"
                              ]
                            }
                          ],
                          "additionalItems": false,
                          "minItems": 8,
                          "maxItems": 8
                        },
                        "rows": {
                          "type": "array",
                          "items": {
                            "type": "array",
                            "items": [
                              {
                                "type": "string",
                                "pattern": "[0-9]{5}",
                                "description": "Challan Serial Number"
                              },
                              {
                                "type": "string",
                                "pattern": "[0-9]{7}",
                                "description": "BSR Code on the Challan"
                              },
                              {
                                "type": "integer",
                                "description": "Date at which Challan was paid to the government"
                              },
                              {
                                "type": "string",
                                "enum": [
                                  "tds_payable",
                                  "tds_regular_assessment_raised_by_it_dept",
                                  "advance_tax"
                                ],
                                "description": "Minor Head under which TDS is deposited"
                              },
                              {
                                "type": "integer",
                                "maximum": 999999999999999,
                                "description": "Total tax deducted through this challan"
                              },
                              {
                                "type": "integer",
                                "maximum": 999999999999999,
                                "description": "Amount of Interest deposited through this challan"
                              },
                              {
                                "type": "integer",
                                "maximum": 999999999999999,
                                "description": "Amount of Late Filling Fees deposited through this challan"
                              },
                              {
                                "type": "integer",
                                "maximum": 999999999999999,
                                "description": "Amount of Other Penaltydeposited through this challan"
                              }
                            ],
                            "additionalItems": false,
                            "minItems": 8,
                            "maxItems": 8
                          }
                        }
                      },
                      "required": [
                        "name",
                        "@entity",
                        "header",
                        "rows"
                      ]
                    }
                  ]
                }
              }
            },
            "required": [
              "name",
              "@entity",
              "blocks"
            ]
          },
          {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "enum": [
                  "payment_sheet"
                ]
              },
              "@entity": {
                "type": "string",
                "enum": [
                  "sheet"
                ]
              },
              "blocks": {
                "type": "array",
                "items": {
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string",
                          "enum": [
                            "payment_table"
                          ]
                        },
                        "@entity": {
                          "type": "string",
                          "enum": [
                            "table"
                          ]
                        },
                        "header": {
                          "type": "array",
                          "items": [
                            {
                              "type": "string",
                              "enum": [
                                "payee_sr_no"
                              ]
                            },
                            {
                              "type": "string",
                              "enum": [
                                "challan_serial"
                              ]
                            },
                            {
                              "type": "string",
                              "enum": [
                                "bsr_code"
                              ]
                            },
                            {
                              "type": "string",
                              "enum": [
                                "nature_of_payment"
                              ]
                            },
                            {
                              "type": "string",
                              "enum": [
                                "payment_amount"
                              ]
                            },
                            {
                              "type": "string",
                              "enum": [
                                "payment_date_epoch"
                              ]
                            },
                            {
                              "type": "string",
                              "enum": [
                                "total_tax_deducted"
                              ]
                            },
                            {
                              "type": "string",
                              "enum": [
                                "total_tax_deposited"
                              ]
                            },
                            {
                              "type": "string",
                              "enum": [
                                "deduction_date_epoch"
                              ]
                            },
                            {
                              "type": "string",
                              "enum": [
                                "reason_for_lower_deduction"
                              ]
                            },
                            {
                              "type": "string",
                              "enum": [
                                "certificate_number"
                              ]
                            },
                            {
                              "type": "string",
                              "enum": [
                                "unique_identification_number_form_121"
                              ]
                            },
                            {
                              "type": "string",
                              "enum": [
                                "amount_of_cash_withdrawal_more_than_1_crore_under_section_393_3"
                              ]
                            },
                            {
                              "type": "string",
                              "enum": [
                                "amount_of_cash_withdrawal_more_than_3_crore_for_cooperative_societies_under_section_393_3"
                              ]
                            }
                          ],
                          "additionalItems": false,
                          "minItems": 14,
                          "maxItems": 14
                        },
                        "rows": {
                          "type": "array",
                          "items": {
                            "type": "array",
                            "items": [
                              {
                                "type": "integer",
                                "minimum": 1,
                                "description": "Identifier of the Payee from the payee_sheet"
                              },
                              {
                                "type": "string",
                                "pattern": "[0-9]{5}",
                                "description": "Challan Serial Number of the challan used to deposit TDS of this Payment"
                              },
                              {
                                "type": "string",
                                "pattern": "[0-9]{7}",
                                "description": "BSR Code on the Challan used to deposit TDS of this Payment"
                              },
                              {
                                "type": "string",
                                "enum": [
                                  "interest_on_securities",
                                  "dividend",
                                  "other_interest",
                                  "winning_from_lotteries_crossword_puzzles_card_games_and_other_games_of_any_sort",
                                  "winnings_from_lottery_and_other_games_of_any_sort_where_winnings_are_made_in_kind_or_cash_is_not_sufficient_to_meet_the_tax_liability_and_tax_has_been_paid_before_said_winnings_are_released",
                                  "winning_from_horse_races",
                                  "cash_withdrawal_by_co_operative_societies_being_non_filers",
                                  "cash_withdrawal",
                                  "cash_withdrawal_by_non_filers",
                                  "cash_withdrawal_by_co_operative_societies",
                                  "tender_fees",
                                  "sales_and_marketing_services",
                                  "telecasting_services",
                                  "charter_hire_charges_shipping",
                                  "advertisement_fee",
                                  "amc_charges",
                                  "bandwidth_charges",
                                  "cargo_handling_services_inspection_and_logistics_services",
                                  "clearing_and_forwarding_charges",
                                  "fabrication_services",
                                  "freight_charges",
                                  "income_from_shipping_inland_waterways_or_air_transport",
                                  "sponsorship_fees",
                                  "retention_fees",
                                  "installation_and_commissioning_services",
                                  "warranty_services",
                                  "drilling",
                                  "insurance_commission",
                                  "withdrawal_from_nss_deposit",
                                  "payment_for_repurchase_of_units_by_uti_or_mf",
                                  "commission_on_sale_of_lottery_tickets",
                                  "other_commissions",
                                  "equipment_rental_charges",
                                  "lease_and_rental_payment",
                                  "payment_for_compulsory_acquisition_of_immovable_properties",
                                  "payment_in_respect_of_life_insurance_policy",
                                  "payment_of_accumulated_balance_of_provident_fund",
                                  "income_in_respect_of_units_of_investment_fund",
                                  "payment_of_salary_remuneration_commission_bonus_or_interest_to_a_partner_of_the_firm",
                                  "income_in_respect_of_investment_in_securitization_trust",
                                  "payment_for_development_agreement",
                                  "dividend_from_mutual_funds",
                                  "fees_for_technical_service",
                                  "architectural_services",
                                  "consulting_services",
                                  "designing_fee",
                                  "directors_fees",
                                  "engineering_services",
                                  "licensing_fee",
                                  "payments_to_sports_person_and_artists",
                                  "payments_to_students_or_business_apprentice",
                                  "processing_charges_paid_to_others",
                                  "professional_services",
                                  "purchase_of_software",
                                  "r_&_d_charges",
                                  "retainership_fees",
                                  "royalty",
                                  "seismic_data_processing",
                                  "software_licences",
                                  "subscription_fees_other_than_membership_fees_or_sale_of_goods",
                                  "supervision_charges",
                                  "testing_charges",
                                  "training",
                                  "interest_payment_from_units_of_a_business_trust",
                                  "dividend_payment_from_units_of_a_business_trust",
                                  "rental_income_from_units_of_a_real_estate_investment_trust",
                                  "payment_for_e-commerce_transactions",
                                  "payment_of_certain_sums_for_purchase_of_goods",
                                  "payment_for_transfer_of_virtual_digital_assets",
                                  "payment_for_transfer_of_virtual_digital_asset_where_payment_is_in_kind_or_in_exchange_of_another_virtual_digital_asset_and_tax_required_to_be_deducted_is_paid_before_such_payment_is_released",
                                  "prequisites_or_benefits_allowed_to_distributors_or_agents",
                                  "benefits_or_perquisites_of_business_or_profession_where_such_benefit_is_provided_in_kind_or_where_part_in_cash_is_not_sufficient_to_meet_tax_liability_and_tax_required_to_be_deducted_is_paid_before_such_benefit_is_released",
                                  "winnings_from_online_games",
                                  "net_winnings_from_online_games_where_the_net_winnings_are_made_in_kind_or_cash_is_not_sufficient_to_meet_the_tax_liability_and_tax_has_been_paid_before_said_winnings_are_released",
                                  "interest_on_debentures_paid_by_cheque",
                                  "interest_from_bank_deposits",
                                  "interest_from_bank_deposits_for_senior_citizen"
                                ],
                                "description": "The kind of Payment made by the Payer to the Payee"
                              },
                              {
                                "type": "number",
                                "maximum": 999999999999.99,
                                "description": "The Payment amount made to the Payee"
                              },
                              {
                                "type": "integer",
                                "description": "Date of Payment"
                              },
                              {
                                "type": "number",
                                "maximum": 1000000000000000,
                                "description": "Total tax deducted from the payment amount"
                              },
                              {
                                "type": "number",
                                "maximum": 1000000000000000,
                                "description": "Total tax deposited for the payment amount"
                              },
                              {
                                "type": "integer",
                                "description": "Date at which the Deduction took place"
                              },
                              {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "enum": [
                                  "lower_deduction_no_deduction_on_account_of_certificate_u_s_395_1",
                                  "no_deduction_on_account_of_declaration_u_s_393_6",
                                  "deduction_of_tax_at_higher_rate_due_to_non_availability_of_pan_u_s_397_2",
                                  "no_deduction_or_lower_deduction_on_account_of_payment_made_to_a_person_or_class_of_person_on_account_of_notification_issued_u_s_194_a_5_or_u_s_400_1",
                                  "no_deduction_on_account_of_payment_being_made_to_a_person_referred_to_in_board_circular_no_3_of_2002_dated_28th_june_2002",
                                  "no_deduction_on_account_of_payment_made_to_a_person_referred_to_in_section_393_4_table_sl_no_18_or_on_account_of_notification_issued_under_fifth_proviso_to_section_194_n",
                                  "no_deduction_as_per_the_provisions_of_section_393_4_table_sl_no_5",
                                  "in_case_of_no_deduction_is_on_account_of_payment_of_dividend_made_to_a_business_trust_referred_to_in_section_393_4_table_sl_no_10_d_or_notification_issued_under_section_393_4_table_sl_no_10_e",
                                  "in_case_of_no_deduction_in_view_of_payment_made_to_an_entity_referred_to_in_section_393_4_table_sl_no_7_c_v",
                                  "no_deduction_is_in_view_of_tax_being_deductible_or_collectible_under_any_provision_of_the_act_for_transaction_referred_in_section_393_1_table_sl_no_8_ii_note_1_a",
                                  "in_case_of_no_deduction_is_on_account_of_deductee_payee_being_transporter_and_valid_pan_is_provided",
                                  "no_deduction_on_account_of_payment_being_below_threshold_limit_as_specified_in_the_act",
                                  "no_deduction_or_lower_deduction_on_account_of_notification_issued_u_s_400_1",
                                  null
                                ],
                                "description": "Reason for Lower Deduction of TDS Amount than the prescribed rate in force"
                              },
                              {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "description": "TDS Lower Deduction Certificate Number"
                              },
                              {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "maxLength": 26,
                                "description": "Unique Identification Number of Form 121 submitted by the deductee."
                              },
                              {
                                "type": [
                                  "number",
                                  "null"
                                ],
                                "maximum": 1000000000000000
                              },
                              {
                                "type": [
                                  "number",
                                  "null"
                                ],
                                "maximum": 1000000000000000
                              }
                            ],
                            "additionalItems": false,
                            "minItems": 14,
                            "maxItems": 14
                          }
                        }
                      },
                      "required": [
                        "name",
                        "@entity",
                        "header",
                        "rows"
                      ]
                    }
                  ]
                }
              }
            },
            "required": [
              "name",
              "@entity",
              "blocks"
            ]
          }
        ]
      }
    }
  },
  "required": [
    "name",
    "@entity",
    "sheets"
  ]
}
