Add PurchaseReturn

Use this operation to add new PurchaseReturn object.

Parameters

Body Params
JSON:json
PurchaseReturn details needs to be passed as body parameter,it should be in JSON format.
XML:string
PurchaseReturn 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/PurchaseReturn will change to https://xyzcompany.agiliron.net/agiliron/api-40.php/PurchaseReturn
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.
{
    "POReturns": {
        "POReturn": [{
            "Subject": "Test POreturn",
            "VendorId": "9",
            "VendorName": "Vendor of Agiliron Inc & Updoer Technology",
            "VendorPhone": "888888888",
            "VendorEmailAddress": {},
            "ContactId": "131",
            "ContactFirstName": "Deepak",
            "ContactLastName": "Yadav",
            "TrackingNo": "812387123",
            "Carrier": "UPS",
            "ShippingMethod": "2nd Day Air",
            "DeliverTo": "OAK",
            "AssignedTo": "Admin",
            "DefaultCurrency": "Aus Dollar",
            "ExchangeRate": "1.00000",
            "Status": "Created,Ordered,",
            "RelatedPurchaseOrders": {},
            "BillTo": "Admin",
            "BillingStreet": "123 Sierra Way",
            "BillingCity": "San Pablo",
            "BillingState": "CA",
            "BillingZipCode": "49016",
            "BillingCountry": "USA",
            "DeliverToName": "Doe",
            "ShippingStreet": "1515 Clay Street",
            "ShippingCity": "Oakland",
            "ShippingState": "CA",
            "ShippingZipCode": "94016",
            "ShippingCountry": "USA",
            "OrderDiscount": "10.00",
            "SubTotal": "116.00",
            "ShippingCost": "174.00",
            "SalesTaxAuthority": {},
            "SalesTaxes": "0.00",
            "SalesCommission": "0.00",
            "GrandTotal": "174.00",
            "PaymentLineItems": {
                "Payment": [
                    {
                        "PaymentMethod": "Cash",
                        "PaymentAmount": "30",
                        "PaymentDate": "01-28-2022",
                        "CheckNumber": {},
                        "CheckWriter": {},
                        "CreditCardNumber": {},
                        "CreditCardType": {},
                        "CreditCardOwner": {},
                        "CreditCardExpires": {},
                        "CreditCardSecurityCode": {},
                        "CreditCardAuthorization": {},
                        "InvoiceNumber": {},
                        "CustomerBankAccount": {},
                        "PaymentEmailAddress": {},
                        "AmountDue": "0.00"
                    },
                    {
                        "PaymentMethod": "Check",
                        "PaymentAmount": "50",
                        "PaymentDate": "01-28-2022",
                        "CheckNumber": {},
                        "CheckWriter": {},
                        "CreditCardNumber": {},
                        "CreditCardType": {},
                        "CreditCardOwner": {},
                        "CreditCardExpires": {},
                        "CreditCardSecurityCode": {},
                        "CreditCardAuthorization": {},
                        "InvoiceNumber": {},
                        "CustomerBankAccount": {},
                        "PaymentEmailAddress": {},
                        "AmountDue": "0.00"
                    }
                ]
            },
            "TermsAndConditions": "test terms",
            "Description": "test description",
            "ExportToQuickbooks": "0",
            "POReturnCustomFields": {
                "CustomField": [
                    {
                        "Name": "Test Text",
                        "Value": "New text updated1"
                    },
                    {
                        "Name": "Test Number",
                        "Value": "45561"
                    }
                ]
            },
            "POReturnDetails": {
                "OD": [
                    {
                        "OrderLineNo": "0",
                        "ProductName": "TestPro",
                        "ProductCode": "1000003944",
                        "MatrixSKUCode": "0",
                        "SerialNo": "0",
                        "ProductNotes": {},
                        "ProductsQuantityReceived": "0",
                        "ProductQty": "3",
                        "ProductPrice": "20.00",
                        "ProductDiscount": "10.00",
                        "ProductTotal": "54.00",
                        "VendorPartNumber": {}
                    },
                    {
                        "OrderLineNo": "1",
                        "ProductName": "TestPro1",
                        "ProductCode": "1000003945",
                        "MatrixSKUCode": "0",
                        "SerialNo": "0",
                        "ProductNotes": {},
                        "ProductsQuantityReceived": "0",
                        "ProductQty": "2",
                        "ProductPrice": "30.00",
                        "ProductDiscount": "10.00",
                        "ProductTotal": "54.00",
                        "VendorPartNumber": {}
                    }
                ]
            }
        }]
    }
}
<POReturns>
    <POReturn>
        <Subject>Test POreturn</Subject>
        <VendorId>9</VendorId>
        <VendorName>Vendor of Agiliron Inc &amp; Updoer Technology</VendorName>
        <VendorPhone>888888888</VendorPhone>
        <VendorEmailAddress></VendorEmailAddress>
        <ContactId>131</ContactId>
        <ContactFirstName>Deepak</ContactFirstName>
        <ContactLastName>Yadav</ContactLastName>
        <TrackingNo>812387123</TrackingNo>
        <Carrier>UPS</Carrier>
        <ShippingMethod>2nd Day Air</ShippingMethod>
        <DeliverTo>OAK</DeliverTo>
        <AssignedTo>Admin</AssignedTo>
        <DefaultCurrency>Aus Dollar</DefaultCurrency>
        <ExchangeRate>1.00000</ExchangeRate>
        <Status>Created,Ordered,</Status>
        <RelatedPurchaseOrders></RelatedPurchaseOrders>
        <BillTo>Admin</BillTo>
        <BillingStreet>123 Sierra Way</BillingStreet>
        <BillingCity>San Pablo</BillingCity>
        <BillingState>CA</BillingState>
        <BillingZipCode>94016</BillingZipCode>
        <BillingCountry>USA</BillingCountry>
        <DeliverToName>Doe</DeliverToName>
        <ShippingStreet>1515 Clay Street</ShippingStreet>
        <ShippingCity>Oakland</ShippingCity>
        <ShippingState>CA</ShippingState>
        <ShippingZipCode>94016</ShippingZipCode>
        <ShippingCountry>USA</ShippingCountry>
        <OrderDiscount>10.00</OrderDiscount>
        <SubTotal>116.00</SubTotal>
        <ShippingCost>174.00</ShippingCost>
        <SalesTaxAuthority></SalesTaxAuthority>
        <SalesTaxes>0.00</SalesTaxes>
      	<SalesCommission>0.00</SalesCommission>
        <GrandTotal>174.00</GrandTotal>
        <PaymentLineItems>
            <Payment>
                <PaymentMethod>Cash</PaymentMethod>
                <PaymentAmount>30</PaymentAmount>
                <PaymentDate>01-28-2022</PaymentDate>
                <CheckNumber></CheckNumber>
                <CheckWriter></CheckWriter>
                <CreditCardNumber></CreditCardNumber>
                <CreditCardType></CreditCardType>
                <CreditCardOwner></CreditCardOwner>
                <CreditCardExpires></CreditCardExpires>
                <CreditCardSecurityCode></CreditCardSecurityCode>
                <CreditCardAuthorization></CreditCardAuthorization>
                <InvoiceNumber></InvoiceNumber>
                <CustomerBankAccount></CustomerBankAccount>
                <PaymentEmailAddress></PaymentEmailAddress>
                <AmountDue>0.00</AmountDue>
            </Payment>
            <Payment>
                <PaymentMethod>Check</PaymentMethod>
                <PaymentAmount>50</PaymentAmount>
                <PaymentDate>01-28-2022</PaymentDate>
                <CheckNumber></CheckNumber>
                <CheckWriter></CheckWriter>
                <CreditCardNumber></CreditCardNumber>
                <CreditCardType></CreditCardType>
                <CreditCardOwner></CreditCardOwner>
                <CreditCardExpires></CreditCardExpires>
                <CreditCardSecurityCode></CreditCardSecurityCode>
                <CreditCardAuthorization></CreditCardAuthorization>
                <InvoiceNumber></InvoiceNumber>
                <CustomerBankAccount></CustomerBankAccount>
                <PaymentEmailAddress></PaymentEmailAddress>
                <AmountDue>0.00</AmountDue>
            </Payment>
        </PaymentLineItems>
        <TermsAndConditions>test terms</TermsAndConditions>
        <Description>test description</Description>
        <ExportToQuickbooks>0</ExportToQuickbooks>
        <POReturnCustomFields>
            <CustomField>
                <Name>Test Text</Name>
                <Value>New text updated1</Value>
            </CustomField>
            <CustomField>
                <Name>Test Number</Name>
                <Value>45561</Value>
            </CustomField>
        </POReturnCustomFields>
        <POReturnDetails>
            <OD>
                <OrderLineNo>0</OrderLineNo>
                <ProductName>TestPro</ProductName>
                <ProductCode>1000003944</ProductCode>
                <MatrixSKUCode>0</MatrixSKUCode>
                <SerialNo>0</SerialNo>
                <ProductNotes></ProductNotes>
                <ProductsQuantityReceived>0</ProductsQuantityReceived>
                <ProductQty>3</ProductQty>
                <ProductPrice>20.00</ProductPrice>
                <ProductDiscount>10.00</ProductDiscount>
                <ProductTotal>54.00</ProductTotal>
                <VendorPartNumber></VendorPartNumber>
            </OD>
            <OD>
                <OrderLineNo>1</OrderLineNo>
                <ProductName>TestPro1</ProductName>
                <ProductCode>1000003945</ProductCode>
                <MatrixSKUCode>0</MatrixSKUCode>
                <SerialNo>0</SerialNo>
                <ProductNotes></ProductNotes>
                <ProductsQuantityReceived>0</ProductsQuantityReceived>
                <ProductQty>2</ProductQty>
                <ProductPrice>30.00</ProductPrice>
                <ProductDiscount>10.00</ProductDiscount>
                <ProductTotal>54.00</ProductTotal>
                <VendorPartNumber></VendorPartNumber>
            </OD>
        </POReturnDetails>
    </POReturn>
