PayRoll · SAP IT Declaration API

3 endpoints to preview, download, and push IT Declaration data to SAP HR infotypes 580–586.

/SAP
Login: <base64 LoginDTO>
application/json
ResponseStandardDTO<object>
⚙ Common Query Parameters
⚠
At least one of DeclarationId, EmployeeId, or PeriodId must be non-zero. Pass 0 to skip a filter. Passing all three as 0 returns a 400 validation error.
Parameter Type Required Description
DeclarationId int Conditional Single IT Declaration ID. Pass 0 to skip.
EmployeeId int Conditional Employee database ID. Pass 0 to skip.
PeriodId int Conditional Payroll Period ID for bulk operations. Pass 0 to skip.
Infotype int Required SAP infotype number 580–586. Pass 0 to process all infotypes.
Date string Optional Effective date in SAP format: dd-MMM-yyyy (e.g. 01-Apr-2025). Defaults to today.
Remarks string Optional Free-text remarks embedded in the SAP payload (e.g. AY2025-26).
📄 SAP Infotype Reference
580

Previous Employer Income

Salary, TDS, PF, PT paid to previous employer in same fiscal year.

/ITDeclarationService/Previous
581

HRA / Rent Paid

House rent declarations with landlord PAN, address, and period.

/ITDeclarationService/HRA
582

Family / Tax Regime

Old vs new tax regime selection and dependent children count.

/ITDeclarationService/Family
583

Other Income

Capital gains, dividend, interest, digital, online and winning income.

/ITDeclarationService/OtherIncome
584

House Property

Rental income, home loan details with lender PAN and address.

/ITDeclarationService/HouseProperty
585

Deductions

80D, 80E, 80G and other section-wise expense deductions.

/ITDeclarationService/Deduction
586

Contributions

80C, 80CCC, 80CCD investments (LIC, PPF, NPS, ELSS, etc.).

/ITDeclarationService/Contribution

🔍 Endpoint 1 — Preview SAP JSON
GET /SAP/GetITDeclarationJson Preview all infotype payloads before pushing to SAP
ℹ
Returns a dictionary — key is the infotype number (string), value is the JSON payload string. Pass Infotype=0 to get all 7 infotypes at once. Use this for a Preview button.
HTTP REQUEST — All Infotypes
GET /SAP/GetITDeclarationJson?DeclarationId=1001&EmployeeId=0&PeriodId=0&Infotype=0&Date=01-Apr-2025&Remarks=AY2025-26

Login: <base64-encoded LoginDTO>
HTTP REQUEST — Single Infotype (582 only)
GET /SAP/GetITDeclarationJson?DeclarationId=1001&EmployeeId=0&PeriodId=0&Infotype=582&Date=01-Apr-2025

Login: <base64-encoded LoginDTO>
JAVASCRIPT FETCH
const params = new URLSearchParams({
  DeclarationId: 1001,
  EmployeeId:    0,
  PeriodId:      0,
  Infotype:      0,    // 0 = all infotypes
  Date:          '01-Apr-2025',
  Remarks:       'AY2025-26'
});

const res  = await fetch(`/SAP/GetITDeclarationJson?${params}`, {
  headers: { Login: loginHeader }
});
const data = await res.json();

