API Reference
Staff

Create or update user information

post post /api/add edit staff creates or updates staff information using the user id in your system (external id) this endpoint is used for a single staff only request body parameters body parameters customer id integer required integer required the unique marco identifier for your company customer system id string required string required the staff's unique identifier in your company's system example 50 customer system id type string required string required the name of your system example ps name string string required required the staff's full name system email string string required required the staff's email, used to log into marco country string string required required the staff's country of residence, formatted as an iso alpha 2 code example jp note if you are changing the staff's country , you must fill in old country and new country effective date job title string required string required the staff's job title example hr manager job start date string string required required the staff's job start date , formatted as yyyy mm dd example 2020/01/31 staff type string string required required the staff's service type valid values system, payroll, hro, eor is manager boolean optional boolean optional whether the staff is a manager default false is employee boolean optional boolean optional whether the staff is an employee default true is intern boolean optional boolean optional whether the staff is an intern cannot be true if any of the previous boolean values are true birthdate string string optional optional the staff's date of birth , formatted as yyyy mm dd gender string string optional optional the staff's gender valid values female, male highest education string string optional optional the staff's highest education nationality string string optional optional the staff's nationality, formatted as the country's iso alpha 2 code personal email string string optional optional the staff's personal email phone string string optional optional the staff's phone number phone country string string optional optional the country code for the staff's phone number, formatted as the country's iso alpha 2 code emergency name string string optional optional the name of the staff's emergency contact emergency email string string optional optional the email belonging to the staff's emergency contact emergency phone string string optional optional the phone number belonging to the staff's emergency contact emergency phone country string string optional optional the country code for the staff's emergency contact's phone number, formatted as the country's iso alpha 2 code emergency relationship string string optional optional the staff's relationship to the emergency contact passport number string string optional optional the staff's passport number passport issue date string string optional optional the staff's passport issue date , formatted as yyyy mm dd passport issuing country string string optional optional the staff's passport issuing country, formatted as an iso alpha 2 code passport expiry date string string optional optional the staff's passport expiry date , formatted as yyyy mm dd reporting officer string string optional optional the staff's reporting manager ec type string string optional optional the staff's employment contract type valid values fixed term, indefinite ec entity id string string optional optional the unique identifier for the business entity that holds the employment relationship with the staff ec entity system id type string string optional optional the system that stores the ec entity id valid values marco, customer use "marco" if the id is stored in marco; otherwise use "customer" ec start date string string optional optional the start date for the staff's employment contract , formatted as yyyy mm dd this may differ from the job start date if multiple contracts have been signed in succession ec end date string string optional optional the end date for the staff's employment contract , formatted as yyyy mm dd probation end date string string optional optional the staff's probation end date , formatted as yyyy mm dd last working day string string optional optional the staff's last working day , formatted as yyyy mm dd offboarding reason string string optional optional the staff's offboarding reason valid values involuntary, voluntary location string string optional optional the staff's work location work email string string optional optional the staff's work email customer data type array\[object] array\[object] optional optional additional data specified by your company these data fields need to be configured in marco as a company data type before it can be sent via the endpoint example \[{"name" "department","value" "technology"},{"name" "rank","value" "p2"}] customer data type name string string optional optional custom data field name customer data type value string string optional optional the staff's value for the custom field old country string string optional optional the staff's previous country of residence, formatted as an iso alpha 2 code required only if you are updating the staff's country new country effective date string string optional optional effective date of the staff's relocation , formatted as yyyy mm dd required only if you are updating the staff's country example requests curl x post 'https //api marcopayroll com/api\ benkock8/api/add edit staff' \\ h 'content type application/json' \\ h 'authorization $auth token' \\ d '{ "customer id" 2, "customer system id" "50", "customer system id type" "ps" "name" "li lei", "system email" "lilei\@mail com", "country" "cn", "job title" "product manager", "job start date" "2020 01 31", "staff type" "payroll", "is manager" true, "is employee" true, "is intern" false, "birthdate" "1980 01 04", "gender" "male", "highest education" "university", "nationality" "cn", “personal email” "ll\@mail com", “phone” "17623453456", “phone country” "cn", “emergency name” "han meimei", “emergency email” "hmm\@mail com", "emergency phone" "18876546789", "emergency phone country" "cn", "emergency relationship" "mother", "passport number" "eg8213789", "passport issue date" "2020 01 03", "passport issuing country" "cn", "passport expiry date" "2024 01 02", "reporting officer" "tuan tuan", "ec type" "fixed term", "ec entity id" "", "ec entity system id type" "", "ec start date" "2020 01 31", "ec end date" "2025 07 01", "probation end date" "2020 07 01", "last working day" "", "offboarding reason" "", "location" "beijing", "work email" "lilei\@mail com", "customer data type" \[ { "name" "department", "value" "technology" }, { "name" "rank", "value" "p2" } ] "old country" "", "new country effective date" "" }'import requests url = "https //api marcopayroll com/api/benkock8/api/add edit staff" payload={ "customer id" 2, "customer system id" "50", "customer system id type" "ps" "name" "li lei", "system email" "lilei\@mail com", "country" "cn", "job title" "product manager", "job start date" "2020 01 31", "staff type" "payroll", "is manager" true, "is employee" true, "is intern" false, "birthdate" "1980 01 04", "gender" "male", "highest education" "university", "nationality" "cn", “personal email” "ll\@mail com", “phone” "17623453456", “phone country” "cn", “emergency name” "han meimei", “emergency email” "hmm\@mail com", "emergency phone" "18876546789", "emergency phone country" "cn", "emergency relationship" "mother", "passport number" "eg8213789", "passport issue date" "2020 01 03", "passport issuing country" "cn", "passport expiry date" "2024 01 02", "reporting officer" "tuan tuan", "ec type" "fixed term", "ec entity id" "", "ec entity system id type" "", "ec start date" "2020 01 31", "ec end date" "2025 07 01", "probation end date" "2020 07 01", "last working day" "", "offboarding reason" "", "location" "beijing", "work email" "lilei\@mail com", "customer data type" \[ { "name" "department", "value" "technology" }, { "name" "rank", "value" "p2" } ] "old country" "", "new country effective date" "" } headers = { "accept" "application/json", "authorization" "your auth token" } response = requests post(url, headers=headers, data=payload) print(response text){ "user" { "name" "li lei", "role" "staff", "system email" "lilei\@mail com", "id" 1348, "country" "cn", "status" "regular", "offboarding reason" "", "birthdate" "", "gender" "male", "highest education" "university", "nationality" "cn", "personal email" "ll\@mail com", "phone" "8617623453456", "emergency name" "han meimei", "emergency email" "hmm\@mail com", "emergency phone" "8618876546789", "emergency relationship" "mother", "passport number" "eg8213789", "passpost issue date" "", "passport issuing country" "", "passport expiry date" "", "reporting officer" "tuan tuan", "job title" "product manager", "location" "beijing", "staff type" "payroll", "work email" "lilei\@mail com", "ec entity" "", "ec type" "fixed term", "ec vendor" "", "job start date" "2020 01 31", "probation end date" "2020 07 01", "ec start date" "2020 01 31", "ec end date" "2025 07 01", "last working day" null, "host country" "", "host staff type" "", "host ec entity" "", "host ec vendor" "", "host ec type" "", "host ec start date" "", "host ec end date" "", "job scope" "", "customer system id" "50", }, "message" "update successfully", "id" 1307 } response the user object docid 3yuppflogbxfcc92beayp object object the staff's information message string string the endpoint response status valid values add successfully, update successfully, permission denied id integer integer the caller's unique marco identifier