Update PurchaseOrder

Use this operation to update any of the writable fields of an existing PurchaseOrder object. The request body must include all writable fields of the existing object as returned in a read response. Writable fields omitted from the request body are set to NULL.

Parameters

Body Params
JSON:json
PurchaseOrder details needs to be passed as body parameter,it should be in JSON format.
XML:string
PurchaseOrder details needs to be passed as body parameter,it should be in XML format.
Path Params
yourCompany:string
The Company name need to passed in the base URL.For eg. if you enter xyzcompany name, the url https://{yourCompany}.agiliron.net/agiliron/api-40.php/PurchaseOrder will change to https://xyzcompany.agiliron.net/agiliron/api-40.php/PurchaseOrder
Header Params
Accept:string
Response header need to be passed for eg. application/json or application/xml.
Query Auth
key:string
API key needs to be passed in this variable.The option to enter API key will appear when you click on Try it button.This will be the first option in AUTHENTICATION block.Default is SET to 0.
Header Auth
apiKey:string
Dedicated API key needs to be passed in this variable via header.The option to enter API key will appear when you click on Try it button.This will be the second option in AUTHENTICATION block.Default is SET to 0.

Sample Code
NOTE: For PurchaseOrder Update ,

  • OrderNo field contains requisition no.
  • AgilironOrderNo field contains order no.
  • If AgilironOrderNo is not provided then purchaseorder update is done on basis of OrderNo i.e. requisition no and if it is provided then purchaseorder update is done on basis of order no.
{
  "POOrders": {
    "Order": [{
      "OrderNo": 15135,
      "AgilironOrderNo": 5698,
      "OrderDate": "01-24-2020 07:21:21",
      "ModifiedDate": "01-24-2020 07:21:21",
      "Subject": "Test New PurchaseOrder",
      "VendorName": "Vendor",
      "ContactFirstName": "",
      "ContactLastName": "",
      "Phone": "",
      "Fax": 2342131,
      "TrackingNo": 224433,
      "EmailAddress": "",
      "BillTo": "",
      "BillingStreet": "1234DoeSt.,Ste1234",
      "BillingCity": "Oakland",
      "BillingState": "CA",
      "BillingZipCode": 94601,
      "BillingCountry": "UnitedStates",
      "ShipToName": "Your Company",
      "ShippingStreet": "4567DoeCircle",
      "ShippingCity": "SanFrancisco",
      "ShippingState": "CA",
      "ShippingZipCode": 94104,
      "ShippingCountry": "UnitedStates",
      "OrderDiscount": "",
      "SubTotal": 270.43,
      "ShippingCost": "",
      "SalesTaxAuthority": "",
      "SalesTaxes": 24.25,
      "GrandTotal": 301.43,
      "DefaultCurrency": "USD",
      "ExchangeRate": 1,
      "Status": "Created,Invoiced,Shipped,Paid,Completed,",
      "PaymentLineItems": {
        "Payment": [
          {
            "PaymentMethod": "Cash",
            "PaymentAmount": 9,
            "PaymentDate": "01-20-2021",
            "CheckNumber": "",
            "CheckWriter": "",
            "CreditCardNumber": "",
            "CreditCardType": "",
            "CreditCardOwner": "",
            "CreditCardExpires": "MMYY",
            "CreditCardSecurityCode": "",
            "CreditCardAuthorization": "",
            "InvoiceNumber": "",
            "CustomerBankAccount": "",
            "PaymentEmailAddress": ""
          },
          {
            "PaymentMethod": "Check",
            "PaymentAmount": 11,
            "PaymentDate": "01-20-2021",
            "CheckNumber": "",
            "CheckWriter": "Test",
            "CreditCardNumber": "",
            "CreditCardType": "",
            "CreditCardOwner": "",
            "CreditCardExpires": "MMYY",
            "CreditCardSecurityCode": "",
            "CreditCardAuthorization": "",
            "InvoiceNumber": "",
            "CustomerBankAccount": "",
            "PaymentEmailAddress": ""
          }
        ]
      },
      "DueDate": "01-24-2020",
      "AssignedTo": "admin",
      "TermsAndConditions": "Prepaid",
      "Description": "Order notes goes here.",
      "Carrier": "",
      "ShippingMethod": "",
      "DeliverTo": "OAK",
      "ExportToQuickbooks": 0,
      "RelatedSalesOrders": "",
      "OrdersCustomFields": {
        "CustomField": [
          {
            "Name": "CustomFied1",
            "Value": "Custom info 1"
          },
          {
            "Name": "CustomFied2",
            "Value": "Custom info 2"
          }
        ]
      },
      "OrderDetails": {
        "OD": [
          {
            "ProductName": "Test New Product1",
            "ProductCode": "TNP1",
            "MatrixSKUCode": 0,
            "SerialNo": "",
            "ProductNotes": "Product notes goes here.",
            "ProductsQuantityReceived": 0,
            "ProductQty": 2,
            "ProductPrice": 15,
            "ProductDiscount": 0,
            "ProductTotal": 30,
            "VendorPartNumber": 4378403
          },
          {
            "ProductName": "Test New Product2",
            "ProductCode": "TNP2",
            "MatrixSKUCode": 0,
            "SerialNo": "",
            "ProductNotes": "Product notes goes here.",
            "ProductsQuantityReceived": 0,
            "ProductQty": 2,
            "ProductPrice": 5,
            "ProductDiscount": 0,
            "ProductTotal": 10,
            "VendorPartNumber": 4378403
          }
        ]
      }
    }]
  }
}
<POOrders>
    <Order>
        <OrderNo>15135</OrderNo>
        <AgilironOrderNo>5698</AgilironOrderNo>
        <OrderDate>01-24-2020 07:21:21</OrderDate>
        <ModifiedDate>01-24-2020 07:21:21</ModifiedDate>
        <Subject>Test New PurchaseOrder</Subject>
        <VendorName>Vendor</VendorName>
        <ContactFirstName></ContactFirstName>
        <ContactLastName></ContactLastName>
        <Phone></Phone>
      	<Fax>2342131</Fax>
      	<TrackingNo>224433</TrackingNo>
        <EmailAddress></EmailAddress>
        <BillTo></BillTo>
        <BillingStreet>1234DoeSt.,Ste1234</BillingStreet>
        <BillingCity>Oakland</BillingCity>
        <BillingState>CA</BillingState>
        <BillingZipCode>94601</BillingZipCode>
        <BillingCountry>UnitedStates</BillingCountry>
        <ShipToName>Your Company</ShipToName>
        <ShippingStreet>4567DoeCircle</ShippingStreet>
        <ShippingCity>SanFrancisco</ShippingCity>
        <ShippingState>CA</ShippingState>
        <ShippingZipCode>94104</ShippingZipCode>
        <ShippingCountry>UnitedStates</ShippingCountry>
        <OrderDiscount></OrderDiscount>
        <SubTotal>270.430</SubTotal>
        <ShippingCost></ShippingCost>
        <SalesTaxAuthority></SalesTaxAuthority>
        <SalesTaxes>24.250</SalesTaxes>
        <GrandTotal>301.430</GrandTotal>
        <DefaultCurrency>USD</DefaultCurrency>
        <ExchangeRate>1.00000</ExchangeRate>
        <Status>Created,Invoiced,Shipped,Paid,Completed,</Status>
        <PaymentLineItems>
            <Payment>
                <PaymentMethod>Cash</PaymentMethod>
                <PaymentAmount>9</PaymentAmount>
                <PaymentDate>01-20-2021</PaymentDate>
                <CheckNumber></CheckNumber>
                <CheckWriter></CheckWriter>
                <CreditCardNumber></CreditCardNumber>
                <CreditCardType></CreditCardType>
                <CreditCardOwner></CreditCardOwner>
                <CreditCardExpires>MMYY</CreditCardExpires>
                <CreditCardSecurityCode></CreditCardSecurityCode>
                <CreditCardAuthorization></CreditCardAuthorization>
                <InvoiceNumber></InvoiceNumber>
                <CustomerBankAccount></CustomerBankAccount>
              	<PaymentEmailAddress></PaymentEmailAddress>
            </Payment>
            <Payment>
                <PaymentMethod>Check</PaymentMethod>
                <PaymentAmount>11</PaymentAmount>
                <PaymentDate>01-20-2021</PaymentDate>
                <CheckNumber></CheckNumber>
                <CheckWriter>Test</CheckWriter>
                <CreditCardNumber></CreditCardNumber>
                <CreditCardType></CreditCardType>
                <CreditCardOwner></CreditCardOwner>
                <CreditCardExpires>MMYY</CreditCardExpires>
                <CreditCardSecurityCode></CreditCardSecurityCode>
                <CreditCardAuthorization></CreditCardAuthorization>
                <InvoiceNumber></InvoiceNumber>
                <CustomerBankAccount></CustomerBankAccount>
              	<PaymentEmailAddress></PaymentEmailAddress>
            </Payment>
        </PaymentLineItems>
        <DueDate>01-24-2020</DueDate>
        <AssignedTo>admin</AssignedTo>
        <TermsAndConditions>Prepaid</TermsAndConditions>
        <Description>Order notes goes here.</Description>
        <Carrier></Carrier>
        <ShippingMethod></ShippingMethod>
        <DeliverTo>OAK</DeliverTo>
        <ExportToQuickbooks>0</ExportToQuickbooks>
      	<RelatedSalesOrders></RelatedSalesOrders>
        <OrdersCustomFields>
            <CustomField>
                <Name>CustomFied1</Name>
                <Value>Custom info 1</Value>
            </CustomField>
            <CustomField>
                <Name>CustomFied2</Name>
                <Value>Custom info 2</Value>
            </CustomField>
        </OrdersCustomFields>
        <OrderDetails>
            <OD>
                <ProductName>Test New Product1</ProductName>
                <ProductCode>TNP1</ProductCode>
                <MatrixSKUCode>0</MatrixSKUCode>
                <SerialNo></SerialNo>
                <ProductNotes>Product notes goes here.</ProductNotes>
              	<ProductsQuantityReceived>0</ProductsQuantityReceived>
                <ProductQty>2</ProductQty>
                <ProductPrice>15</ProductPrice>
                <ProductDiscount>0</ProductDiscount>
                <ProductTotal>30</ProductTotal>
                <VendorPartNumber>4378403</VendorPartNumber>
            </OD>
            <OD>
                <ProductName>Test New Product2</ProductName>
                <ProductCode>TNP2</ProductCode>
                <MatrixSKUCode>0</MatrixSKUCode>
                <SerialNo></SerialNo>
                <ProductNotes>Product notes goes here.</ProductNotes>
              	<ProductsQuantityReceived>0</ProductsQuantityReceived>
                <ProductQty>2</ProductQty>
                <ProductPrice>5</ProductPrice>
                <ProductDiscount>0</ProductDiscount>
                <ProductTotal>10</ProductTotal>
                <VendorPartNumber>4378403</VendorPartNumber>
            </OD>
        </OrderDetails>
    </Order>