// data.data is a dictionary: { "580": "..json..", "581": "..json.." }
const payloads = data.data;
Object.entries(payloads).forEach(([infotype, jsonStr]) => {
  console.log(`Infotype ${infotype}:`, JSON.parse(jsonStr));
});
RESPONSE 200 OK — Dictionary of Infotype Payloads
{
  "isSuccess":  true,
  "statusCode": 200,
  "message":    null,
  "data": {
    "580": "{\"Date\":\"01-Apr-2025\",\"Remarks\":\"AY2025-26\",\"Declarations\":[{\"EmployeeID\":\"EMP001\",\"FiscalYear\":\"2025\",\"FromDate\":\"01-Apr-2024\",\"ToDate\":\"31-Mar-2025\",\"PreviousSalary\":250000,\"PreviousPerquisites\":0,\"PreviousProfitinLieu\":0,\"PreviousExemptions\":0,\"PreviousPTAX\":2500,\"PreviousPF\":18000,\"PreviousIncomeTax\":15000}]}",

    "581": "{\"Date\":\"01-Apr-2025\",\"Remarks\":\"AY2025-26\",\"Declarations\":[{\"EmployeeID\":\"EMP001\",\"FiscalYear\":\"2025\",\"Particulars\":\"House Rent Mumbai\",\"From\":\"01-Apr-2024\",\"To\":\"31-Mar-2025\",\"Type\":\"Metro\",\"Declared\":180000,\"Approved\":180000,\"Remarks\":\"Paid to landlord\",\"LandLordName\":\"Rajesh Kumar\",\"LandLordPAN\":\"ABCPK1234D\",\"LandLordTAN\":\"\",\"LandLordAddress1\":\"12, MG Road\",\"LandLordAddress2\":\"Andheri West\",\"LandLordAddress3\":\"Mumbai\",\"LandLordAddress4\":\"Maharashtra\",\"LandLordAddress5\":\"400053\"}]}",

    "582": "{\"Date\":\"01-Apr-2025\",\"Remarks\":\"AY2025-26\",\"Declarations\":[{\"EmployeeID\":\"EMP001\",\"FiscalYear\":\"2025\",\"CalculationMethod\":\"old\",\"NOOFEDUCATION\":1,\"NOOFHOSTEL\":0}]}",

    "583": "{\"Date\":\"01-Apr-2025\",\"Remarks\":\"AY2025-26\",\"Declarations\":[{\"EmployeeID\":\"EMP001\",\"FiscalYear\":\"2025\",\"BusinessProfit\":0,\"LongTermCapitalGains\":0,\"ShortTermCapitalGains\":0,\"DividendIncome\":5000,\"InterestIncome\":12000,\"DigitalIncome\":0,\"OnlineIncome\":0,\"WinningIncome\":0}]}",

    "584": "{\"Date\":\"01-Apr-2025\",\"Remarks\":\"AY2025-26\",\"Declarations\":[{\"EmployeeID\":\"EMP001\",\"FiscalYear\":\"2025\",\"Type\":\"Self Occupied\",\"Particulars1\":\"\",\"AnnualRentalIncome\":0,\"LocalTaxPaid\":0,\"NetAnnualValue\":0,\"StandardDeduction\":0,\"InterestOnBorrowal\":150000,\"TotalDeduction\":150000,\"NetIncome\":-150000,\"EligibleFor80EEA\":true,\"PossesionObtained\":true,\"Remarks1\":\"\",\"Particulars2\":\"Home Loan - SBI\",\"PrinciplePaid\":85000,\"InterestPaid\":150000,\"Remarks2\":\"\",\"LenderName\":\"State Bank of India\",\"LenderPAN\":\"SBILN0001A\",\"LenderTAN\":\"\",\"LenderAddress1\":\"SBI Branch\",\"LenderAddress2\":\"Fort\",\"LenderAddress3\":\"Mumbai\",\"LenderAddress4\":\"Maharashtra\",\"LenderAddress5\":\"400001\"}]}",

    "585": "{\"Date\":\"01-Apr-2025\",\"Remarks\":\"AY2025-26\",\"Declarations\":[{\"EmployeeID\":\"EMP001\",\"FiscalYear\":\"2025\",\"ConsiderActual\":\"Yes\",\"Section\":\"80D\",\"Particulars\":\"Medical Insurance Premium\",\"Declared\":25000,\"Approved\":25000,\"Remarks\":\"\"}]}",

    "586": "{\"Date\":\"01-Apr-2025\",\"Remarks\":\"AY2025-26\",\"Declarations\":[{\"EmployeeID\":\"EMP001\",\"FiscalYear\":\"2025\",\"ConsiderActual\":\"Yes\",\"Section\":\"80C\",\"Particulars\":\"LIC Premium\",\"Declared\":50000,\"Approved\":50000,\"Remarks\":\"\"}]}"
  }
}
💡
Each value in data is a JSON string (already serialized). Parse it with JSON.parse(data.data["580"]) to get the object for display or formatting.
RESPONSE 400 — No filter provided
{
  "isSuccess":  false,
  "statusCode": 400,
  "message":    "At least one of DeclarationId, EmployeeId, or PeriodId must be provided.",
  "data":       null
}
⬇ Endpoint 2 — Download SAP JSON File
GET /SAP/DownloadITDeclarationJson Download SAP JSON for a single infotype as a .json file
⚠
Infotype must be specific (580–586). Passing Infotype=0 is not valid for this endpoint — the download requires a single infotype to name the file correctly.
HTTP REQUEST
GET /SAP/DownloadITDeclarationJson?DeclarationId=1001&EmployeeId=0&PeriodId=0&Infotype=581&Date=01-Apr-2025&Remarks=AY2025-26

