Skip to content
Proud to collaborate with Microsoft for Startups

xero.linked-transactions.create-linked-transaction ​

Creates linked transactions (billable expenses)

Overview ​

PropertyValue
Workflow typeAtomic
LibraryApp-xero
Version1.0

Input Schema ​

FieldTypeRequiredDefaultDescription
base_urlstringYes—Xero API root, e.g. https://<host>/api
api_tokenstringNo—Bearer token; omit to use the workflow's token env var
xero_tenant_idstringYes—Xero identifier for Tenant
idempotency_keystringNo—This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
sourcetransactionidstringNo—Filter by the SourceTransactionID. Get all the linked transactions created from a particular ACCPAY invoice
sourcelineitemidstringNo—The line item identifier from the source transaction.
contactidstringNo—Filter by the combination of ContactID and Status. Get all the linked transactions that have been assigned to a particular customer and have a particular status e.g. GET /LinkedTransactions?ContactID=4bb34b03-3378-4bb2-a0ed-6345abf3224e&Status=APPROVED.
targettransactionidstringNo—Filter by the TargetTransactionID. Get all the linked transactions allocated to a particular ACCREC invoice
targetlineitemidstringNo—The line item identifier from the target transaction. It is possible to link multiple billable expenses to the same TargetLineItemID.
linkedtransactionidstringNo—The Xero identifier for an Linked Transaction e.g./LinkedTransactions/297c2dc5-cc47-4afd-8ec8-74990b8761e9
statusstringNo—Filter by the combination of ContactID and Status. Get all the linked transactions that have been assigned to a particular customer and have a particular status e.g. GET /LinkedTransactions?ContactID=4bb34b03-3378-4bb2-a0ed-6345abf3224e&Status=APPROVED.
typestringNo—This will always be BILLABLEEXPENSE. More types may be added in future.
updateddateutcstringNo—The last modified date in UTC format
sourcetransactiontypecodestringNo—The Type of the source tranasction. This will be ACCPAY if the linked transaction was created from an invoice and SPEND if it was created from a bank transaction.
validationerrorslistNo—Displays array of validation error messages from the API

Output Schema ​

FieldTypeRequiredDefaultDescription
base_urlstringYes—Xero API root, e.g. https://<host>/api
api_tokenstringNo—Bearer token; omit to use the workflow's token env var
xero_tenant_idstringYes—Xero identifier for Tenant
idempotency_keystringNo—This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
sourcetransactionidstringNo—Filter by the SourceTransactionID. Get all the linked transactions created from a particular ACCPAY invoice
sourcelineitemidstringNo—The line item identifier from the source transaction.
contactidstringNo—Filter by the combination of ContactID and Status. Get all the linked transactions that have been assigned to a particular customer and have a particular status e.g. GET /LinkedTransactions?ContactID=4bb34b03-3378-4bb2-a0ed-6345abf3224e&Status=APPROVED.
targettransactionidstringNo—Filter by the TargetTransactionID. Get all the linked transactions allocated to a particular ACCREC invoice
targetlineitemidstringNo—The line item identifier from the target transaction. It is possible to link multiple billable expenses to the same TargetLineItemID.
linkedtransactionidstringNo—The Xero identifier for an Linked Transaction e.g./LinkedTransactions/297c2dc5-cc47-4afd-8ec8-74990b8761e9
statusstringNo—Filter by the combination of ContactID and Status. Get all the linked transactions that have been assigned to a particular customer and have a particular status e.g. GET /LinkedTransactions?ContactID=4bb34b03-3378-4bb2-a0ed-6345abf3224e&Status=APPROVED.
typestringNo—This will always be BILLABLEEXPENSE. More types may be added in future.
updateddateutcstringNo—The last modified date in UTC format
sourcetransactiontypecodestringNo—The Type of the source tranasction. This will be ACCPAY if the linked transaction was created from an invoice and SPEND if it was created from a bank transaction.
validationerrorslistNo—Displays array of validation error messages from the API
status_codeintegerNo—HTTP status code of the completed call
responsejsonNo—Parsed JSON response body
failure_reasonstringNo——
failure_typestringNo——
failed_atstringNo——
failed_stepstringNo——
failed_layerstringNo——
failed_at_statestringNo——
errorstringNo——
error_typestringNo——

States ​

StateInitialTerminalSuccessAuto-advanceDescription
pendingYesNo—executeWaiting to call PUT /LinkedTransactions
completedNoYesYes—HTTP call succeeded
failedNoYesNo—HTTP call failed

State Diagram ​

Transitions ​

FromActionToDescription
pendingexecutecompletedPerform PUT /LinkedTransactions
* (any state)failfailedRecord the failure reason

Outcomes ​

OutcomeTypeDescriptionState Data Keys
completedSUCCESSThe provider accepted the requeststatus_code, response
failedFAILUREThe provider rejected the request or was unreachablefailure_reason, failure_type, status_code

Business Errors ​

CodeMessage Template
HTTP_AUTHENTICATION_FAILEDThe provider rejected the credential (HTTP {status_code})
HTTP_AUTHORIZATION_FAILEDThe credential is not permitted to perform this operation (HTTP {status_code})
HTTP_NOT_FOUNDThe provider has no resource at {path} (HTTP 404)
HTTP_RATE_LIMITEDThe provider rate-limited this request (HTTP 429)
HTTP_REQUEST_FAILEDThe provider returned HTTP {status_code} for {method}
HTTP_RESPONSE_SHAPE_UNEXPECTEDThe provider response for {method} {path} could not be parsed as JSON

API Usage ​

bash
POST /api/workflows/start
Content-Type: application/json

{
  "workflow_type": "xero.linked-transactions.create-linked-transaction",
  "initial_data": {
    "base_url": "value",
    "xero_tenant_id": "value"
  }
}