BatchPayments
Query and insert BatchPayments for a Xero organisation.
Table Specific Information
The BatchPayments table allows you to SELECT and INSERT batch payments for a Xero organization. The Id column is generated by the driver this value combines the index of the individual payment within the batch with the unique, Xero-generated BatchPaymentId
SELECT
The Xero API allows extensive filtering and ordering. You can define WHERE and ORDER BY clauses in a query to filter and order the results using any non-line-item column.
Note: The Xero API does not support filtering on line items or journal lines.
INSERT
To insert a single row, set the required fields. A new table object is created as a single entry. To create a new batch payment, the AccountId, Date and Reference are required in addition to at least one payment item; the Payment_InvoiceId and Payment_Amount fields are required to insert a payment item.
You can also provide multiple payments using an XML aggregate which contains the data for each payment in the batch.
Please refer to the Xero API documentation for more details on what elements are supported within each payment entry.
INSERT INTO BatchPayments (AccountId, Reference, Date, PaymentAggregate) VALUES (
'AAAAA-AAAAA-AAAAA-AAAAA',
'2019-03-01',
'<Payment>
<Invoice>
<InvoiceID>5aa9451d-95d1-4f95-a966-bbab2573f71c</InvoiceID>
<HasErrors>false</HasErrors>
<IsDiscounted>false</IsDiscounted>
</Invoice>
<PaymentID>a22a64cb-364e-43fa-9a1f-bb2cd1f4adde</PaymentID>
<Reference>ref/cheque</Reference>
<Amount>913.55</Amount>
</Payment>
<Payment>
...
</Payment>'
)
Columns
Name | Type | ReadOnly | Description |
Id [KEY] | String | True |
The batch payment index combined with the Id of the batch payment. |
BatchPaymentId | String | True |
The Id of the invoice. This field is assigned by Xero. |
AccountId | String | False |
The ID of the account used to make the payment. It must either be a BANK account or have payments enabled. |
Particulars | String | False |
(NZ only) The particulars that will appear on the statement. |
Code | String | False |
(NZ only) The transaction code that will appear on the statement. |
Reference | String | False |
(NZ only) The transaction reference that will appear on the statement. |
Details | String | False |
(Non-NZ only) The details sent to the organization's bank as a reference for the bank transaction. |
Narrative | String | False |
(UK only) A description that is only visible in the Xero statement line |
Date | Date | False |
The date the payment is being made. |
Payment_PaymentId | String | True |
The ID of the Payment. This field is assigned by Xero. |
Payment_InvoiceId | String | False |
The ID of the Invoice the payment was made against |
Payment_BankAccountNumber | String | False |
The account number of the bank the payment is being made to. |
Payment_Particulars | String | False |
(NZ only) The particulars that will appear on the statement. |
Payment_Code | String | False |
(NZ only) The transaction code that will appear on the supplier's bank account. |
Payment_Reference | String | False |
(NZ only) The transaction reference that will appear on the supplier's bank account. |
Payment_Details | String | False |
The details sent to the supplier's bank as a reference for the bank transaction. |
Payment_Amount | Decimal | False |
The amount being paid. |
PaymentAggregate | String | False |
Used to define Payment rows using XML values. Should be provided on INSERT only. |
Type | String | True |
Either PAYBATCH for bill payments, or RECBATCH for sales payments. |
Status | String | True |
Either AUTHORISED or DELETED |
TotalAmount | Decimal | True |
The total of all the payments included in the batch |
IsReconciled | Boolean | True |
Whether the batch payment has been reconciled |
UpdatedDateUTC | Datetime | True |
The date when the batch payment was last updated. |
TenantId | String | False |
The ID of the tenant to query instead of the connection tenant |