XeroAPI/Xero-Java

Invoice creation failed because account removed

Opened this issue · 3 comments

Describe the bug
I am using the API to create invoices. The code has been working fine for several months. Today i am getting invoice creation failure because the account of the line item does not match a recognised account. When I make the transaction i get the following error:
54681395 10:37 07/08 XeroInvoiceMaker- line 462, returning invoice=class Invoice {
type: ACCREC
contact: class Contact {
contactID: b7a2de1c-dc58-47f4-ae60-70e1c9aa6c19
mergedToContactID: null
contactNumber: null
accountNumber: null
contactStatus: ACTIVE
name: HJS Plumbing
firstName: Jai
lastName: null
companyNumber: null
emailAddress:
skypeUserName: null
contactPersons: []
bankAccountDetails:
taxNumber: null
accountsReceivableTaxType: null
accountsPayableTaxType: null
addresses: [class Address {
addressType: STREET
addressLine1: 8 Wilray St
addressLine2: Grovedale
addressLine3: null
addressLine4: null
city:
region: VIC
postalCode: 3216
country:
attentionTo: null
}, class Address {
addressType: POBOX
addressLine1: null
addressLine2: null
addressLine3: null
addressLine4: null
city:region:
postalCode:
country:
attentionTo: null
}]
phones: [class Phone {
phoneType: DEFAULT
phoneNumber:
phoneAreaCode:
phoneCountryCode:
}, class Phone {
phoneType: DDI
phoneNumber:
phoneAreaCode:
phoneCountryCode:
}, class Phone {
phoneType: FAX
phoneNumber:
phoneAreaCode:
phoneCountryCode:
}, class Phone {
phoneType: MOBILE
phoneNumber:
phoneAreaCode:
phoneCountryCode:
}]
isSupplier: false
isCustomer: true
salesDefaultLineAmountType: null
purchasesDefaultLineAmountType: null
defaultCurrency: null
xeroNetworkKey: null
salesDefaultAccountCode: null
purchasesDefaultAccountCode: null
salesTrackingCategories: []
purchasesTrackingCategories: []
trackingCategoryName: null
trackingCategoryOption: null
paymentTerms: null
updatedDateUTC: /Date(1722991076663+0000)/
contactGroups: []
website: null
brandingTheme: null
batchPayments: null
discount: null
balances: null
attachments: []
hasAttachments: false
validationErrors: []
hasValidationErrors: false
statusAttributeString: null
}
lineItems: [class LineItem {
lineItemID: 0a1e5db1-17a5-4452-bf08-bb129149ea08
description: Mn/Tap/SK
quantity: 1.0
unitAmount: 12.0
itemCode: null
accountCode: null
accountID: null
taxType: OUTPUT
taxAmount: 1.2
lineAmount: 12.0
tracking: []
discountRate: null
discountAmount: null
repeatingInvoiceID: null
}, class LineItem {
lineItemID: a8cd94b4-b009-421b-8f78-21d4b92852c7
description: Freight
quantity: 1.0
unitAmount: 23.0
itemCode: null
accountCode: null
accountID: null
taxType: OUTPUT
taxAmount: 2.3
lineAmount: 23.0
tracking: []
discountRate: null
discountAmount: null
repeatingInvoiceID: null
}]
date: /Date(1722988800000+0000)/
dueDate: /Date(1722988800000+0000)/
lineAmountTypes: Exclusive
invoiceNumber: INV-05702
reference: A6020824
brandingThemeID: aefae6d5-7bbe-4e2e-aadc-302cd07a0fc1
url: null
currencyCode: AUD
currencyRate: 1.0
status: DRAFT
sentToContact: false
expectedPaymentDate: null
plannedPaymentDate: null
ciSDeduction: null
ciSRate: null
subTotal: 35.0
totalTax: 3.5
total: 38.5
totalDiscount: null
invoiceID: 12139299-971a-49f2-b688-a94544f9f64d
repeatingInvoiceID: null
hasAttachments: false
isDiscounted: false
payments: []
prepayments: []
overpayments: []
amountDue: 38.5
amountPaid: 0.0
fullyPaidOnDate: null
amountCredited: null
updatedDateUTC: /Date(1722991077547+0000)/
creditNotes: []
attachments: []
hasErrors: false
statusAttributeString: WARNING
validationErrors: []
warnings: [class ValidationError {
message: Account code '40010-12' has been removed as it does not match a recognised account.
}, class ValidationError {
message: Account code '60410' has been removed as it does not match a recognised account.
}]
}
the problem is that the accounts exist, i have verified them in Xero via the web, is just the api thinks they do not.

Would love some pointers as to why this is happening

PETOSS-508

Thanks for raising an issue, a ticket has been created to track your request

I'm not sure that this is an issue with the SDK, please can you raise a case with Xero Support here and include your app's client id and name and we can look into this further for you to confirm whether it is SDK-related or not