Terminate an Employee
  • 16 Feb 2024
  • 3 Minutes to read
  • Dark
    Light

Terminate an Employee

  • Dark
    Light

Article summary

This article shows how to use the PY Employee endpoint (pyemployee) to terminate an employee.

Create a POST request

Request

curl --request POST \
     --url https://yourserver.com/yourenvironment/hcm-rest-api/rest/1/pyemployee/ \
     --header 'accept: application/json' \
     --header 'authorization: Basic PDx1c2VyPj46PDxwYXNzPj4=' \
     --header 'content-type: application/vnd.oracle.adf.resourceitem+json' \
     --data-raw '{
    		"EmhActionCode": "TR",
    		"EmpVUuid": "",
    		"EmpNo": "006",
    		"EmpUser": "SERVICEUSER",
    		"EmpCompCode": "001",
    		"EmpStatus": "T",
    		"EmpTxtCode": "TE",
    		"EmpTerminationDate": "2021-10-05",        
    		"EmhEffectiveDate": "2021-10-05"
			}

Payload Elements

  • EmhActionCode
  • EmpVUuid
  • EmpNo
  • EmpUser
  • EmpCompCode
  • EmpStatus
  • EmpTxtCode
  • EmhEffectiveDate
  • EmpTerminationDate

EmhActionCodes

ValueDescription
CHUsed for any changes
NRNew hires
TMTermination
RRRe-hire
INPay rate increment
PRPromotion
TRTransfer (i.e. cost center changes)
DEDeceased
RTRetired

EmpStatus

ValueDescription
AActive
TTerminated
RRetired
DDeceased
SSick
UUnpaid leave
PPaid leave
LTemporary layoff
OOther

Response

