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.
Call through Alter
Section titled “Call through Alter”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 osfrom alter_sdk import Appfrom 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()| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
headers | object | Required within parent | Additional keys: not allowed |
headers.xero-tenant-id | string | Required within parent | |
headers.Idempotency-Key | string | Optional | |
body | Model | Required within parent | Expand Updates a specific project — request body — body |
Referenced models: Updates a specific project — request body — body
Response
Section titled “Response”Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | Model | Root | Expand Retrieves a single project — response body |
Referenced models: Retrieves a single project — response body
Schemas
Section titled “Schemas”Retrieves a single project — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
contactId | string | Optional | Identifier of the contact this project was created for. Format: uuid |
creditNoteAmount | Model | Optional | Expand Allows you to create a task — response body — rate |
currencyCode | Model | Optional | Expand Retrieves a single project — response body — currency Code |
deadlineUtc | string | Optional | Deadline for the project. UTC Date Time in ISO-8601 format. Format: date-time |
deposit | Model | Optional | Expand Allows you to create a task — response body — rate |
depositApplied | Model | Optional | Expand Allows you to create a task — response body — rate |
estimate | Model | Optional | Expand Allows you to create a task — response body — rate |
estimateAmount | Model | Optional | Expand Allows you to create a task — response body — rate |
expenseAmountInvoiced | Model | Optional | Expand Allows you to create a task — response body — rate |
expenseAmountToBeInvoiced | Model | Optional | Expand Allows you to create a task — response body — rate |
minutesLogged | JSON | Optional | |
minutesLogged (anyOf 1) | integer | Alternative | A total of minutes logged against all tasks on the Project. |
minutesLogged (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
minutesToBeInvoiced | JSON | Optional | |
minutesToBeInvoiced (anyOf 1) | integer | Alternative | Minutes which have not been invoiced across all chargeable tasks in the project. |
minutesToBeInvoiced (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
name | string | Required within parent | Name of the project. |
projectAmountInvoiced | Model | Optional | Expand Allows you to create a task — response body — rate |
projectId | string | Optional | Identifier of the project. Format: uuid |
status | string | Optional | Status for project Known values: INPROGRESS, CLOSED |
taskAmountInvoiced | Model | Optional | Expand Allows you to create a task — response body — rate |
taskAmountToBeInvoiced | Model | Optional | Expand Allows you to create a task — response body — rate |
totalExpenseAmount | Model | Optional | Expand Allows you to create a task — response body — rate |
totalInvoiced | Model | Optional | Expand Allows you to create a task — response body — rate |
totalTaskAmount | Model | Optional | Expand Allows you to create a task — response body — rate |
totalToBeInvoiced | Model | Optional | Expand 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
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
contactId | string | Optional | Identifier of the contact this project was created for. Format: uuid |
deadlineUtc | string | Optional | Deadline for the project. UTC Date Time in ISO-8601 format. Format: date-time |
estimateAmount | number | Optional | Format: double |
name | string | Required within parent | Name of the project. |
Allows you to create a task — response body — rate
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
currency | Model | Optional | Expand Retrieves a single project — response body — currency Code |
value | JSON | Optional | |
value (anyOf 1) | number | Alternative | Format: double |
value (anyOf 2) | string | Alternative | Pattern: ^-?[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
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | string | Root | 3 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 |
Policy, approvals and errors
Section titled “Policy, approvals and errors”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.