Login: <base64-encoded LoginDTO>
RESPONSE — File Stream (application/json)
// Response headers
Content-Type:        application/json
Content-Disposition: attachment; filename="ITDeclaration_Infotype581_20250401.json"

// File body (pretty-printed SAP payload)
{
  "Date":         "01-Apr-2025",
  "Remarks":      "AY2025-26",
  "Declarations": [
    {
      "EmployeeID":      "EMP001",
      "FiscalYear":      "2025",
      "Particulars":     "House Rent Mumbai",
      "From":            "01-Apr-2024",
      "To":              "31-Mar-2025",
      "Type":            "Metro",
      "Declared":        180000,
      "Approved":        180000,
      "Remarks":         "Paid to landlord",
      "LandLordName":    "Rajesh Kumar",
      "LandLordPAN":     "ABCPK1234D",
      "LandLordTAN":     "",
      "LandLordAddress1":"12, MG Road",
      "LandLordAddress2":"Andheri West",
      "LandLordAddress3":"Mumbai",
      "LandLordAddress4":"Maharashtra",
      "LandLordAddress5":"400053"
    }
  ]
}
JAVASCRIPT — Trigger Browser File Download
async function downloadSapJson(declarationId, infotype) {
  const params = new URLSearchParams({
    DeclarationId: declarationId,
    EmployeeId:    0,
    PeriodId:      0,
    Infotype:      infotype,   // must be 580–586, NOT 0
    Date:          '01-Apr-2025',
    Remarks:       'AY2025-26'
  });

  const response = await fetch(
    `/SAP/DownloadITDeclarationJson?${params}`,
    { headers: { Login: loginHeader } }
  );

  if (!response.ok) {
    throw new Error(`Download failed: ${response.status}`);
  }

  const blob     = await response.blob();
  const url      = URL.createObjectURL(blob);
  const anchor   = document.createElement('a');
  anchor.href     = url;
  anchor.download = `ITDeclaration_Infotype${infotype}.json`;
  anchor.click();
  URL.revokeObjectURL(url);
}
🚀 Endpoint 3 — Push to SAP
POST /SAP/PushITDeclarationToSap Push payloads to SAP HR API; returns result per infotype
⚠
Check each item's isSuccess individually. The top-level isSuccess is true even when some infotypes fail — SAP can accept some and reject others in the same push. Always loop through data[] to surface per-infotype failures.
HTTP REQUEST — Push All Infotypes
POST /SAP/PushITDeclarationToSap?DeclarationId=1001&EmployeeId=0&PeriodId=0&Infotype=0&Date=01-Apr-2025&Remarks=AY2025-26

Login:        <base64-encoded LoginDTO>
Content-Type: application/json

// No request body needed — all parameters are query string
HTTP REQUEST — Push Single Infotype (586 only)
POST /SAP/PushITDeclarationToSap?DeclarationId=1001&EmployeeId=0&PeriodId=0&Infotype=586&Date=01-Apr-2025

