MYOBCommunity
Partner Zone
|
|
Partner Zone

Creating Invoice; Error codes 4237 & 4340

This thread is now closed to new comments.
Some of the links provided in this thread may no longer be available or relevant.
If you have a question please start a new post.
1 REPLY 1
Partner GriffNZ
4 Posts
Partner
GriffNZ
Partner

4Posts

1Kudos

1Solutions

Accepted Solution Solved Solution

Re: Creating Invoice; Error codes 4237 & 4340

SOLVED:

The error message was misleading; the fault seemed to have been with the linked Items in the Line objects; the Items were using an incorrect/incompatible tax code with regards to CostOfSalesAccount/IncomeAccount and BuyingDetails/SellingDetails.

 

If you encounter the same issue, check how you are setting TaxCode.UID for each of those 4 objects.

Highlighted
Partner GriffNZ
4 Posts
Partner
GriffNZ
Partner

4Posts

1Kudos

1Solutions

Solved: Go to Solution

Creating Invoice; Error codes 4237 & 4340

Request: (Don't panic; test data only)

{
	"Date": "2016-01-28T00:33:33+00:00",
	"Customer": {
		"SellingDetails": {},
		"LastName": "Davis",
		"FirstName": "Chris",
		"DisplayID": "201354",
		"Addresses": [{
			"Location": 1,
			"Street": "12 Barkley Street",
			"City": "St Kilda",
			"State": "Vic",
			"PostCode": "3024",
			"Phone1": "03 9567 3453",
			"Phone2": "03 9533 2256",
			"Website": "www.myob.com.au"
		}, {
			"Location": 2,
			"Street": "14 Charles Street",
			"City": "Brighton",
			"State": "Vic",
			"PostCode": "3170"
		}],
		"UID": "39d58d84-0488-4b8d-9119-38c94bb39aba"
	},
	"Lines": [{
		"Type": "Transaction",
		"ShipQuantity": "3.0000",
		"UnitPrice": "12.0000",
		"DiscountPercent": 0,
		"CostOfGoodsSold": "25.0000",
		"Total": 36,
		"Item": {
			"UID": "29730d48-4bd5-4720-a409-4d09021e579b"
		},
		"TaxCode": {
			"UID": "de12fa93-362b-4f40-bb32-88293f2ea6a2"
		}
	}, {
		"Number": "Geo-2016.01.27-11.58.01",
		"Type": "Transaction",
		"ShipQuantity": "1.0000",
		"UnitPrice": "12.0000",
		"DiscountPercent": 0,
		"CostOfGoodsSold": "25.0000",
		"Total": 12,
		"Item": {
			"UID": "cabd35be-8ae0-46ea-9d64-476e01b78e55"
		},
		"TaxCode": {
			"UID": "de12fa93-362b-4f40-bb32-88293f2ea6a2"
		}
	}]
}

 

Response:

{
	"Errors": [{
		"Name": "ValidationError",
		"Message": "BusinessLine_AccountRequired",
		"AdditionalDetails": "AccountIdSmiley SadSaleEventItemLine)",
		"ErrorCode": 4237,
		"Severity": "Error"
	}, {
		"Name": "ValidationError",
		"Message": "SaleEventLine_ItemSoldRequired",
		"AdditionalDetails": "ItemIdSmiley SadSaleEventItemLine)",
		"ErrorCode": 4340,
		"Severity": "Error"
	}],
	"Information": "Warning, error messages have not been finalised in this release and may change"
}

I've never used "Account" in the past and had working Invoices generated. Is their a particualr field that triggers this requirement?

Didn't find your answer here?
Try using advanced search to find a post more easily Advanced Search
or
Get the conversation started and make a new post Start a Post