Xero: Updates a specific batch payment for invoices and credit notes — accounting delete Batch Payment
Xero accounting.deleteBatchPayment: arguments, response, policy and SDK examples.
← Accounting operations · Get started
Operation xero.deletebatchpayment
Provider route: POST /api.xro/2.0/BatchPayments. 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["accounting"]["deleteBatchPayment"]>[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.accounting.deleteBatchPayment(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.accounting.delete_batch_payment(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 batch payment for invoices and credit notes — accounting delete Batch Payment — request body — body |
Referenced models: Updates a specific batch payment for invoices and credit notes — accounting delete Batch Payment — 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 Creates one or many batch payments for invoices — response body |
Referenced models: Creates one or many batch payments for invoices — response body
Schemas
Section titled “Schemas”23 more schemas are linked from the tables above, on the schema pages.
Updates a specific batch payment for invoices and credit notes — accounting delete Batch Payment — request body — body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
BatchPaymentID | string | Required within parent | The Xero generated unique identifier for the bank transaction (read-only) Format: uuid |
Status | string | Required within parent | The status of the batch payment. Default: DELETED |
Creates one or many batch payments for invoices — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
BatchPayments | array | Optional | |
BatchPayments[] | Model | Each item | Expand Creates one or many batch payments for invoices — response body — Batch Payments item |
Referenced models: Creates one or many batch payments for invoices — response body — Batch Payments item
Creates one or many batch payments for invoices — response body — Batch Payments item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
Account | Model | Optional | Expand Deletes a chart of accounts — response body — Accounts item |
Amount | JSON | Optional | |
Amount (anyOf 1) | number | Alternative | The amount of the payment. Must be less than or equal to the outstanding amount owing on the invoice e.g. 200.00 Format: double |
Amount (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
BatchPaymentID | string | Optional | The Xero generated unique identifier for the bank transaction (read-only) Format: uuid Read only: true |
Code | string | Optional | (NZ Only) Optional references for the batch payment transaction. It will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement you import into Xero. Maximum length: 12 |
Date | string | Optional | Date the payment is being made (YYYY-MM-DD) e.g. 2009-09-06 |
DateString | string | Optional | Date the payment is being made (YYYY-MM-DD) e.g. 2009-09-06 |
Details | string | Optional | (Non-NZ Only) These details are sent to the org’s bank as a reference for the batch payment transaction. They will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement imported into Xero. Maximum field length = 18 |
IsReconciled | boolean | Optional | Booelan that tells you if the batch payment has been reconciled (read-only) Read only: true |
Narrative | string | Optional | (UK Only) Only shows on the statement line in Xero. Max length =18 Maximum length: 18 |
Particulars | string | Optional | (NZ Only) Optional references for the batch payment transaction. It will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement you import into Xero. Maximum length: 12 |
Payments | array | Optional | An array of payments |
Payments[] | Model | Each item | Expand Retrieves payments for invoices and credit notes — response body — Payments item |
Reference | string | Optional | (NZ Only) Optional references for the batch payment transaction. It will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement you import into Xero. Maximum length: 255 |
Status | string | Optional | AUTHORISED or DELETED (read-only). New batch payments will have a status of AUTHORISED. It is not possible to delete batch payments via the API. Known values: AUTHORISED, DELETED Read only: true |
TotalAmount | JSON | Optional | |
TotalAmount (anyOf 1) | number | Alternative | The total of the payments that make up the batch (read-only) Format: double Read only: true |
TotalAmount (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
Type | string | Optional | PAYBATCH for bill payments or RECBATCH for sales invoice payments (read-only) Known values: PAYBATCH, RECBATCH Read only: true |
UpdatedDateUTC | string | Optional | UTC timestamp of last update to the payment Read only: true |
ValidationErrors | array | Optional | Displays array of validation error messages from the API |
ValidationErrors[] | Model | Each item | Expand Retrieves journals — response body — Warnings item |
Referenced models: Deletes a chart of accounts — response body — Accounts item, Retrieves payments for invoices and credit notes — response body — Payments item, Retrieves journals — response body — Warnings item
Deletes a chart of accounts — response body — Accounts item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
AccountID | string | Optional | The Xero identifier for an account – specified as a string following the endpoint name e.g. /297c2dc5-cc47-4afd-8ec8-74990b8761e9 Format: uuid |
AddToWatchlist | boolean | Optional | Boolean – describes whether the account is shown in the watchlist widget on the dashboard |
BankAccountNumber | string | Optional | For bank accounts only (Account Type BANK) |
BankAccountType | string | Optional | For bank accounts only. See Bank Account types Known values: BANK, CREDITCARD, PAYPAL, NONE, "" (empty string) |
Class | string | Optional | See Account Class Types Known values: ASSET, EQUITY, EXPENSE, LIABILITY, REVENUE Read only: true |
Code | string | Optional | Customer defined alpha numeric account code e.g 200 or SALES (max length = 10) |
CurrencyCode | Model | Optional | Expand Deletes an Allocation from a Prepayment — response body — Invoice Currency Code |
Description | string | Optional | Description of the Account. Valid for all types of accounts except bank accounts (max length = 4000) |
EnablePaymentsToAccount | boolean | Optional | Boolean – describes whether account can have payments applied to it |
HasAttachments | boolean | Optional | boolean to indicate if an account has an attachment (read only) Default: false Read only: true |
Name | string | Optional | Name of account (max length = 150) Maximum length: 150 |
ReportingCode | string | Optional | Shown if set |
ReportingCodeName | string | Optional | Shown if set Read only: true |
ShowInExpenseClaims | boolean | Optional | Boolean – describes whether account code is available for use with expense claims |
Status | string | Optional | Accounts with a status of ACTIVE can be updated to ARCHIVED. See Account Status Codes Known values: ACTIVE, ARCHIVED, DELETED |
SystemAccount | string | Optional | If this is a system account then this element is returned. See System Account types. Note that non-system accounts may have this element set as either “” or null. Known values: DEBTORS, CREDITORS, BANKCURRENCYGAIN, GST, GSTONIMPORTS, HISTORICAL, REALISEDCURRENCYGAIN, RETAINEDEARNINGS, ROUNDING, TRACKINGTRANSFERS, UNPAIDEXPCLM, UNREALISEDCURRENCYGAIN, WAGEPAYABLES, CISASSETS, CISASSET, CISLABOUR, CISLABOUREXPENSE, CISLABOURINCOME, CISLIABILITY, CISMATERIALS, "" (empty string)Read only: true |
TaxType | string | Optional | The tax type from taxRates |
Type | string | Optional | See Account Types Known values: BANK, CURRENT, CURRLIAB, DEPRECIATN, DIRECTCOSTS, EQUITY, EXPENSE, FIXED, INVENTORY, LIABILITY, NONCURRENT, OTHERINCOME, OVERHEADS, PREPAYMENT, REVENUE, SALES, TERMLIAB, PAYG |
UpdatedDateUTC | string | Optional | Last modified date UTC format Read only: true |
ValidationErrors | array | Optional | Displays array of validation error messages from the API |
ValidationErrors[] | Model | Each item | Expand Retrieves journals — response body — Warnings item |
Referenced models: Deletes an Allocation from a Prepayment — response body — Invoice Currency Code, Retrieves journals — response body — Warnings item
Retrieves journals — response body — Warnings item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
Message | string | Optional | Validation error message |
Deletes an Allocation from a Prepayment — response body — Invoice Currency Code
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | string | Root | 3 letter alpha code for the currency – see list of currency codes 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, BYR, BZD, CAD, CDF, CHF, CLF, CLP, CNY, COP, CRC, CUC, CUP, CVE, CZK, DJF, DKK, DOP, DZD, EEK, EGP, ERN, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, INR, IQD, IRR, ISK, JMD, JOD, JPY, KES, KGS, KHR, KMF, KPW, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LTL, LVL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MRO, MRU, MUR, MVR, MWK, MXN, MXV, 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, SKK, SLE, SLL, SOS, SRD, STD, STN, SVC, SYP, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, UYU, UZS, VEF, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, YER, ZAR, ZMW, ZMK, ZWD |
Deletes an Allocation from a Prepayment — response body — Invoice Invoice Addresses item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
AddressLine1 | string | Optional | First line of a physical address |
AddressLine2 | string | Optional | Second line of a physical address |
AddressLine3 | string | Optional | Third line of a physical address |
AddressLine4 | string | Optional | Fourth line of a physical address |
City | string | Optional | City of a physical address |
Country | string | Optional | Country of a physical address |
InvoiceAddressType | string | Optional | Indicates whether the address is defined as origin (FROM) or destination (TO) Known values: FROM, TO |
PostalCode | string | Optional | Postal code of a physical address |
Region | string | Optional | Region or state of a physical address |
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: xero.deletebatchpayment. Catalog operation: deleteBatchPayment. 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.