Login:        <base64-encoded LoginDTO>
Content-Type: application/json
RESPONSE 200 — All Infotypes Pushed Successfully
{
  "isSuccess":  true,
  "statusCode": 200,
  "message":    null,
  "data": [
    {
      "infotype":    580,
      "endpointPath": "/sap/data/HR/ITDeclarationService/Previous",
      "isSuccess":  true,
      "httpStatus": 200,
      "responseBody": "{\"status\":\"success\",\"message\":\"Record created\"}"
    },
    {
      "infotype":    581,
      "endpointPath": "/sap/data/HR/ITDeclarationService/HRA",
      "isSuccess":  true,
      "httpStatus": 200,
      "responseBody": "{\"status\":\"success\",\"message\":\"Record created\"}"
    },
    {
      "infotype":    582,
      "endpointPath": "/sap/data/HR/ITDeclarationService/Family",
      "isSuccess":  true,
      "httpStatus": 200,
      "responseBody": "{\"status\":\"success\",\"message\":\"Record created\"}"
    },
    {
      "infotype":    583,
      "endpointPath": "/sap/data/HR/ITDeclarationService/OtherIncome",
      "isSuccess":  true,
      "httpStatus": 200,
      "responseBody": "{\"status\":\"success\",\"message\":\"Record created\"}"
    },
    {
      "infotype":    584,
      "endpointPath": "/sap/data/HR/ITDeclarationService/HouseProperty",
      "isSuccess":  true,
      "httpStatus": 200,
      "responseBody": "{\"status\":\"success\",\"message\":\"Record created\"}"
    },
    {
      "infotype":    585,
      "endpointPath": "/sap/data/HR/ITDeclarationService/Deduction",
      "isSuccess":  true,
      "httpStatus": 200,
      "responseBody": "{\"status\":\"success\",\"message\":\"Record created\"}"
    },
    {
      "infotype":    586,
      "endpointPath": "/sap/data/HR/ITDeclarationService/Contribution",
      "isSuccess":  true,
      "httpStatus": 200,
      "responseBody": "{\"status\":\"success\",\"message\":\"Record created\"}"
    }
  ]
}
RESPONSE 200 — Partial Failure (top-level isSuccess still true)
{
  "isSuccess":  true,   // ← wrapper is still true — check each item!
  "statusCode": 200,
  "message":    null,
  "data": [
    {
      "infotype":    580,
      "endpointPath": "/sap/data/HR/ITDeclarationService/Previous",
      "isSuccess":  true,
      "httpStatus": 200,
      "responseBody": "{\"status\":\"success\"}"
    },
    {
      "infotype":    583,
      "endpointPath": "/sap/data/HR/ITDeclarationService/OtherIncome",
      "isSuccess":  false,  // ← failure here
      "httpStatus": 400,
      "responseBody": "{\"error\":\"No other income records found\"}"
    },
    {
      "infotype":    581,
      "endpointPath": "/sap/data/HR/ITDeclarationService/HRA",
      "isSuccess":  false,  // ← SAP unreachable
      "httpStatus": 0,
      "responseBody": "Request to SAP failed: Connection refused"
    }
  ]
}
JAVASCRIPT — Push & Handle Per-Infotype Results
async function pushToSap(declarationId) {
  const params = new URLSearchParams({
    DeclarationId: declarationId,
    EmployeeId:    0,
    PeriodId:      0,
    Infotype:      0,    // push all infotypes
    Date:          '01-Apr-2025',
    Remarks:       'AY2025-26'
  });

  const response = await fetch(
    `/SAP/PushITDeclarationToSap?${params}`,
    { method: 'POST', headers: { Login: loginHeader } }
  );

  const result = await response.json();

  // Always loop items — top-level isSuccess can be true even with failures
  const pushResults = result.data;
  const succeeded   = pushResults.filter(r => r.isSuccess);
  const failed      = pushResults.filter(r => !r.isSuccess);

  console.log(`Pushed: ${succeeded.length} succeeded, ${failed.length} failed`);

  failed.forEach(f => {
    console.error(
      `Infotype ${f.infotype} FAILED`,
      `HTTP ${f.httpStatus}`,
      f.responseBody
    );
  });

  return { succeeded, failed };
}

