Jump to content

Invoice Creation Errors


 Share

Recommended Posts

Hi,

Is there a list of returned error messages anywhere, that would reduce the need to post here to get answers?

I'm creating a sales invoice via the Business Cloud API, and am getting the following two responses:
 

severity=error
source=line_items.ledger_account
datacode=RecordInvalid
message=is invalid

and

severity=error
source=base
datacode=RecordInvalid
message=Invoice Address is required.

I don't have access to the accounts, at the moment, so I have to direct someone else's search. Is the following correct and a good basis for investigation?

1) The first error is that the ledger used for one (or more) line items isn't valid either for sales and/or the account it's being posted to? Are there any other potential situations where this may occur?

2) The second error is due to the account, the invoice is associated with, doesn't have a (default?) contact or the contact doesn't have an address? Again, are there any other situations that may give this error?

Many thanks.

Adam

Link to comment
Share on other sites

Hi Adam, thank you for your question.

 

We're working on improving the documentation around error handling at present and hope to be able to share this with you in the near future. At present, https://developer.sage.com/internal/accounting/guides/concepts/response_codes/ is the only reference to response errors that we currently have available.

 

When you say "I don't have access to the accounts" are you developing on a trial account rather than live?

1) You're correct the ledger account passed is not valid for the sale. This error could occur for any transaction where a ledger account is specified. For example, you could create a bank receipt and choose an expense ledger account or a bank payment for an income ledger account.

2) There are many rules relating to the use of contacts and addresses which differ from region to region, the type of sale being made(home, EU, Rest of world) or if the business is registered for VAT and the type of scheme they are registered for .

For UK businesses, the use of an address is mandatory if you're a UK VAT registered business selling to another VAT registered business. Specifying the contact_id is not sufficient to hydrate the address fields for sales/purchase artefacts, the address needs to be passed in the request when posting Sales artefacts. For UK businesses, sales_invoices and sales_credit_notes are the only requests that can potentially result with the error you are seeing.

Thanks

Mark

Link to comment
Share on other sites

Hi Mark,

Thanks for the response.

I'll look forward to seeing the error response documentation, I think it will be very useful.

The integration is in an application that's shipped to customers. We're getting these errors from a customer. The same export works okay on our test accounts set-up. So I'm trying to see if they have configuration issues, or if our code is not handling their situation correctly.

1) Thanks, that's what I was thinking. I think we/they need to check their ledgers, in both systems.

2) This is a surprise to me as we are creating sales invoices with just the contact_id specified and no main address passed through. We didn't see anything in the documentation to say that it was needed and it's worked in testing without it. I've just run a test export/create call and it's gone through okay. In all cases though, we've specified the contact_id of the main contact of the account. What we don't know, is if the customer has an address on this particular account - it's a slightly odd set-up with a non-entity account to take a very specific (slightly unusual) type of transaction. It's possible that they didn't give it an address because of this.

I'll get them to look into that and see how we get on.

Thanks again,

Adam

Link to comment
Share on other sites

Hi Adam

Apologies, you are correct.

If the address exists for the contact it will hydrate the sales_invoice address values. The response you are seeing occurs when an address isn't present for the contact and the business rules stipulate an address must be present for the transaction.

Thanks

Mark

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...