INVENTORY ITEMS posted but could not list the posted items in get inventory/item

1 REPLY
MYOB Staff Post DeveloperJack
107 Posts
MYOB Staff Post
Australia
DeveloperJack
MYOB Staff Post

107Posts

27Kudos

14Solutions

Re: INVENTORY ITEMS posted but could not list the posted items in get inventory/item

Hi there @Surendra,

The first error message here suggests that it's expecting an Account to be linked to the item in order to sell it in an invoice - that would be the income account for the Item.

If that doesn't fix it - could you get these details and your updated error messages through to developers@myob.com and we'll see what we can do for you.

Cheers,

Jack

Jack Skinner
MYOBapi Evangelist

Are you a developer? Check out http://developer.myob.com
Looking for an Add-on? Check out http://myob.com/addons/
Partner Surendra
1 Post
Partner
Surendra
Partner

1Posts

0Kudos

0Solutions

INVENTORY ITEMS posted but could not list the posted items in get inventory/item

Hi Team,

 
I have posted a inventory item and got the success response, but i could not get this items list by 'Get' method with inventory/item endpoint, it is showing epty list.
Though i tried posting an invoice item with item UID received in from the inventory post response, but giving the errors. Please find the following Inventory item and Invoice item post responses.
 
Kindly help me on the following issues:
1.why i could not get the posted inventory items list by inventory get method
2.How to resolve the invoice item post error business line account required.
 
For your refernce :
  
Inventory/Item Post :
 
Headers:
Array
(
    [0] => Authorization: Bearer xxxxx
    [1] => x-myobapi-key: xxxxx
    [2] => x-myobapi-version: v2
    [3] => Content-Type: application/json
    [4] => x-myobapi-cftoken: xxxxx
    [5] => Content-Length: 325
)
Json input:
{"Number":"2","Name":"Cooler","IsActive":true,"Description":"description posted to the API","QuantityOnHand":1330,"QuantityAvailable":1330,"AverageCost":45.3924,"CurrentValue":6037.19,"BaseSellingPrice":67.95,"IsBought":false,"IsSold":false,"IsInventoried":false,"AssetAccount":{"UID":"1ab9213e-39a7-4a6b-910f-53f5395925f7"}}
Response :
HTTP/1.1 201 Created
Cache-Control: no-cache
Date: Thu, 11 Jan 2018 01:27:00 GMT
Expires: -1
Location: /Inventory/Item
Pragma: no-cache
Server: Microsoft-IIS/8.0
X-AspNet-Version: 4.0.30319
X-Mashery-Message-ID: 81642a9d-cd3e-43da-9d16-68e1390c8e23
X-Mashery-Responder: prod-j-worker-ap-southeast-2b-23.mashery.com
x-myobapi-elapsed: 3407
x-myobapi-requestid: 8c3955b7-00c0-41cf-bfdd-b7f0ede675ac
X-Powered-By: ASP.NET
Content-Length: 0
Connection: keep-alive
Inventory Item Get response:
stdClass Object
(
    [Items] => Array
        (
        )

    [NextPageLink] => 
    [Count] => 
)

Invoice Item post Input and Error:
Input:
array(
        'Date' => $currentDate->format('Y-m-d\TH:i:s'),
        'Customer' => array(
            'UID' => 'b231ea40-cc51-4536-998d-6b1e2e6618e4'
        ),
        'Lines' => array(
            array(
                'ShipQuantity' => 1,
                'Total' => 45.65,
                'Item' => array(
                    'UID' => '0d014817-cd40-49f8-b4e1-b4b79fe3d47f'
                ),
                'TaxCode' => array(
                    'UID' => '744e4776-1338-4a13-a2b3-4840f7bdf5e8'
                )
            )
        )        
    );
Response :
stdClass Object
(
    [Errors] => Array
        (
            [0] => stdClass Object
                (
                    [Name] => ValidationError
                    [Message] => BusinessLine_AccountRequired
                    [AdditionalDetails] => AccountIdSmiley SadSaleEventItemLine)
                    [ErrorCode] => 4237
                    [Severity] => Error
                )

            [1] => stdClass Object
                (
                    [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
)

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