{
    "EmpNo": "006",
    "EmpCalcPref": null,
    "EmpComment": null,
    "EmpResLoc": null,
    "EmpOtEligibility": null,
    "EmpPaymentMode": null,
    "EmpLastIncrDate": null,
    "EmpLastPromDate": null,
    "EmpLastTranDate": null,
    "EmpUser": "SERVICEUSER",
    "EmpIuCreateDatetime": null,
    "EmpIuUpdateDatetime": null,
    "EmpTd1ExempAmt": null,
    "EmpEiCode": null,
    "EmpAdpFilingStatus": null,
    "EmpSseFlag": null,
    "EmpTd1ExempFlag": null,
    "EmpEligibilityFlag": null,
    "EmpHardshipSuspFlag": null,
    "EmpSecGrpEmpCode": null,
    "EmpSecGrpEmpName": null,
    "EmpFlsaType": null,
    "EmpHemplYearlySal": null,
    "EmpHemplType": null,
    "EmpHasCert": null,
    "EmpHasSkill": null,
    "EmpHrrTypeCode": null,
    "EmpHrrTypeDesc": null,
    "EmpLastTshJobCompCode": null,
    "EmpLastTshJobCode": null,
    "EmpLastTshJobDesc": null,
    "EmpWorkCellPhone": null,
    "EmpWorkEmailAddress": null,
    "EmpVertexGeocodeSource": null,
    "EmpAddressForeignFlag": null,
    "EmpPhAddressForeignFlag": null,
    "EmpPhCountryCode": null,
    "EmpPhCountryName": null,
    "EmpPhStateCode": null,
    "EmpPhStateName": null,
    "EmpReportsTo": null,
    "EmpReportsToName": null,
    "EmpFullName": null,
    "EmpFirstName": null,
    "EmpMiddleName": null,
    "EmpLastName": null,
    "EmpPrefixName": null,
    "EmpSuffixName": null,
    "EmpNickName": null,
    "EmpSinNo": null,
    "EmpType": null,
    "EmpFullPartTime": null,
    "EmpStatus": "T",
    "EmpStatusDesc": null,
    "EmpSubStatus": null,
    "EmpCalcAccruedLeave": null,
    "EmpUnionized": null,
    "EmpMembershipDate": null,
    "EmpRehireEligible": null,
    "EmpUniCode": null,
    "EmpUniName": null,
    "EmpUnionMemNo": null,
    "EmpJobTitle": null,
    "EmpPlaceOfBirth": null,
    "EmpDateOfBirth": null,
    "EmpHireDate": null,
    "EmpTerminationDate": null,
    "EmpReHireDate": null,
    "EmpDateDeceased": null,
    "EmpSeniorityDate": null,
    "EmpNextReviewDate": null,
    "EmpAdjustedSeriviceDate": null,
    "EmpPrimaryEmpNo": null,
    "EmpYearWorkingDays": null,
    "EmpYearWorkingHours": null,
    "EmpServiceYears": null,
    "EmpUeValidFlag": null,
    "EmpCompCode": "001",
    "EmpCompName": null,
    "EmpHomeCompCode": null,
    "EmpHomeCompName": null,
    "EmpDeptCode": null,
    "EmpDeptName": null,
    "EmpHomeDeptCode": null,
    "EmpHomeDeptName": null,
    "EmpGlAccCode": null,
    "EmpGlAccName": null,
    "EmpPayrollClearAccCode": null,
    "EmpPayrollClearAccName": null,
    "EmpDrClearAccCode": null,
    "EmpDrClearAccName": null,
    "EmpLevAcruGlAccCode": null,
    "EmpLevAcruGlAccName": null,
    "EmpLevClearAccCode": null,
    "EmpLevClearAccName": null,
    "EmpPrnCode": null,
    "EmpPrnName": null,
    "EmpPygCode": null,
    "EmpPygName": null,
    "EmpWrlCode": null,
    "EmpWrlName": null,
    "EmpGrdCode": null,
    "EmpGrdName": null,
    "EmpTrdCode": null,
    "EmpTrdName": null,
    "EmpExpAprvGrpCode": null,
    "EmpExpAprvGrpName": null,
    "EmpTshCode": null,
    "EmpTshName": null,
    "EmpCklocCode": null,
    "EmpCklocName": null,
    "EmpWcbCode": null,
    "EmpWcbName": null,
    "EmpPlCode": null,
    "EmpPlName": null,
    "EmpWcbByJob": null,
    "EmpPlByJob": null,
    "EmpWrlFlag": null,
    "EmpExcpInclFlag": null,
    "EmpInclCertPyRepFlag": null,
    "EmpAutogenerateTimesheet": null,
    "EmpDispatchFlag": null,
    "EmpAnnualSalary": null,
    "EmpHourlyRate": null,
    "EmpChargeOutRate": null,
    "EmpBillingRate": null,
    "EmpRateCode": null,
    "EmpRateName": null,
    "EmpOtRateCode": null,
    "EmpOtRateName": null,
    "EmpDotRateCode": null,
    "EmpDotRateName": null,
    "EmpOthRateCode": null,
    "EmpOthRateName": null,
    "EmpPreferPayRate": null,
    "EmpPreferChargeRate": null,
    "EmpPreferBillRate": null,
    "EmpDirectDepMethod": null,
    "EmpDirectDepEmail": null,
    "EmpMinHourCode": null,
    "EmpUserEnteredOt": null,
    "EmpUserEnteredDt": null,
    "EmpJobCompCode": null,
    "EmpJobCompName": null,
    "EmpJobCode": null,
    "EmpJobName": null,
    "EmpPhsCode": null,
    "EmpPhsName": null,
    "EmpCatCode": null,
    "EmpCatName": null,
    "EmpEquipmentNo": null,
    "EmpEquipmentName": null,
    "EmpEquipPhsCode": null,
    "EmpEquipPhsName": null,
    "EmpEquipCategory": null,
    "EmpEquipCatName": null,
    "EmpEquipTranCode": null,
    "EmpEquipTranName": null,
    "EmpAddress1": null,
    "EmpAddress2": null,
    "EmpAddress3": null,
    "EmpZipCode": null,
    "EmpPhAddress1": null,
    "EmpPhAddress2": null,
    "EmpPhAddress3": null,
    "EmpPhZipCode": null,
    "EmpCountryCode": null,
    "EmpCountryName": null,
    "EmpStateCode": null,
    "EmpStateName": null,
    "EmpCountyCode": null,
    "EmpCountyName": null,
    "EmpCityCode": null,
    "EmpCityName": null,
    "EmpPhone": null,
    "EmpWorkPhone": null,
    "EmpCellPhone": null,
    "EmpPager": null,
    "EmpFax": null,
    "EmpWorkFax": null,
    "EmpEmailAddress": null,
    "EmpResLatitude": null,
    "EmpResLongitude": null,
    "EmpBpCode": null,
    "EmpPrefContactMth": null,
    "EmpVertexGeocode": null,
    "EmpVertexSchdist": null,
    "EmpResidentStatus": null,
    "EmpFilingStatus": null,
    "EmpFilingStatusName": null,
    "EmpStateFilingStatus": null,
    "EmpStateFilingStatusName": null,
    "EmpCityFilingStatus": null,
    "EmpCityFilingStatusName": null,
    "EmpPrimExemp": null,
    "EmpSecnExemp": null,
    "EmpTertExemp": null,
    "EmpPrimExempAmt": null,
    "EmpSuplExempAmt": null,
    "EmpSuiState": null,
    "EmpSuiStateName": null,
    "EmpNrCertificate": null,
    "EmpPensionFlag": null,
    "EmpDefCompFlag": null,
    "EmpAddrCompCode": null,
    "EmpAddrCode": null,
    "EmpAddrName": null,
    "EmpRegCompCode": null,
    "EmpRegionCode": null,
    "EmpRegionName": null,
    "EmpPosCode": null,
    "EmpPosName": null,
    "EmpDisabilityDisCode": null,
    "EmpDisabilityDisName": null,
    "EmpTravelFlag": null,
    "EmpTravelDistance": null,
    "EmpLanguageLangName": null,
    "EmpApplicantAplNo": null,
    "EmpLoginUser": null,
    "EmpSex": null,
    "EmpMaritalStatus": null,
    "EmpEthnicCode": null,
    "EmpMilitaryStatus": null,
    "EmpMilitarySeparationDate": null,
    "EmpDominantHand": null,
    "EmpLeaveCalcPref": null,
    "EmhActionCode": "TR",
    "EmhDateDeceased": null,
    "EmhEffectiveDate": "2021-10-05",
    "EmpEtimeAccessRoleCode": null,
    "EmpMsgId": null,
    "EmpPositionCode": null,
    "EmpFieldTrackingFlag": null,
    "EmpTd1ProvExempAmt": null,
    "EmpWorkProvince": null,
    "EmpPensionNumber": null,
    "EmpDisabledFlag": null,
    "EmpAboriginalFlag": null,
    "EmpVisibleMinorityFlag": null,
    "EmpTxtCode": "TE",
    "EmpCreateAccessCode": null,
    "EmpDeleteAccessCode": null,
    "EmpDeleteFromAprvList": null,
    "EmpBenDedEndDate": null,
    "EmpSource": null,
    "EmpVUuid": "F2F060148BD87BAEE05316821FACE22C",
    "EmpBpFlag": null,
    "links": [
        {
            "rel": "self",
            "href": "http://mobtest.cmiccloudr12.com:80/cmictestrti/hcm-rest-api/rest/1/pyemployee/F2F060148BD87BAEE05316821FACE22C",
            "name": "pyemployee",
            "kind": "item"
        },
        {
            "rel": "canonical",
            "href": "http://mobtest.cmiccloudr12.com:80/cmictestrti/hcm-rest-api/rest/1/pyemployee/F2F060148BD87BAEE05316821FACE22C",
            "name": "pyemployee",
            "kind": "item"
        }
    ]
}