Skip to content
Proud to collaborate with Microsoft for Startups

xero.payments.create-payment ​

Creates a single payment for invoice or credit notes

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.
invoicejsonNo——
creditnotejsonNo——
prepaymentjsonNo——
overpaymentjsonNo——
invoicenumberstringNo—Number of invoice or credit note you are applying payment to e.g.INV-4003
creditnotenumberstringNo—Number of invoice or credit note you are applying payment to e.g. INV-4003
batchpaymentjsonNo——
accountjsonNo——
codestringNo—Code of account you are using to make the payment e.g. 001 (note- not all accounts have a code value)
datestringNo—Date the payment is being made (YYYY-MM-DD) e.g. 2009-09-06
currencyratefloatNo—Exchange rate when payment is received. Only used for non base currency invoices and credit notes e.g. 0.7500
amountfloatNo—The amount of the payment. Must be less than or equal to the outstanding amount owing on the invoice e.g. 200.00
bankamountfloatNo—The amount of the payment in the currency of the bank account.
referencestringNo—An optional description for the payment e.g. Direct Debit
isreconciledbooleanNo—An optional parameter for the payment. A boolean indicating whether you would like the payment to be created as reconciled when using PUT, or whether a payment has been reconciled when using GET
statusstringNo—The status of the payment.
paymenttypestringNo—See Payment Types.
updateddateutcstringNo—UTC timestamp of last update to the payment
updateddateutcstringstringNo—UTC ISO-8601 formatted timestamp of last update to the payment
paymentidstringNo—The Xero identifier for an Payment e.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9
batchpaymentidstringNo—Present if the payment was created as part of a batch.
bankaccountnumberstringNo—The suppliers bank account number the payment is being made to
particularsstringNo—The suppliers bank account number the payment is being made to
detailsstringNo—The information to appear on the supplier's bank account
hasaccountbooleanNo—A boolean to indicate if a contact has an validation errors
hasvalidationerrorsbooleanNo—A boolean to indicate if a contact has an validation errors
statusattributestringstringNo—A string to indicate if a invoice status
validationerrorslistNo—Displays array of validation error messages from the API
warningslistNo—Displays array of warning 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.
invoicejsonNo——
creditnotejsonNo——
prepaymentjsonNo——
overpaymentjsonNo——
invoicenumberstringNo—Number of invoice or credit note you are applying payment to e.g.INV-4003
creditnotenumberstringNo—Number of invoice or credit note you are applying payment to e.g. INV-4003
batchpaymentjsonNo——
accountjsonNo——
codestringNo—Code of account you are using to make the payment e.g. 001 (note- not all accounts have a code value)
datestringNo—Date the payment is being made (YYYY-MM-DD) e.g. 2009-09-06
currencyratefloatNo—Exchange rate when payment is received. Only used for non base currency invoices and credit notes e.g. 0.7500
amountfloatNo—The amount of the payment. Must be less than or equal to the outstanding amount owing on the invoice e.g. 200.00
bankamountfloatNo—The amount of the payment in the currency of the bank account.
referencestringNo—An optional description for the payment e.g. Direct Debit
isreconciledbooleanNo—An optional parameter for the payment. A boolean indicating whether you would like the payment to be created as reconciled when using PUT, or whether a payment has been reconciled when using GET
statusstringNo—The status of the payment.
paymenttypestringNo—See Payment Types.
updateddateutcstringNo—UTC timestamp of last update to the payment
updateddateutcstringstringNo—UTC ISO-8601 formatted timestamp of last update to the payment
paymentidstringNo—The Xero identifier for an Payment e.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9
batchpaymentidstringNo—Present if the payment was created as part of a batch.
bankaccountnumberstringNo—The suppliers bank account number the payment is being made to
particularsstringNo—The suppliers bank account number the payment is being made to
detailsstringNo—The information to appear on the supplier's bank account
hasaccountbooleanNo—A boolean to indicate if a contact has an validation errors
hasvalidationerrorsbooleanNo—A boolean to indicate if a contact has an validation errors
statusattributestringstringNo—A string to indicate if a invoice status
validationerrorslistNo—Displays array of validation error messages from the API
warningslistNo—Displays array of warning 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 POST /Payments
completedNoYesYes—HTTP call succeeded
failedNoYesNo—HTTP call failed

State Diagram ​

Transitions ​

FromActionToDescription
pendingexecutecompletedPerform POST /Payments
* (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.payments.create-payment",
  "initial_data": {
    "base_url": "value",
    "xero_tenant_id": "value"
  }
}