Skip to main content
Solved

Updating Purchase Order via REST API


Driss
Jr Varsity III
Forum|alt.badge.img

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  

 

 

 

 

Best answer by Driss

@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)

 

View original
Did this topic help you find an answer to your question?

Forum|alt.badge.img+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). 


Driss
Jr Varsity III
Forum|alt.badge.img
  • Jr Varsity III
  • November 5, 2023

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


Driss
Jr Varsity III
Forum|alt.badge.img
  • Jr Varsity III
  • November 5, 2023

@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


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings