Solved

Updating Purchase Order via REST API

  • 4 November 2023
  • 3 replies
  • 162 views

Userlevel 3
Badge

Hi Everyone 

 

I’m having an issue updating a purchase Order in Acumatica by using Rest API,

 

So my process is to create a purchase Order skeleton by entering

OrderNbr

Vendor

Owner

Description

in the next step I add line items to that existing purchase Order  using OrderNbr (Not Auto-generated)

 

 

1 Step - Create Purchase Order PUT /purchaseOrder

 

 

 

2 Step - Add line items to the existing Purchase Order 

 

  "exceptionMessage": "Operation failed",
 "exceptionMessage": "Another process has added the 'POOrder' record. Your changes will be lost.",


Request :


{
  "OrderNbr": {
    "value": "PPO-00007"
  },
  "VendorID": {
    "value": "VD000001"
  },
  "Description": {
    "value": "DummyDescription"
  },
  "Date": {
    "value": "2000-01-01"
  },
  "Location": {
    "value": "DUMMYLOC"
  },
  "ShipToAddress": {
    "AddressLine1": {
      "value": "123 Dummy St"
    },
    "AddressLine2": {
      "value": "Suite 100"
    },
    "City": {
      "value": "Dummyville"
    },
    "Country": {
      "value": "XX"
    },
    "PostalCode": {
      "value": "00000"
    },
    "Validated": {
      "value": "false"
    }
  },
  "ShipToContact": {
    "BusinessName": {
      "value": "Dummy Business Inc."
    },
    "Phone1": {
      "value": "(000) 000-0000"
    }
  },
  "Details": [
    {
      "LineNbr": {
        "value": "1"
      },
      "LineDescription": {
        "value": "Dummy Line Description"
      },
      "UOM": {
        "value": "Unit"
      },
      "OrderQty": {
        "value": 0
      },
      "UnitCost": {
        "value": 0
      },
      "ExtendedCost": {
        "value": 0
      },
      "Project": {
        "value": "DUMMYPROJ"
      },
      "ProjectTask": {
        "value": "DUMMYTASK"
      },
      "BranchID": {
        "value": "DB"
      },
      "Account": {
        "value": "00000"
      },
      "Subaccount": {
        "value": "DUMMYSUB"
      },
      "InventoryID": {
        "value": "DUMMYINV"
      },
      "Promised": {
        "value": "2000-01-01"
      },
      "Requested": {
        "value": "2000-01-01"
      },
      "WarehouseID": {
        "value": "DUMMYWARE"
      },
      "VendorRef": {
        "value": "00000000"
      }
    }
  ]
}

 

 

 

 

Thank you  

 

 

 

 

icon

Best answer by Driss 5 November 2023, 13:50

View original

3 replies

Userlevel 6
Badge +5

So you are creating the PO in the UI and then using the API to try and add a line?

 

You may just need to include the Order Type(it is part of the key along with the Order Nbr field). 

Userlevel 3
Badge

@markusray17 Hey No i’m creating the PO via Rest API and adding line items to via REST API as well 

Userlevel 3
Badge

@markusray17 The issue is Fixed instead of updating PO with OrderNBr.value it should be update with id (id will be returned once the PO is created)

 

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved