× Freshbooks App Logo
FreshBooks
Official App
Free - Google Play
Get it

Contractors

Contractor API calls are only available to an account’s administrator, not to staff members.

contractor.create

Send an email inviting the recipient to collaborate on your projects as a contractor.

Request

<?xml version="1.0" encoding="utf-8"?>
<request method="contractor.create">
	<contractor>
		<name>Name</name>
		<email>email@freshbooks.com</email> <!--Required-->
		<rate>25.50</rate> <!-- numeric values only -->
		<task_id>1</task_id> <!--Required-->
		<projects>
		 <!-- Assign new contractors to specific projects using project_id -->
			<project>
				<project_id>1</project_id>
			</project>
			<project>
				<project_id>2</project_id>
			</project>
		</projects>
	</contractor>
</request>

Response

<?xml version="1.0" encoding="utf-8"?>
<response xmlns="https://www.freshbooks.com/api/" status="ok">
	<contractor_id>36</contractor_id>
</response>

contractor.update

Updates information for an existing contractor, including their hourly rate and assigned projects.

Request

<?xml version="1.0" encoding="utf-8"?>
<request method="contractor.update">
	<contractor>
		<contractor_id>36</contractor_id> <!--Required-->
		<name>Name</name>
		<email>email@freshbooks.com</email>
		<rate>25.50</rate> <!-- numeric values only -->
		<task_id>1</task_id>
		<!-- this list will override the current project list if exists -->
		<projects>
			<project>
				<project_id>1</project_id>
			</project>
			<project>
				<project_id>2</project_id>
			</project>
		</projects>
	</contractor>
</request>

Response

<?xml version="1.0" encoding="utf-8"?>
<response xmlns="https://www.freshbooks.com/api/" status="ok">
	<contractor_id>36</contractor_id>
</response>

contractor.get

Returns details for the specified contractor.

Request

<?xml version="1.0" encoding="utf-8"?>
<request method="contractor.get">
	<contractor_id>36</contractor_id> <!--Required-->
</request>

Response

<?xml version="1.0" encoding="utf-8"?>
<response xmlns="https://www.freshbooks.com/api/" status="ok">
	<contractor>
		<contractor_id>36</contractor_id>
		<name>Test</name>
		<email>test@testing.com</email>
		<status>invited</status> <!-- 'invited' or 'accepted' -->
		<rate>100</rate>
		<task_id>1</task_id>
		<projects></projects>
	</contractor>
</response>

contractor.delete

Delete the contractor with the given contractor_id.

Request

<?xml version="1.0" encoding="utf-8"?>
<request method="contractor.delete">
	<contractor_id>36</contractor_id> <!--Required-->
</request>

Response

<?xml version="1.0" encoding="utf-8"?>
<response xmlns="http://www.freshboos.com/api/" status="ok"></response>

contractor.list

Returns a list of contractor summaries in order of descending contractor_id.
NOTE: This method uses pagination

Request

<?xml version="1.0" encoding="utf-8"?>
<request method="contractor.list">
	<page>1</page>
	<per_page>1</per_page>
</request>

Response

<?xml version="1.0" encoding="utf-8"?>
<response xmlns="https://www.freshbooks.com/api/" status="ok">
	<contractors page="1" per_page="25" pages="1" total="2">
		<contractor>
			<contractor_id>22</contractor_id>
			<name>Test Contractor</name>
			<email>test@freshbooks.com</email>
			<status>accepted</status>
			<rate>10</rate>
			<task_id>6</task_id>
			<projects>
				<project>
					<project_id>1</project_id>
				</project>
				<project>
					<project_id>2</project_id>
				</project>
				<project>
					<project_id>3</project_id>
				</project>
			</projects>
		</contractor>
		<contractor>
			<contractor_id>5</contractor_id>
			<name>Test Contractor 2</name>
			<email>test2@freshbooks.com</email>
			<status>accepted</status>
			<rate>150</rate>
			<task_id>2</task_id>
			<projects>
				<project>
					<project_id>4</project_id>
				</project>
				<project>
					<project_id>7</project_id>
				</project>
			</projects>
		</contractor>
	</contractors>
</response>