</POReturns>

Sample Response

{
    "MCM": {
        "response": {
            "objectType": "PurchaseReturn",
            "syncTime": "2021-06-10 08:08:57"
        },
        "parameters": {
            "results": {
                "message": {
                    "status": "Success",
                    "success_message": {
                        "order_no": "6448",
                        "order_id": "203066",
                        "warning": {}
                    }
                }
            }
        }
    }
}
<MCM>
  <response>
    <objectType>PurchaseReturn</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="PurchaseReturn">
       <method name="PUT">
         <request>
           <param name="key" type="xsd:string" style="query" required="true"/>
           <param name="Subject" type="xsd:string" style="body" required="true"/>
           <param name="VendorId" type="xsd:int" style="body"/>
           <param name="VendorName" type="xsd:string" style="body" required="true"/>
           <param name="VendorPhone" type="xsd:int" style="body"/>
           <param name="VendorEmailAddress" type="xsd:string" style="body"/>
           <param name="ContactId" type="xsd:int" style="body"/>
           <param name="ContactFirstName" type="xsd:string" style="body" required="true"/>
           <param name="ContactLastName" type="xsd:string" style="body" required="true"/>
           <param name="TrackingNo" 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="AssignedTo" type="xsd:string" 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="RelatedPurchaseOrders" type="xsd:int" 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="SalesCommission" type="xsd:decimal" style="body"/>
           <param name="GrandTotal" type="xsd:decimal" 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="Description" type="xsd:string" style="body"/>
           <param name="TermsAndConditions" type="xsd:string" style="body"/>
           <param name="ExportToQuickbooks" 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>