Skip to content

Xero: Create one or more new projects

Xero projects.createProject: arguments, response, policy and SDK examples.

← Projects operations · Get started

Operation xero.projects_createproject

Provider route: POST /projects.xro/2.0/Projects. Alter supplies the connection’s credentials and routing.

Install @alter-ai/sdk @alter-ai/xero with npm, or alter-sdk-xero with pip. Supply your connected customer’s grant ID and the arguments described below.

import { App } from "@alter-ai/sdk";
import { XeroIntegration } from "@alter-ai/xero";
async function execute(input: Parameters<XeroIntegration["projects"]["createProject"]>[0]) {
const app = new App({ apiKey: process.env.ALTER_API_KEY! });
try {
const provider = new XeroIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! });
const call = await provider.projects.createProject(input);
const result = await call.wait();
return result.bodyJson();
} finally {
await app.close();
}
}
import os
from alter_sdk import App
from alter_sdk_xero import XeroIntegration
async def execute(arguments):
async with App(api_key=os.environ["ALTER_API_KEY"]) as app:
provider = XeroIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]})
call = await provider.projects.create_project(arguments)
result = await call.wait()
return result.body_json()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
headersobjectRequired within parentAdditional keys: not allowed
headers.xero-tenant-idstringRequired within parent
headers.Idempotency-KeystringOptional
bodyModelRequired within parentExpand Updates a specific project — request body — body

Referenced models: Updates a specific project — request body — body

Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.

FieldTypePresenceDescription and constraints
$ModelRootExpand Retrieves a single project — response body

Referenced models: Retrieves a single project — response body

Retrieves a single project — response body
FieldTypePresenceDescription and constraints
$objectRoot
contactIdstringOptionalIdentifier of the contact this project was created for.
Format: uuid
creditNoteAmountModelOptionalExpand Allows you to create a task — response body — rate
currencyCodeModelOptionalExpand Retrieves a single project — response body — currency Code
deadlineUtcstringOptionalDeadline for the project. UTC Date Time in ISO-8601 format.
Format: date-time
depositModelOptionalExpand Allows you to create a task — response body — rate
depositAppliedModelOptionalExpand Allows you to create a task — response body — rate
estimateModelOptionalExpand Allows you to create a task — response body — rate
estimateAmountModelOptionalExpand Allows you to create a task — response body — rate
expenseAmountInvoicedModelOptionalExpand Allows you to create a task — response body — rate
expenseAmountToBeInvoicedModelOptionalExpand Allows you to create a task — response body — rate
minutesLoggedJSONOptional
minutesLogged (anyOf 1)integerAlternativeA total of minutes logged against all tasks on the Project.
minutesLogged (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
minutesToBeInvoicedJSONOptional
minutesToBeInvoiced (anyOf 1)integerAlternativeMinutes which have not been invoiced across all chargeable tasks in the project.
minutesToBeInvoiced (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
namestringRequired within parentName of the project.
projectAmountInvoicedModelOptionalExpand Allows you to create a task — response body — rate
projectIdstringOptionalIdentifier of the project.
Format: uuid
statusstringOptionalStatus for project
Known values: INPROGRESS, CLOSED
taskAmountInvoicedModelOptionalExpand Allows you to create a task — response body — rate
taskAmountToBeInvoicedModelOptionalExpand Allows you to create a task — response body — rate
totalExpenseAmountModelOptionalExpand Allows you to create a task — response body — rate
totalInvoicedModelOptionalExpand Allows you to create a task — response body — rate
totalTaskAmountModelOptionalExpand Allows you to create a task — response body — rate
totalToBeInvoicedModelOptionalExpand Allows you to create a task — response body — rate

Referenced models: Allows you to create a task — response body — rate, Retrieves a single project — response body — currency Code

Updates a specific project — request body — body
FieldTypePresenceDescription and constraints
$objectRoot
contactIdstringOptionalIdentifier of the contact this project was created for.
Format: uuid
deadlineUtcstringOptionalDeadline for the project. UTC Date Time in ISO-8601 format.
Format: date-time
estimateAmountnumberOptionalFormat: double
namestringRequired within parentName of the project.
Allows you to create a task — response body — rate
FieldTypePresenceDescription and constraints
$objectRoot
currencyModelOptionalExpand Retrieves a single project — response body — currency Code
valueJSONOptional
value (anyOf 1)numberAlternativeFormat: double
value (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$

Referenced models: Retrieves a single project — response body — currency Code

Retrieves a single project — response body — currency Code
FieldTypePresenceDescription and constraints
$stringRoot3 letter alpha code for the ISO-4217 currency code, e.g. USD, AUD.
Known values: AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BTN, BWP, BYN, BZD, CAD, CDF, CHF, CLP, CNY, COP, CRC, CUC, CUP, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ERN, ETB, EUR, FJD, FKP, GBP, GEL, GGP, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, IMP, INR, IQD, IRR, ISK, JEP, JMD, JOD, JPY, KES, KGS, KHR, KMF, KPW, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MRU, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SDG, SEK, SGD, SHP, SLL, SOS, SPL, SRD, STN, SVC, SYP, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TVD, TWD, TZS, UAH, UGX, USD, UYU, UZS, VEF, VND, VUV, WST, XAF, XCD, XDR, XOF, XPF, YER, ZAR, ZMW, ZMK, ZWD

SDK function policy ID: xero.projects_createproject. Catalog operation: projects.createProject. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.

Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.

Official provider source

Report an issue with this page

Necessary

Required for sign-in, security, authorization, and remembering your choices.

Always active

Analytics

Helps us understand which product and documentation features are useful.

Performance diagnostics

Uses performance tracing and privacy-masked session replay to diagnose problems.

You can change these choices at any time from Cookie settings.