Update SalesReturn

Use this operation to update any of the writable fields of an existing SalesReturn 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
SalesReturn details needs to be passed as body parameter,it should be in JSON format.
XML:string
SalesReturn 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/SalesReturn will change to https://xyzcompany.agiliron.net/agiliron/api-40.php/SalesReturn
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 SalesReturn Update ,

  • OrderNo field contains RMA Number.
  • AgilironOrderNo field contains order no.
  • If AgilironOrderNo is not provided then salesreturn update is done on basis of OrderNo i.e. RMA number and if it is provided then salesreturn update is done on basis of order no.
{
	"SalesReturns": {
		"Order": [{
			"OrderNo": "2794",
			"AgilironOrderNo": "3001",
			"OrderDate": "01-24-2020 08:33:59",
			"ModifiedDate": "01-24-2020 06:39:02",
			"Subject": "Test New Sales return",
			"AccountName": "Test Account",
			"ContactFirstName": "John",
			"ContactLastName": "Doe",
			"ContactPhone": "41533345",
			"ContactEmailAddress": "[email protected]",
			"Fax": "",
			"DueDate": "",
			"BillingName": "John Doe",
			"BillingStreet": "4567DoeCircle",
			"BillingCity": "SanFrancisco",
			"BillingState": "CA",
			"BillingZipCode": "94104",
			"BillingCountry": "UnitedStates",
			"ShipToName": "",
			"ShipToPhone": "(415)675-3134",
			"ShipToEmailAddress": "[email protected]",
			"ShippingStreet": "4567DoeCircle",
			"ShippingCity": "SanFrancisco",
			"ShippingState": "CA",
			"ShippingZipCode": "94104",
			"ShippingCountry": "UnitedStates",
			"OrderDiscount": "",
			"SubTotal": "455.780",
			"ShippingCost": "",
			"SalesTaxAuthority": "",
			"SalesTaxes": "0.000",
			"GrandTotal": "462.530",
			"DefaultCurrency": "",
			"ExchangeRate": "0.00000",
			"Status": "Created,Invoiced,",
			"PaymentMethod": "Cash",
			"CreditCardType": "",
			"CheckNumber": "",
			"CreditCardOwner": "JohnDoe",
			"CheckWriter": "",
			"PaymentAmount": "462.530",
			"PaymentDate": "",
			"AssignedTo": "admin",
			"ExportToQuickbooks": "2",
			"TermsAndConditions": "Prepaid",
			"Description": "Order notes goes here.",
			"Carrier": "",
			"ShippingMethod": "",
			"DeliverTo": "OAK",
			"RMANumber": "5012323123223",
			"TrackingNo": "",
			"OrdersCustomFields": {
				"CustomField": [{
						"Name": "CustomFied1",
						"Value": "Custom info 1"
					},
					{
						"Name": "CustomFied2",
						"Value": "Custom info 2"
					}
				]
			},
			"OrderDetails": {
				"OD": [{
						"ProductsName": "Test New Product1",
						"ProductCode": "TNP1",
						"MatrixSKUCode": "0",
						"SerialNo": "",
						"ProductNotes": "Product notes goes here.",
						"ProductQty": "2",
						"ProductPrice": "15",
						"ProductDiscount": "0",
						"ProductTotal": "30"
					},
					{
						"ProductsName": "Test New Product2",
						"ProductCode": "TNP2",
						"MatrixSKUCode": "0",
						"SerialNo": "",
						"ProductNotes": "Product notes goes here.",
						"ProductQty": "2",
						"ProductPrice": "5",
						"ProductDiscount": "0",
						"ProductTotal": "10"
					}
				]
			}
		}]
	}
}
<SalesReturns>
    <Order>
        <OrderNo>2794</OrderNo>
        <AgilironOrderNo>3001</AgilironOrderNo>
        <OrderDate>01-24-2020 08:33:59</OrderDate>
        <ModifiedDate>01-24-2020 06:39:02</ModifiedDate>
        <Subject>Test New Sales return</Subject>
        <AccountName>Test Account</AccountName>
        <ContactFirstName>John</ContactFirstName>
        <ContactLastName>Doe</ContactLastName>
        <ContactPhone>41533345</ContactPhone>
        <ContactEmailAddress>[email protected]</ContactEmailAddress>
        <Fax></Fax>
        <DueDate></DueDate>
        <BillingName>John Doe</BillingName>
        <BillingStreet>4567DoeCircle</BillingStreet>
        <BillingCity>SanFrancisco</BillingCity>
        <BillingState>CA</BillingState>
        <BillingZipCode>94104</BillingZipCode>
        <BillingCountry>UnitedStates</BillingCountry>
        <ShipToName> </ShipToName>
        <ShipToPhone>(415)675-3134</ShipToPhone>
        <ShipToEmailAddress>[email protected]</ShipToEmailAddress>
        <ShippingStreet>4567DoeCircle</ShippingStreet>
        <ShippingCity>SanFrancisco</ShippingCity>
        <ShippingState>CA</ShippingState>
        <ShippingZipCode>94104</ShippingZipCode>
        <ShippingCountry>UnitedStates</ShippingCountry>
        <OrderDiscount></OrderDiscount>
        <SubTotal>455.780</SubTotal>
        <ShippingCost></ShippingCost>
        <SalesTaxAuthority></SalesTaxAuthority>
        <SalesTaxes>0.000</SalesTaxes>
        <GrandTotal>462.530</GrandTotal>
        <DefaultCurrency></DefaultCurrency>
        <ExchangeRate>0.00000</ExchangeRate>
        <Status>Created,Invoiced,</Status>
        <PaymentMethod>Cash</PaymentMethod>
        <CreditCardType></CreditCardType>
        <CheckNumber></CheckNumber>
        <CreditCardOwner>JohnDoe</CreditCardOwner>
        <CheckWriter></CheckWriter>
        <PaymentAmount>462.530</PaymentAmount>
        <PaymentDate></PaymentDate>
        <AssignedTo>admin</AssignedTo>
        <ExportToQuickbooks>2</ExportToQuickbooks>
        <TermsAndConditions>Prepaid</TermsAndConditions>
        <Description>Order notes goes here.</Description>
        <Carrier></Carrier>
        <ShippingMethod></ShippingMethod>
        <DeliverTo>OAK</DeliverTo>
        <RMANumber>5012323123223</RMANumber>
        <TrackingNo></TrackingNo>
        <OrdersCustomFields>
            <CustomField>
                <Name>CustomFied1</Name>
                <Value>Custom info 1</Value>
            </CustomField>
            <CustomField>
                <Name>CustomFied2</Name>
                <Value>Custom info 2</Value>
            </CustomField>
        </OrdersCustomFields>
        <OrderDetails>
            <OD>
                <ProductsName>Test New Product1</ProductsName>
                <ProductCode>TNP1</ProductCode>
                <MatrixSKUCode>0</MatrixSKUCode>
                <SerialNo></SerialNo>
                <ProductNotes>Product notes goes here.</ProductNotes>
                <ProductQty>2</ProductQty>
                <ProductPrice>15</ProductPrice>
                <ProductDiscount>0</ProductDiscount>
                <ProductTotal>30</ProductTotal>
            </OD>
            <OD>
                <ProductsName>Test New Product2</ProductsName>
                <ProductCode>TNP2</ProductCode>
                <MatrixSKUCode>0</MatrixSKUCode>
                <SerialNo></SerialNo>
                <ProductNotes>Product notes goes here.</ProductNotes>
                <ProductQty>2</ProductQty>
                <ProductPrice>5</ProductPrice>
                <ProductDiscount>0</ProductDiscount>
                <ProductTotal>10</ProductTotal>
            </OD>
        </OrderDetails>
    </Order>
</SalesReturns>

Sample Response

{
    "MCM": {
        "response": {
            "objectType": "SalesReturn",
            "syncTime": "2021-06-10 08:08:57"
        },
        "parameters": {
            "results": {
                "message": {
                    "status": "Success",
                    "success_message": {
                        "order_no": "6448",
                        "order_id": "203066",
                        "warning": {}
                    }
                }
            }
        }
    }
}
<MCM>
  <response>
    <objectType>SalesReturn</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="SalesReturn">
       <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="AccountName" 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="ContactPhone" type="xsd:string" style="body"/>
           <param name="ContactEmailAddress" type="xsd:string" style="body"/>
           <param name="BillingName" 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="ShipToPhone" type="xsd:string" style="body"/>
           <param name="ShipToEmailAddress" 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="AdditionalFees" type="xsd:decimal" style="body"/>
           <param name="DefaultPriceBook" 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="AssignedTo" type="xsd:string" style="body"/>
           <param name="ExportToQuickbooks" type="xsd:string" style="body"/>
           <param name="Description" 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="RMANumber" type="xsd:int" style="body"/>
           <param name="TrackingNo" 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="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>
         </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>

© Copyright 2022 Agiliron - All Rights Reserved.