📋 Complete Infotype Payload Schemas
580 Previous Employer Income · /ITDeclarationService/Previous
▼
FULL PAYLOAD SAMPLE
{
  "Date":         "01-Apr-2025",
  "Remarks":      "AY2025-26",
  "Declarations": [
    {
      "EmployeeID":          "EMP001",
      "FiscalYear":          "2025",
      "FromDate":            "01-Apr-2024",
      "ToDate":              "31-Mar-2025",
      "PreviousSalary":      250000,
      "PreviousPerquisites": 0,
      "PreviousProfitinLieu":0,
      "PreviousExemptions":  0,
      "PreviousPTAX":        2500,
      "PreviousPF":          18000,
      "PreviousIncomeTax":   15000
    }
  ]
}
FieldTypeNotes
EmployeeIDstringEmployee code from MEMPLOYEE (e.g. "EMP001")
FiscalYearstring"2025" for FY 2024–25
FromDate / ToDatestringPeriod dates in dd-MMM-yyyy from MPERIOD
PreviousSalarynumberGross salary from previous employer
PreviousPerquisitesnumberAlways 0 if not declared
PreviousProfitinLieunumberAlways 0 if not declared
PreviousExemptionsnumberAlways 0 if not declared
PreviousPTAXnumberProfessional Tax paid to previous employer
PreviousPFnumberProvident Fund deducted by previous employer
PreviousIncomeTaxnumberTDS deducted by previous employer
581 HRA / Rent Paid · /ITDeclarationService/HRA
▼
FULL PAYLOAD SAMPLE
{
  "Date":         "01-Apr-2025",
  "Remarks":      "AY2025-26",
  "Declarations": [
    {
      "EmployeeID":       "EMP001",
      "FiscalYear":       "2025",
      "Particulars":      "House Rent Mumbai",
      "From":             "01-Apr-2024",
      "To":               "31-Mar-2025",
      "Type":             "Metro",
      "Declared":         180000,
      "Approved":         180000,
      "Remarks":          "Paid to landlord",
      "LandLordName":     "Rajesh Kumar",
      "LandLordPAN":      "ABCPK1234D",
      "LandLordTAN":      "",
      "LandLordAddress1": "12, MG Road",
      "LandLordAddress2": "Andheri West",
      "LandLordAddress3": "Mumbai",
      "LandLordAddress4": "Maharashtra",
      "LandLordAddress5": "400053"
    }
  ]
}
FieldTypeNotes
Typestring"Metro" or "Non-Metro" — driven by IsMetro flag
From / TostringRent period in dd-MMM-yyyy
DeclarednumberAnnual rent declared by employee
ApprovednumberAmount approved by employer
LandLordPANstringMandatory when annual rent > ₹1,00,000
LandLordAddress1–5string5 address lines — empty string if not filled, never null
582 Family / Calculation Method (Tax Regime) · /ITDeclarationService/Family
▼
FULL PAYLOAD SAMPLE
{
  "Date":         "01-Apr-2025",
  "Remarks":      "AY2025-26",
  "Declarations": [
    {
      "EmployeeID":        "EMP001",
      "FiscalYear":        "2025",
      "CalculationMethod": "old",
      "NOOFEDUCATION":     1,
      "NOOFHOSTEL":        0
    }
  ]
}
FieldTypeNotes
CalculationMethodstring"old" = old tax regime · "new" = new tax regime
NOOFEDUCATIONnumberNo. of children for education allowance exemption
NOOFHOSTELnumberNo. of children in hostel for hostel allowance exemption
583 Other Income · /ITDeclarationService/OtherIncome
▼
FULL PAYLOAD SAMPLE
{
  "Date":         "01-Apr-2025",
  "Remarks":      "AY2025-26",
  "Declarations": [
    {
      "EmployeeID":             "EMP001",
      "FiscalYear":             "2025",
      "BusinessProfit":         0,
      "LongTermCapitalGains":   0,
      "ShortTermCapitalGains":  0,
      "DividendIncome":          5000,
      "InterestIncome":          12000,
      "DigitalIncome":           0,
      "OnlineIncome":            0,
      "WinningIncome":           0
    }
  ]
}
FieldTypeNotes
BusinessProfitnumberIncome from business or profession (Schedule BP)
LongTermCapitalGainsnumberLTCG on shares, property, mutual funds
ShortTermCapitalGainsnumberSTCG on shares, mutual funds
DividendIncomenumberDividend income from shares/MFs
InterestIncomenumberFD / savings bank / bond interest
DigitalIncomenumberIncome from digital assets (crypto, NFT)
OnlineIncomenumberOnline freelance / gig income
WinningIncomenumberLottery / game show / horse race winnings
584 House Property · /ITDeclarationService/HouseProperty
▼
FULL PAYLOAD SAMPLE (Self-Occupied with Home Loan)
{
  "Date":         "01-Apr-2025",
  "Remarks":      "AY2025-26",
  "Declarations": [
    {
      "EmployeeID":         "EMP001",
      "FiscalYear":         "2025",
      "Type":               "Self Occupied",
      // ── Rental Income block ─────────────────
      "Particulars1":       "",
      "AnnualRentalIncome":  0,
      "LocalTaxPaid":        0,
      "NetAnnualValue":      0,
      "StandardDeduction":   0,
      "InterestOnBorrowal":  150000,
      "TotalDeduction":      150000,
      "NetIncome":           -150000,
      "EligibleFor80EEA":   true,
      "PossesionObtained":  true,
      "Remarks1":            "",
      // ── Home Loan block ─────────────────────
      "Particulars2":       "Home Loan - SBI",
      "PrinciplePaid":      85000,
      "InterestPaid":       150000,
      "Remarks2":           "",
      "LenderName":         "State Bank of India",
      "LenderPAN":          "SBILN0001A",
      "LenderTAN":          "",
      "LenderAddress1":     "SBI Branch",
      "LenderAddress2":     "Fort",
      "LenderAddress3":     "Mumbai",
      "LenderAddress4":     "Maharashtra",
      "LenderAddress5":     "400001"
    }
  ]
}
FieldTypeNotes
Typestring"Self Occupied" · "Let Out" · "Partly Rented"
AnnualRentalIncomenumber0 for self-occupied property
InterestOnBorrowalnumberMax ₹2,00,000 for self-occupied deduction
EligibleFor80EEAbooleanFirst-time home buyer additional deduction eligibility
PossesionObtainedbooleanWhether property possession has been received
PrinciplePaidnumberPrincipal repaid (eligible under 80C)
InterestPaidnumberInterest paid on home loan
LenderAddress1–5string5 lender address lines — empty string if not filled
585 Deductions (80D, 80E, 80G, 80TTA…) · /ITDeclarationService/Deduction
▼
ℹ
One SAP record per deduction line. ConsiderActual is always "Yes". Multiple rows if the employee has multiple deductions under different sections.
FULL PAYLOAD SAMPLE (Multiple Deduction Lines)
{
  "Date":         "01-Apr-2025",
  "Remarks":      "AY2025-26",
  "Declarations": [
    {
      "EmployeeID":    "EMP001",
      "FiscalYear":    "2025",
      "ConsiderActual":"Yes",
      "Section":       "80D",
      "Particulars":   "Medical Insurance - Self & Family",
      "Declared":      25000,
      "Approved":      25000,
      "Remarks":       ""
    },
    {
      "EmployeeID":    "EMP001",
      "FiscalYear":    "2025",
      "ConsiderActual":"Yes",
      "Section":       "80E",
      "Particulars":   "Education Loan Interest",
      "Declared":      40000,
      "Approved":      40000,
      "Remarks":       ""
    },
    {
      "EmployeeID":    "EMP001",
      "FiscalYear":    "2025",
      "ConsiderActual":"Yes",
      "Section":       "80G",
      "Particulars":   "PM Relief Fund Donation",
      "Declared":      10000,
      "Approved":      10000,
      "Remarks":       ""
    }
  ]
}
FieldTypeNotes
ConsiderActualstringAlways "Yes" — set by the system
SectionstringIncome tax section (e.g. "80D", "80E", "80G", "80TTA")
ParticularsstringDescription from MTDSSECTIONDETAIL
DeclarednumberAmount declared by employee
ApprovednumberAmount approved by employer
586 Contributions (80C, 80CCC, 80CCD) · /ITDeclarationService/Contribution
▼
ℹ
One SAP record per investment/contribution line. Same structure as 585 — the endpoint path and infotype number differ. ConsiderActual is always "Yes".
FULL PAYLOAD SAMPLE (Multiple Contribution Lines)
{
  "Date":         "01-Apr-2025",
  "Remarks":      "AY2025-26",
  "Declarations": [
    {
      "EmployeeID":    "EMP001",
      "FiscalYear":    "2025",
      "ConsiderActual":"Yes",
      "Section":       "80C",
      "Particulars":   "LIC Premium",
      "Declared":      50000,
      "Approved":      50000,
      "Remarks":       ""
    },
    {
      "EmployeeID":    "EMP001",
      "FiscalYear":    "2025",
      "ConsiderActual":"Yes",
      "Section":       "80C",
      "Particulars":   "PPF Contribution",
      "Declared":      30000,
      "Approved":      30000,
      "Remarks":       ""
    },
    {
      "EmployeeID":    "EMP001",
      "FiscalYear":    "2025",
      "ConsiderActual":"Yes",
      "Section":       "80CCD",
      "Particulars":   "NPS Contribution",
      "Declared":      50000,
      "Approved":      50000,
      "Remarks":       ""
    },
    {
      "EmployeeID":    "EMP001",
      "FiscalYear":    "2025",
      "ConsiderActual":"Yes",
      "Section":       "80C",
      "Particulars":   "ELSS Mutual Fund",
      "Declared":      20000,
      "Approved":      20000,
      "Remarks":       ""
    }
  ]
}
FieldTypeNotes
ConsiderActualstringAlways "Yes" — set by the system
Sectionstring"80C", "80CCC", or "80CCD"
ParticularsstringInvestment name (LIC, PPF, ELSS, NPS, etc.)
DeclarednumberAmount declared by employee
ApprovednumberAmount approved by employer