</POOrders>

Sample Response

{
    "MCM": {
        "response": {
            "objectType": "POOrders",
            "syncTime": "2021-06-10 08:08:57"
        },
        "parameters": {
            "results": {
                "message": {
                    "status": "Success",
                    "success_message": {
                        "order_no": "6448",
                        "order_id": "203066",
                        "warning": {}
                    }
                }
            }
        }
    }
}
<MCM>
  <response>
    <objectType>POOrders</objectType>
    <syncTime>2021-06-10 08:08:57</syncTime>
  </response>
  <parameters>
    <results>
      <message>
        <status>Success</status>
        <success_message>
          <order_id>203066</order_id>
          <order_no>6448</order_no>
          <warning></warning>
        </success_message>
      </message>
    </results>
  </parameters>
</MCM>

WADL

<?xml version="1.0" encoding="utf-8"?>
<application>
   <resources base="https://{yourCompany}.agiliron.net/agiliron/api-40/">
     <resource path="PurchaseOrder">
       <method name="PUT">
         <request>
           <param name="key" type="xsd:string" style="query" required="true"/>
           <param name="OrderNo" type="xsd:int" style="body" required="true"/>
           <param name="OrderDate" type="xsd:dateTime" style="body"/>
           <param name="ModifiedDate" type="xsd:dateTime" style="body"/>
           <param name="Subject" type="xsd:string" style="body" required="true"/>
           <param name="VendorName" type="xsd:int" style="body" required="true"/>
           <param name="ContactFirstName" type="xsd:string" style="body" required="true"/>
           <param name="ContactLastName" type="xsd:string" style="body" required="true"/>
           <param name="Phone" type="xsd:string" style="body"/>
           <param name="Fax" type="xsd:string" style="body"/>
           <param name="TrackingNo" type="xsd:string" style="body"/>
           <param name="EmailAddress" type="xsd:string" style="body"/>
           <param name="BillTo" type="xsd:string" style="body"/>
           <param name="BillingStreet" type="xsd:string" style="body"/>
           <param name="BillingCity" type="xsd:string" style="body"/>
           <param name="BillingState" type="xsd:string" style="body"/>
           <param name="BillingZipCode" type="xsd:string" style="body"/>
           <param name="BillingCountry" type="xsd:string" style="body"/>
           <param name="ShipToName" type="xsd:string" style="body"/>
           <param name="ShippingStreet" type="xsd:string" style="body"/>
           <param name="ShippingCity" type="xsd:string" style="body"/>
           <param name="ShippingState" type="xsd:string" style="body"/>
           <param name="ShippingZipCode" type="xsd:string" style="body"/>
           <param name="ShippingCountry" type="xsd:string" style="body"/>
           <param name="OrderDiscount" type="xsd:decimal" style="body"/>
           <param name="SubTotal" type="xsd:decimal" style="body"/>
           <param name="ShippingCost" type="xsd:decimal" style="body"/>
           <param name="SalesTaxAuthority" type="xsd:string" style="body"/>
           <param name="SalesTaxes" type="xsd:decimal" style="body"/>
           <param name="GrandTotal" type="xsd:decimal" style="body"/>
           <param name="DefaultCurrency" type="xsd:string" style="body"/>
           <param name="ExchangeRate" type="xsd:string" style="body"/>
           <param name="Status" type="xsd:string" style="body"/>
           <param name="PaymentMethod" type="xsd:string" style="body"/>
           <param name="CreditCardType" type="xsd:string" style="body"/>
           <param name="CheckNumber" type="xsd:string" style="body"/>
           <param name="CreditCardOwner" type="xsd:string" style="body"/>
           <param name="CheckWriter" type="xsd:string" style="body"/>
           <param name="PaymentAmount" type="xsd:string" style="body"/>
           <param name="PaymentDate" type="xsd:date" style="body"/>
           <param name="DueDate" type="xsd:date" style="body"/>
           <param name="AssignedTo" type="xsd:string" style="body"/>
           <param name="Description" type="xsd:string" style="body"/>
           <param name="TermsAndConditions" type="xsd:string" style="body"/>
           <param name="Carrier" type="xsd:string" style="body"/>
           <param name="ShippingMethod" type="xsd:string" style="body"/>
           <param name="DeliverTo" type="xsd:string" style="body"/>
           <param name="ExportToQuickbooks" type="xsd:string" style="body"/>
           <param name="RelatedSalesOrders" type="xsd:string" style="body"/>
           <param name="OrderDetails">
            <param name="ProductsName" type="xsd:string" style="body" />
            <param name="ProductCode" type="xsd:string" style="body" required="true"/>
            <param name="MatrixSKUCode" type="xsd:string" style="body" />
            <param name="SerialNo" type="xsd:int" style="body" />
            <param name="ProductNotes" type="xsd:string" style="body"/>
            <param name="ProductsQuantityReceived" type="xsd:int" style="body" />
            <param name="ProductQty" type="xsd:int" style="body" required="true"/>
            <param name="ProductPrice" type="xsd:decimal" style="body"/>
            <param name="ProductDiscount" type="xsd:decimal" style="body"/>
            <param name="ProductTotal" type="xsd:decimal" style="body"/>
            <param name="VendorPartNumber" type="xsd:string" style="body"/>
          </param>
         </request> 
         <response status="200"> 
            <representation mediaType="application/xml" element="yn:ResultSet"/> 
         </response> 
         <response status="400"> 
            <representation mediaType="application/xml" element="ya:Error"/> 
         </response> 
       </method> 
     </resource> 
   </resources>
 </application>