Forum Discussion

armh's avatar
armh
Contributing Partner
6 years ago

Purchase Order Type Mismatch

Hello,

 

We are having an issue where we have a Supplier setup as a 'ITEM' purchasing type.

 

However when any order is raised, when queried through the API, the PO is being returned on the service order endpoint.

 

our supplier:
https://ar1.api.myob.com/accountright/XXXXXXX/Contact/Supplier/ZZZZZZZ

 

 PrintedForm"CS Purchase Order"string
 PurchaseCommentnullstring
 PurchaseLayoutItemMYOB.AccountRight.SDK.Contracts.Version2.Contact.PurchaseLayoutType
 PurchaseOrderDeliveryNothingMYOB.AccountRight.SDK.Contracts.Version2.Sale.DocumentAction?
 ShippingMethodnullstring

 

The order returned
https://ar1.api.myob.com/accountright/XXXXXXX/Purchase/Order/Service/YYYYYY

 

We are attempting to integrate MYOB to our suppliers system, but to do so we need the inventory codes that are only available with an ITEM Purchase order line item payload.

 

Service type orders do not offer this.

 

Attached screenshot of the Order, shows that Items have been selected. Dispite this the order is still returned on the service endpoint

 

  • How are you querying it through the API?

     

    I have found (using the SDK) that if you use the Order endpoint to get all orders

    https://developer.myob.com/api/accountright/v2/purchase/order/

    an item order has an OrderType of 'Item'.

     

    If you use the Order/Item endpoint to get just item orders

    https://developer.myob.com/api/accountright/v2/purchase/order/order_item/

    all the orders say they have an OrderType of 'Service'.

    This appears to be a bug, but since you are only asking for Item Orders, just ignore it.

     

    Does that help?

     

    • armh's avatar
      armh
      Contributing Partner

      Hi John, Thanks for the reply.

       

      No, but it may confirm a bug.

       

      We arent interested in service orders, we need the item orders to access the inventory par numvers/item codes against each line item. This then gets passed on you our supplier where the matching part numbers are used to generate an invoice in their system.

       

      Because out 'item' type orders are returned on the service endpoint, this stuffs everything up, the service item model does not contain the inventory codes, just a narration, which cant be used with our supplier.

       

      Our workflow:

      - We are calling ite Item PO endpoint.

      - Supplieris setup as an "Item" template/type.

      - orders raised in myob are clearly of item type format (your prompted for inventory codes, the header of the form says "Purchases Edit Item")

      - Yet when we call the sdk, we get NO orders on the item endpoint, and all orders on the service endpoint.

       

      The po's should be returned on the items endpoint, but they arent.

       

      Either a data issue or a sdk/api bug.

      • John_Dinning's avatar
        John_Dinning
        Trusted User

        Hi armh,

         

        We only deal with item orders, and are getting the item orders by supplier using the item orders endpoint ok I believe.

        Although, as I said, they are marked as service orders which is no doubt a bug and may be related.

        I have also found that the Item Orders endpoint returns orders that have been converted to bills, which I don't think it should.

        I think the API code in this area needs reviewing.