⚠ Error Responses
HTTP Status Scenario Response
400 No filter provided (all IDs are 0) isSuccess: false · "At least one of DeclarationId, EmployeeId, or PeriodId must be provided."
200 (item fail) SAP returns HTTP 4xx/5xx for a specific infotype item.isSuccess: false · item.httpStatus: 400 · item.responseBody: SAP error JSON
200 (item fail) SAP unreachable / connection refused item.isSuccess: false · item.httpStatus: 0 · item.responseBody: "Request to SAP failed: ..."
401 Missing or invalid Login header Standard framework 401 response
500 Unhandled server exception Standard framework 500, stack trace suppressed in production
EXAMPLE — 400 Validation Error
{
  "isSuccess":  false,
  "statusCode": 400,
  "message":    "At least one of DeclarationId, EmployeeId, or PeriodId must be provided.",
  "data":       null
}
EXAMPLE — SAP Network Error (httpStatus 0)
{
  "isSuccess":  true,   // wrapper still true
  "statusCode": 200,
  "data": [
    {
      "infotype":     580,
      "isSuccess":   false,
      "httpStatus":  0,
      "responseBody": "Request to SAP failed: Connection refused (hostname/port)"
    }
  ]
}
⚙ Use Case Scenarios — Quick Reference
Scenario DeclarationId EmployeeId PeriodId Infotype
Single employee — all infotypes 1001 0 0 0
Single employee — only 80C contributions 1001 0 0 586
Single employee — only deductions (80D, 80E…) 1001 0 0 585
Bulk push — entire payroll period 0 0 5 0
One employee across a period 0 42 5 0
Preview family/regime for one declaration 1001 0 0 582
Download HRA JSON file 1001 0 0 581
Download previous employer income file 1001 0 0 580
🖌 Recommended UI Flow
SAP Push Screen Wireframe
┌──────────────────────────────────────────────────────────────┐
│  IT Declaration — SAP Push                                   │
│                                                              │
│  Filter by:  ○ Declaration ID   ○ Employee   ○ Period        │
│  Value:      [ 1001           ]                              │
│                                                              │
│  Infotype:   [ All (0–586) ▼  ]                              │
│  Date:       [ 01-Apr-2025    ]                              │
│  Remarks:    [ AY2025-26      ]                              │
│                                                              │
│  [ Preview JSON ]    [ ↓ Download ]    [ 🚀 Push to SAP ]   │
└──────────────────────────────────────────────────────────────┘
                            │
           ┌────────────────┼────────────────┐
           ▼                ▼                ▼
   GET /GetJson       GET /Download    POST /Push
   Show infotype      Requires         Show result
   tabs + JSON        specific IT      table below
Push Result Table (after POST)
Infotype Name Status HTTP SAP Response
580 Previous Income
Success
200 {"status":"success"}
581 HRA / Rent
Success
200 {"status":"success"}
582 Family / Regime
Success
200 {"status":"success"}
583 Other Income
Failed
400 {"error":"No records found"}
585 Deductions
Success
200 {"status":"success"}
586 Contributions
Success
200 {"status":"success"}
✅
Download button rule: Enable only when a specific infotype is selected (580–586). Disable or hide when "All (0)" is selected — the download endpoint requires a single infotype.
Preview button: Works with Infotype=0 (shows all 7 tabs).
Push button: Works with Infotype=0 (pushes all). Always loop the result array — never rely on the top-level isSuccess alone.
PayRoll SAP Integration · GB5 Framework · Generated 2026-05-02