Xero Projects API

Project

createProject

Create one or more new projects


/Projects

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
idempotency_key = 'KEY_VALUE'

begin
  response = xero_client.accounting_api.create_project(xero_tenant_id, projectCreateOrUpdate, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling create_project: #{e}"
end

Scopes

projects Grant read-write access to projects

Parameters

Header parameters
Name Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
projectCreateOrUpdate *
ProjectCreateOrUpdate
Create a new project with ProjectCreateOrUpdate object
Required

createTask

Allows you to create a task

Allows you to create a specific task


/Projects/{projectId}/Tasks

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
project_id = '38400000-8cf0-11bd-b23e-10b96e4ef00d'
idempotency_key = 'KEY_VALUE'

begin
  response = xero_client.accounting_api.create_task(xero_tenant_id, project_id, taskCreateOrUpdate, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling create_task: #{e}"
end

Scopes

projects Grant read-write access to projects

Parameters

Path parameters
Name Description
projectId*
UUID (uuid)
You can create a task on a specified projectId
Required
Header parameters
Name Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
taskCreateOrUpdate *
TaskCreateOrUpdate
The task object you are creating
Required

createTimeEntry

Creates a time entry for a specific project

Allows you to create a specific task


/Projects/{projectId}/Time

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
project_id = '38400000-8cf0-11bd-b23e-10b96e4ef00d'
idempotency_key = 'KEY_VALUE'

begin
  response = xero_client.accounting_api.create_time_entry(xero_tenant_id, project_id, timeEntryCreateOrUpdate, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling create_time_entry: #{e}"
end

Scopes

projects Grant read-write access to projects

Parameters

Path parameters
Name Description
projectId*
UUID (uuid)
You can specify an individual project by appending the projectId to the endpoint
Required
Header parameters
Name Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
timeEntryCreateOrUpdate *
TimeEntryCreateOrUpdate
The time entry object you are creating
Required

deleteTask

Allows you to delete a task

Allows you to delete a specific task


/Projects/{projectId}/Tasks/{taskId}

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
project_id = '38400000-8cf0-11bd-b23e-10b96e4ef00d'
task_id = '38400000-8cf0-11bd-b23e-10b96e4ef00d'

begin
  response = xero_client.accounting_api.delete_task(xero_tenant_id, project_id, task_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling delete_task: #{e}"
end

Scopes

projects Grant read-write access to projects

Parameters

Path parameters
Name Description
projectId*
UUID (uuid)
You can specify an individual project by appending the projectId to the endpoint
Required
taskId*
UUID (uuid)
You can specify an individual task by appending the id to the endpoint
Required
Header parameters
Name Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required

deleteTimeEntry

Deletes a time entry for a specific project

Allows you to delete a specific time entry


/Projects/{projectId}/Time/{timeEntryId}

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
project_id = '38400000-8cf0-11bd-b23e-10b96e4ef00d'
time_entry_id = '38400000-8cf0-11bd-b23e-10b96e4ef00d'

begin
  response = xero_client.accounting_api.delete_time_entry(xero_tenant_id, project_id, time_entry_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling delete_time_entry: #{e}"
end

Scopes

projects Grant read-write access to projects

Parameters

Path parameters
Name Description
projectId*
UUID (uuid)
You can specify an individual project by appending the projectId to the endpoint
Required
timeEntryId*
UUID (uuid)
You can specify an individual task by appending the id to the endpoint
Required
Header parameters
Name Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required

getProject

Retrieves a single project

Allows you to retrieve a specific project using the projectId


/Projects/{projectId}

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
project_id = '38400000-8cf0-11bd-b23e-10b96e4ef00d'

begin
  response = xero_client.accounting_api.get_project(xero_tenant_id, project_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_project: #{e}"
end

Scopes

projects Grant read-write access to projects
projects.read Grant read-only access to projects

Parameters

Path parameters
Name Description
projectId*
UUID (uuid)
You can specify an individual project by appending the projectId to the endpoint
Required
Header parameters
Name Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required

getProjectUsers

Retrieves a list of all project users

Allows you to retrieve the users on a projects.


/ProjectsUsers

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
page = 1
page_size = 100

begin
  response = xero_client.accounting_api.get_project_users(xero_tenant_id, page, page_size)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_project_users: #{e}"
end

Scopes

projects Grant read-write access to projects
projects.read Grant read-only access to projects

Parameters

Header parameters
Name Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Query parameters
Name Description
page
Integer
set to 1 by default. The requested number of the page in paged response - Must be a number greater than 0.
pageSize
Integer
Optional, it is set to 50 by default. The number of items to return per page in a paged response - Must be a number between 1 and 500.

getProjects

Retrieves all projects

Allows you to retrieve, create and update projects.


/Projects

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
project_ids = []
contact_id = '38400000-8cf0-11bd-b23e-10b96e4ef00d'
states = 'states_example'
page = 1
page_size = 100

begin
  response = xero_client.accounting_api.get_projects(xero_tenant_id, project_ids, contact_id, states, page, page_size)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_projects: #{e}"
end

Scopes

projects Grant read-write access to projects
projects.read Grant read-only access to projects

Parameters

Header parameters
Name Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Query parameters
Name Description
projectIds
array[UUID] (uuid)
Search for all projects that match a comma separated list of projectIds
contactID
UUID (uuid)
Filter for projects for a specific contact
states
String
Filter for projects in a particular state (INPROGRESS or CLOSED)
page
Integer
set to 1 by default. The requested number of the page in paged response - Must be a number greater than 0.
pageSize
Integer
Optional, it is set to 50 by default. The number of items to return per page in a paged response - Must be a number between 1 and 500.

getTask

Retrieves a single project task

Allows you to retrieve a specific project


/Projects/{projectId}/Tasks/{taskId}

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
project_id = '38400000-8cf0-11bd-b23e-10b96e4ef00d'
task_id = '38400000-8cf0-11bd-b23e-10b96e4ef00d'

begin
  response = xero_client.accounting_api.get_task(xero_tenant_id, project_id, task_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_task: #{e}"
end

Scopes

projects Grant read-write access to projects
projects.read Grant read-only access to projects

Parameters

Path parameters
Name Description
projectId*
UUID (uuid)
You can specify an individual project by appending the projectId to the endpoint
Required
taskId*
UUID (uuid)
You can specify an individual task by appending the taskId to the endpoint, i.e. GET https://.../tasks/{taskID}
Required
Header parameters
Name Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required

getTasks

Retrieves all project tasks

Allows you to retrieve a specific project


/Projects/{projectId}/Tasks

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
project_id = '38400000-8cf0-11bd-b23e-10b96e4ef00d'
page = 1
page_size = 10
task_ids = 'taskIds_example'
charge_type = 

begin
  response = xero_client.accounting_api.get_tasks(xero_tenant_id, project_id, page, page_size, task_ids, charge_type)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_tasks: #{e}"
end

Scopes

projects Grant read-write access to projects
projects.read Grant read-only access to projects

Parameters

Path parameters
Name Description
projectId*
UUID (uuid)
You can specify an individual project by appending the projectId to the endpoint
Required
Header parameters
Name Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Query parameters
Name Description
page
Integer
Set to 1 by default. The requested number of the page in paged response - Must be a number greater than 0.
pageSize
Integer
Optional, it is set to 50 by default. The number of items to return per page in a paged response - Must be a number between 1 and 500.
taskIds
String
Search for all tasks that match a comma separated list of taskIds, i.e. GET https://.../tasks?taskIds={taskID},{taskID}
chargeType
ChargeType

getTimeEntries

Retrieves all time entries associated with a specific project

Allows you to retrieve the time entries associated with a specific project


/Projects/{projectId}/Time

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
project_id = '38400000-8cf0-11bd-b23e-10b96e4ef00d'
user_id = '38400000-8cf0-11bd-b23e-10b96e4ef00d'
task_id = '38400000-8cf0-11bd-b23e-10b96e4ef00d'
invoice_id = '38400000-8cf0-11bd-b23e-10b96e4ef00d'
contact_id = '38400000-8cf0-11bd-b23e-10b96e4ef00d'
page = 1
page_size = 10
states = []
is_chargeable = true
date_after_utc = "2013-10-20T19:20:30+01:00"
date_before_utc = "2013-10-20T19:20:30+01:00"

begin
  response = xero_client.accounting_api.get_time_entries(xero_tenant_id, project_id, user_id, task_id, invoice_id, contact_id, page, page_size, states, is_chargeable, date_after_utc, date_before_utc)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_time_entries: #{e}"
end

Scopes

projects Grant read-write access to projects
projects.read Grant read-only access to projects

Parameters

Path parameters
Name Description
projectId*
UUID (uuid)
Identifier of the project, that the task (which the time entry is logged against) belongs to.
Required
Header parameters
Name Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Query parameters
Name Description
userId
UUID (uuid)
The xero user identifier of the person who logged time.
taskId
UUID (uuid)
Identifier of the task that time entry is logged against.
invoiceId
UUID (uuid)
Finds all time entries for this invoice.
contactId
UUID (uuid)
Finds all time entries for this contact identifier.
page
Integer
Set to 1 by default. The requested number of the page in paged response - Must be a number greater than 0.
pageSize
Integer
Optional, it is set to 50 by default. The number of items to return per page in a paged response - Must be a number between 1 and 500.
states
array[String]
Comma-separated list of states to find. Will find all time entries that are in the status of whatever is specified.
isChargeable
Boolean
Finds all time entries which relate to tasks with the charge type TIME or FIXED.
dateAfterUtc
Date (date-time)
ISO 8601 UTC date. Finds all time entries on or after this date filtered on the dateUtc field.
dateBeforeUtc
Date (date-time)
ISO 8601 UTC date. Finds all time entries on or before this date filtered on the dateUtc field.

getTimeEntry

Retrieves a single time entry for a specific project

Allows you to get a single time entry in a project


/Projects/{projectId}/Time/{timeEntryId}

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
project_id = '38400000-8cf0-11bd-b23e-10b96e4ef00d'
time_entry_id = '38400000-8cf0-11bd-b23e-10b96e4ef00d'

begin
  response = xero_client.accounting_api.get_time_entry(xero_tenant_id, project_id, time_entry_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_time_entry: #{e}"
end

Scopes

projects Grant read-write access to projects
projects.read Grant read-only access to projects

Parameters

Path parameters
Name Description
projectId*
UUID (uuid)
You can specify an individual project by appending the projectId to the endpoint
Required
timeEntryId*
UUID (uuid)
You can specify an individual time entry by appending the id to the endpoint
Required
Header parameters
Name Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required

patchProject

creates a project for the specified contact

Allows you to update a specific projects.


/Projects/{projectId}

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
project_id = '38400000-8cf0-11bd-b23e-10b96e4ef00d'
idempotency_key = 'KEY_VALUE'

begin
  response = xero_client.accounting_api.patch_project(xero_tenant_id, project_id, projectPatch, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling patch_project: #{e}"
end

Scopes

projects Grant read-write access to projects

Parameters

Path parameters
Name Description
projectId*
UUID (uuid)
You can specify an individual project by appending the projectId to the endpoint
Required
Header parameters
Name Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
projectPatch *
ProjectPatch
Update the status of an existing Project
Required

updateProject

Updates a specific project

Allows you to update a specific projects.


/Projects/{projectId}

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
project_id = '38400000-8cf0-11bd-b23e-10b96e4ef00d'
idempotency_key = 'KEY_VALUE'

begin
  response = xero_client.accounting_api.update_project(xero_tenant_id, project_id, projectCreateOrUpdate, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling update_project: #{e}"
end

Scopes

projects Grant read-write access to projects

Parameters

Path parameters
Name Description
projectId*
UUID (uuid)
You can specify an individual project by appending the projectId to the endpoint
Required
Header parameters
Name Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
projectCreateOrUpdate *
ProjectCreateOrUpdate
Request of type ProjectCreateOrUpdate
Required

updateTask

Allows you to update a task

Allows you to update a specific task


/Projects/{projectId}/Tasks/{taskId}

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
project_id = '38400000-8cf0-11bd-b23e-10b96e4ef00d'
task_id = '38400000-8cf0-11bd-b23e-10b96e4ef00d'
idempotency_key = 'KEY_VALUE'

begin
  response = xero_client.accounting_api.update_task(xero_tenant_id, project_id, task_id, taskCreateOrUpdate, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling update_task: #{e}"
end

Scopes

projects Grant read-write access to projects

Parameters

Path parameters
Name Description
projectId*
UUID (uuid)
You can specify an individual project by appending the projectId to the endpoint
Required
taskId*
UUID (uuid)
You can specify an individual task by appending the id to the endpoint
Required
Header parameters
Name Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
taskCreateOrUpdate *
TaskCreateOrUpdate
The task object you are updating
Required

updateTimeEntry

Updates a time entry for a specific project

Allows you to update time entry in a project


/Projects/{projectId}/Time/{timeEntryId}

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
project_id = '38400000-8cf0-11bd-b23e-10b96e4ef00d'
time_entry_id = '38400000-8cf0-11bd-b23e-10b96e4ef00d'
idempotency_key = 'KEY_VALUE'

begin
  response = xero_client.accounting_api.update_time_entry(xero_tenant_id, project_id, time_entry_id, timeEntryCreateOrUpdate, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling update_time_entry: #{e}"
end

Scopes

projects Grant read-write access to projects

Parameters

Path parameters
Name Description
projectId*
UUID (uuid)
You can specify an individual project by appending the projectId to the endpoint
Required
timeEntryId*
UUID (uuid)
You can specify an individual time entry by appending the id to the endpoint
Required
Header parameters
Name Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
timeEntryCreateOrUpdate *
TimeEntryCreateOrUpdate
The time entry object you are updating
Required