Updated: 17/3/2020 - Relax Item layout transaction PUT request for location required
We identified the occurrence of a number of validation errors due to mandatory location information on PUT requests for none-multi-location enabled item layout transactions post release of the multi-location feature.
Moving forward, a PUT request without location information via the online AccountRight API for Sale/Invoice/Item, Sale/Order/Item, Purchase/Bill/Item and Purchase/Order/Item endpoints
will be accepted if:
- Requested via the online AccountRight API for 2020.1 version or later.
- Multi-location is not enabled. (Only AccountRight Premier is the multi-location supported)
This change will be deployed for the local AccountRight API in the next product release.
WE are introducing the multi-location feature in the AccountRIght API. This change will result in:
1. A new endpoint of Inventory/Location to expose inventoried item location information(Read-only).
2. Exposing new location related properties in the Inventory/Item endpoint(Read-only).
3. 4 transactional item layout endpoints to allow location information to be tracked.
1. New Inventory/Location endpoint to return inventoried item location information.
This new endpoint allows the ability to view the location(s) list in an AccountiRight company file.
Sample GET JAON response: |
Inventory/Location |
{
"UID": "c3a3621a-9248-4344-abe7-9d2511ed5dfa", "Identifier": "MYOB", "Name": "MYOB Location", "IsActive": true, "CanSell": true, "Notes": "Location information cane be entered here", "Address": { "Location": 0, "Street": "Address infomration", "City": "Mel", "State": "VIC", "PostCode": "6101", "Country": "Australia", "Phone1": "11111111111111", "Phone2": null, "Phone3": null, "Fax": null, "Email": null, "Website": null, "ContactName": "111111111111111", "Salutation": null }, "URI": "http://localhost:8080/AccountRight/b17bdfae-8502-4fa7-8142-66f78327a4e9/Inventory/Location/c3a3621a-9248-4344-abe7-9d2511ed5dfa", "RowVersion": "2134706223373615104" } |
2. New Properties in the Inventory/Item endpoint to return inventoried item location information.
Exposing location information of each inventoried item.
+ LocationDetails []
+ Location {}
+ UID Guid(36) - Readonly
+ Identifier String(10) - Readonly
+ Name String(30) - Readonly
+ URI String - Readonly
+ QuantityOnHand Decimal(13.3) - Readonly
+ DefaultSellLocation
+ UID Guid(36) - Readonly
+ Identifier String(10) - Readonly
+ Name String(30) - Readonly
+ URI String - Readonly
+ DefaultReceiveLocation
+ UID Guid(36) - Readonly
+ Identifier String(10) - Readonly
+ Name String(30) - Readonly
+ URI String - Readonly
Sample GET JSON response: |
Inventory/Item |
{ "UID": "0dc71385-9c70-413e-94b8-4f7f7bd85b86", "Number": "Item1", "Name": "Bolt", "IsActive": true, "Description": "", "UseDescription": false, "CustomList1": null, "CustomList2": null, "CustomList3": null, "CustomField1": null, "CustomField2": null, "CustomField3": null, "QuantityOnHand": 50.0, "QuantityCommitted": 0.0, "QuantityOnOrder": 181.000000, "QuantityAvailable": 261.000000, "AverageCost": 0.843750, "CurrentValue": 67.500000, "BaseSellingPrice": 12.000000, "IsBought": true, "IsSold": true, "IsInventoried": true, "ExpenseAccount": null, "CostOfSalesAccount": { "UID": "c1ea286f-6792-4f25-b554-e2d4f3494bba", "Name": "Cost Of Sales", "DisplayID": "5-1000", "URI": "http://localhost:8080/AccountRight/e3caf419-c0a8-4c86-a7e6-1b333faf5820/GeneralLedger/Account/c1ea286f-6792-4f25-b554-e2d4f3494bba" }, "IncomeAccount": { "UID": "3cd5afd3-1e84-4b1e-a209-b9350ff7acdb", "Name": "Sales Income #1", "DisplayID": "4-1000", "URI": "http://localhost:8080/AccountRight/e3caf419-c0a8-4c86-a7e6-1b333faf5820/GeneralLedger/Account/3cd5afd3-1e84-4b1e-a209-b9350ff7acdb" }, "AssetAccount": { "UID": "de140d2d-b70b-498c-9dda-b28a5d1aeba8", "Name": "Inventory", "DisplayID": "1-1320", "URI": "http://localhost:8080/AccountRight/e3caf419-c0a8-4c86-a7e6-1b333faf5820/GeneralLedger/Account/de140d2d-b70b-498c-9dda-b28a5d1aeba8" }, "BuyingDetails": { "LastPurchasePrice": 0.000000, "StandardCost": 10.000000, "BuyingUnitOfMeasure": "", "ItemsPerBuyingUnit": 1.0, "TaxCode": { "UID": "d9695d80-4189-4c9e-a324-f82a500c73d2", "Code": "FRE", "URI": "http://localhost:8080/AccountRight/e3caf419-c0a8-4c86-a7e6-1b333faf5820/GeneralLedger/TaxCode/d9695d80-4189-4c9e-a324-f82a500c73d2" }, "RestockingInformation": { "MinimumLevelForRestockingAlert": 0.0, "Supplier": null, "SupplierItemNumber": null, "DefaultOrderQuantity": 0.0 } }, "SellingDetails": { "BaseSellingPrice": 12.000000, "SellingUnitOfMeasure": "", "ItemsPerSellingUnit": 1.0, "TaxCode": { "UID": "d9695d80-4189-4c9e-a324-f82a500c73d2", "Code": "FRE", "URI": "http://localhost:8080/AccountRight/e3caf419-c0a8-4c86-a7e6-1b333faf5820/GeneralLedger/TaxCode/d9695d80-4189-4c9e-a324-f82a500c73d2" }, "IsTaxInclusive": false, "CalculateSalesTaxOn": "ActualSellingPrice", "PriceMatrixURI": "http://localhost:8080/AccountRight/e3caf419-c0a8-4c86-a7e6-1b333faf5820/Inventory/ItemPriceMatrix/0dc71385-9c70-413e-94b8-4f7f7bd85b86" }, "LocationDetails": [ { "Location": { "UID": "fb310269-91b9-4a75-a722-4eeac732cc14", "Identifier": "Location1", "Name": "Primary Location", "URI": "http://localhost:8080/AccountRight/e3caf419-c0a8-4c86-a7e6-1b333faf5820/Inventory/Location/fb310269-91b9-4a75-a722-4eeac732cc14" }, "QuantityOnHand": 20.0 }, { "Location": { "UID": "c7f0a9cd-2a85-4a56-b4de-e74bac885c12", "Identifier": "Location2", "Name": "Melbourne", "URI": "http://localhost:8080/AccountRight/e3caf419-c0a8-4c86-a7e6-1b333faf5820/Inventory/Location/c7f0a9cd-2a85-4a56-b4de-e74bac885c12" }, "QuantityOnHand": 30.0 } ], "DefaultSellLocation": { "UID": "c7f0a9cd-2a85-4a56-b4de-e74bac885c12", "Identifier": "Location2", "Name": "Melbourne", "URI": "http://localhost:8080/AccountRight/e3caf419-c0a8-4c86-a7e6-1b333faf5820/Inventory/Location/c7f0a9cd-2a85-4a56-b4de-e74bac885c12" }, "DefaultReceiveLocation": { "UID": "c7f0a9cd-2a85-4a56-b4de-e74bac885c12", "Identifier": "Location2", "Name": "Melbourne", "URI": "http://localhost:8080/AccountRight/e3caf419-c0a8-4c86-a7e6-1b333faf5820/Inventory/Location/c7f0a9cd-2a85-4a56-b4de-e74bac885c12" }, "LastModified": "2019-12-05T01:40:47.213", "PhotoURI": null, "URI": "http://localhost:8080/AccountRight/e3caf419-c0a8-4c86-a7e6-1b333faf5820/Inventory/Item/0dc71385-9c70-413e-94b8-4f7f7bd85b86", "RowVersion": "-6396518845749657600" } |
3. Exposing new properties in Sale/Invoice/Item, Sale/Order/Item, Purchase/Bill/Item and
Purchase/Order/Item endpoints.
+ Location {}
+ UID Guid(36) - Mandatory for PUT
+ Identifier String(10) - Readonly
+ Name String(30) - Readonly
+ URI String - Readonly
This update allows location assigned to an item for each sale, order or bill transaction to be returned, and updated(GET and PUT). Creation and deletion(POST and DELETE) of these transactions can be actioned as per normal. Note the location UID is only mandatory for PUT requests.
Sample Codes:
Sample GET JSON response: | |
Sale/Invoice/Item | Sale/Order/Item |
{ |
{ "UID": "7f8b8b42-470e-48ff-b270-61216a9074d4", "Number": "00000014", "Date": "2020-02-03T00:00:00", "ShipToAddress": "Cash Sales", "CustomerPurchaseOrderNumber": "", "Customer": { "UID": "ca2f560c-ca79-43d3-b851-18541391f765", "Name": "Cash Sales", "DisplayID": "CUS000003", "URI": "http://localhost:8080/AccountRight/b17bdfae-8502-4fa7-8142-66f78327a4e9/Contact/Customer/ca2f560c-ca79-43d3-b851-18541391f765" }, "Terms": { "PaymentIsDue": "DayOfMonthAfterEOM", ・ ・ ・ "FinanceChargeForeign": null }, "IsTaxInclusive": true, "Lines": [ { "RowID": 1, ・ ・ ・ "TotalForeign": null, "Item": { "UID": "483c4908-64ab-43ed-8f2b-a317b6b05dea", "Number": "100", "Name": "Cooler Large", "URI": "http://localhost:8080/AccountRight/b17bdfae-8502-4fa7-8142-66f78327a4e9/Inventory/Item/483c4908-64ab-43ed-8f2b-a317b6b05dea" }, "Job": null, "TaxCode": { "UID": "62324ffa-0dd0-4429-bdb0-623289f1216d", "Code": "GST", "URI": "http://localhost:8080/AccountRight/b17bdfae-8502-4fa7-8142-66f78327a4e9/GeneralLedger/TaxCode/62324ffa-0dd0-4429-bdb0-623289f1216d" }, "Location": { "UID": "0d410810-9972-4f6c-93bb-3dab8d77d55e", "Identifier": "TEST2", "Name": "New Location", "URI": "http://localhost:8080/AccountRight/b17bdfae-8502-4fa7-8142-66f78327a4e9/Inventory/Location/0d410810-9972-4f6c-93bb-3dab8d77d55e" }, "RowVersion": "5449637024095010816" } ], "Subtotal": 2600.000000, ・ ・ ・ "FreightTaxCode": { "UID": "62324ffa-0dd0-4429-bdb0-623289f1216d", "Code": "GST", "URI": "http://localhost:8080/AccountRight/b17bdfae-8502-4fa7-8142-66f78327a4e9/GeneralLedger/TaxCode/62324ffa-0dd0-4429-bdb0-623289f1216d" }, "TotalTax": 236.360000, ・ ・ ・ "LastModified": "2020-02-03T03:17:27.35", "URI": "http://localhost:8080/AccountRight/b17bdfae-8502-4fa7-8142-66f78327a4e9/Sale/Order/Item/7f8b8b42-470e-48ff-b270-61216a9074d4", "RowVersion": "5233464241981227008" } |
Sample GET JSON response: | |
Purchase/Bill/Item | Purchase/Order/Item |
{ "UID": "0304532f-5479-4793-9aad-15184ac12f33", "Number": "00000070", "Date": "2019-10-15T00:00:00", "SupplierInvoiceNumber": "", "Supplier": { "UID": "5acccf79-92e1-44ad-b9c0-bfc19ecbf225", "Name": "Curbys Super Stands", "DisplayID": "SUPP000003", "URI": "http://localhost:8080/AccountRight/b17bdfae-8502-4fa7-8142-66f78327a4e9/Contact/Supplier/5acccf79-92e1-44ad-b9c0-bfc19ecbf225" }, "ShipToAddress": "Clearwater Pty. Ltd.\r\n25 Spring Street\r\nBlackburn\r\nVIC 3130", "Terms": { "PaymentIsDue": "DayOfMonthAfterEOM", ・ ・ ・ "DueDate": "2019-11-30T00:00:00" }, "IsTaxInclusive": true, "IsReportable": false, "Lines": [ { "RowID": 163, ・ ・ ・ "UnitPriceForeign": null, "TaxCode": { "UID": "62324ffa-0dd0-4429-bdb0-623289f1216d", "Code": "GST", "URI": "http://localhost:8080/AccountRight/b17bdfae-8502-4fa7-8142-66f78327a4e9/GeneralLedger/TaxCode/62324ffa-0dd0-4429-bdb0-623289f1216d" }, "DiscountPercent": 0.000000, "Item": { "UID": "9fcbfe85-de25-4db0-9926-8ea58020cb7d", "Number": "700", "Name": "Pine Stand", "URI": "http://localhost:8080/AccountRight/b17bdfae-8502-4fa7-8142-66f78327a4e9/Inventory/Item/9fcbfe85-de25-4db0-9926-8ea58020cb7d" }, "Account": null, "Location": { "UID": "5b854f1f-8921-4ad1-93ee-565b31790334", "Identifier": "Location1", "Name": "Primary Location", "URI": "http://localhost:8080/AccountRight/b17bdfae-8502-4fa7-8142-66f78327a4e9/Inventory/Location/5b854f1f-8921-4ad1-93ee-565b31790334" }, "RowVersion": "3056536772101013504" } ], "Subtotal": -966.500000, "SubtotalForeign": null, "Freight": 0.000000, "FreightForeign": null, "FreightTaxCode": { "UID": "62324ffa-0dd0-4429-bdb0-623289f1216d", "Code": "GST", "URI": "http://localhost:8080/AccountRight/b17bdfae-8502-4fa7-8142-66f78327a4e9/GeneralLedger/TaxCode/62324ffa-0dd0-4429-bdb0-623289f1216d" }, "TotalTax": -87.860000, ・ ・ ・ "CurrencyExchangeRate": null, "URI": "http://localhost:8080/AccountRight/b17bdfae-8502-4fa7-8142-66f78327a4e9/Purchase/Bill/Item/0304532f-5479-4793-9aad-15184ac12f33", "RowVersion": "5722386276527636480" } |
{ "UID": "1014c5bf-26e0-42da-9219-178f17951efc", "Number": "00000004", "Date": "2019-12-09T00:00:00", "SupplierInvoiceNumber": null, "Supplier": { "UID": "d84e42d0-0496-473a-bf62-6877725ac57c", "Name": "Supplier1", "DisplayID": "*None", "URI": "http://localhost:8080/AccountRight/e3caf419-c0a8-4c86-a7e6-1b333faf5820/Contact/Supplier/d84e42d0-0496-473a-bf62-6877725ac57c" }, "ShipToAddress": "Locations_Premier_AU\r\n", "Terms": { "PaymentIsDue": "DayOfMonthAfterEOM", ・ ・ ・ "DueDate": "2020-01-30T00:00:00" }, "IsTaxInclusive": false, "Lines": [ { "RowID": 8, ・ ・ ・ "TotalForeign": null, "Item": { "UID": "fa4df2a7-5199-4537-9ac3-58629d389c33", "Number": "Item2", "Name": "Item2 Locations Set", "URI": "http://localhost:8080/AccountRight/e3caf419-c0a8-4c86-a7e6-1b333faf5820/Inventory/Item/fa4df2a7-5199-4537-9ac3-58629d389c33" }, "Job": null, "TaxCode": { "UID": "43e54747-11a5-4b37-bcdf-b6d242845365", "Code": "ABN", "URI": "http://localhost:8080/AccountRight/e3caf419-c0a8-4c86-a7e6-1b333faf5820/GeneralLedger/TaxCode/43e54747-11a5-4b37-bcdf-b6d242845365" }, "Location": { "UID": "8e0875f2-064b-4efb-9706-344c2b557e45", "Identifier": "Location3", "Name": "Sydney", "URI": "http://localhost:8080/AccountRight/e3caf419-c0a8-4c86-a7e6-1b333faf5820/Inventory/Location/8e0875f2-064b-4efb-9706-344c2b557e45" }, "RowVersion": "3835940982612819968" } ], "IsReportable": false, ・ ・ ・ "FreightTaxCode": { "UID": "01370af2-cd80-4437-9784-5b11f5bc059e", "Code": "GST", "URI": "http://localhost:8080/AccountRight/e3caf419-c0a8-4c86-a7e6-1b333faf5820/GeneralLedger/TaxCode/01370af2-cd80-4437-9784-5b11f5bc059e" }, "TotalTax": -9.000000, ・ ・ ・ "CurrencyExchangeRate": null, "URI": "http://localhost:8080/AccountRight/e3caf419-c0a8-4c86-a7e6-1b333faf5820/Purchase/Order/Item/1014c5bf-26e0-42da-9219-178f17951efc", "RowVersion": "3619768200499036160" } |
Error Scenarios:
Scenario
|
Response
|
Status
|
---|---|---|
Trying to use Invalid Location UID | { "Name": "LocationNotFound", "Message": "Lines[0].Location.UID", "AdditionalDetails": "Lines[0].location is not a valid location", "ErrorCode": 3010, "Severity": "Error", "LearnMore": "http://developer.myob.com/api/accountright/api-overview/error-messages/?code=LocationNotFound&context=400" } |
400 Bad Request |
Trying to use Inactive Location |
{
"Name": "LocationIsInactive", "Message": "Lines[0].Location.UID", "AdditionalDetails": "Inactive location cannot be used at Lines[0].location", "ErrorCode": 3012, "Severity": "Error", "LearnMore": "http://developer.myob.com/api/accountright/api-overview/error-messages/?code=LocationIsInactive&context=400" } |
400 Bad Request |
Omitting Location for PUT operation of an Inventoried Item |
{ "Name": "Required", "Message": "Lines[0].Location.UID", "AdditionalDetails": "Lines[0].location must be specified for inventoried item", "ErrorCode": 100, "Severity": "Error", "LearnMore": "http://developer.myob.com/api/accountright/api-overview/error-messages/?code=Required&context=400" } |
400 Bad Request |
Trying to use a Location for a Non-Inventoried Item | { "Name": "LocationCannotBeAssignedToNonInventoriedItem", "Message": "Lines[0].Location.UID", "AdditionalDetails": "Lines[0].location must not be specified for non-inventoried item", "ErrorCode": 3011, "Severity": "Error", "LearnMore": "http://developer.myob.com/api/accountright/api-overview/error-messages/?code=LocationCannotBeAssignedToNonInventoriedItem&context=400" } |
400 Bad Request |
Trying to use a Location that has CanSell = false | { "Name": "CannotSellOrShipFromLocation", "Message": "Lines[0].Location.UID", "AdditionalDetails": "Items cannot be sold or shipped from this location: Lines[0].Location", "ErrorCode": 3013, "Severity": "Error", "LearnMore": "http://developer.myob.com/api/accountright/api-overview/error-messages/?code=CannotSellOrShipFromLocation&context=400" } |
400 Bad Request |
Comments
0 comments
Article is closed for comments.