Add Product to Pricebook

Use this operation to add an existing Product object to a Pricebook.

Parameters

Body Params
JSON:json
Product Pricebook details needs to be passed as body parameter,it should be in JSON format.
XML:string
Product Pricebook 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/ProductsPriceBook will change to https://xyzcompany.agiliron.net/agiliron/api-40.php/ProductsPriceBook
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

{
	"ProductPricebooks": {
		"ProductPricebook": [
			{
				"ProductCode": "ProductCode1",
				"PriceBook": "Retail PriceBook",
				"Price": "20.00"
			},
			{
				"ProductCode": "ProductCode1",
				"PriceBook": "Specials PriceBook",
				"Price": "30.00"
			},
			{
				"ProductCode": "ProductCode1",
				"PriceBook": "Volume PriceBook",
				"Price": "1:20.00;11:30.00;15:60.00"
			}
		]
	}
}
<ProductPricebooks>
    <ProductPricebook>
        <ProductCode>ProductCode1</ProductCode>
        <PriceBook>Retail PriceBook</PriceBook>
        <Price>20.00</Price>
    </ProductPricebook>
	<ProductPricebook>
        <ProductCode>ProductCode1</ProductCode>
        <PriceBook>Specials PriceBook</PriceBook>
        <Price>30.00</Price>
    </ProductPricebook>
	<ProductPricebook>
        <ProductCode>ProductCode1</ProductCode>
        <PriceBook>Volume PriceBook</PriceBook>
        <Price>1:20.00;11:30.00;15:60.00</Price>
    </ProductPricebook>
</ProductPricebooks>
{
	"ProductPricebooks": {
		"ProductPricebook": [
			{
				"ProductCode": "ProductCode1",
				"PriceBook": "Retail PriceBook",
				"Price": "20.00",
				"PricebookMatrixItems": {
					"PricebookMatrixItem": [
						{
							"PricebookMatrixSKUCode": "563245",
							"PricebookMatrixPrice": "20.00"
						},
						{
							"PricebookMatrixSKUCode": "563246",
							"PricebookMatrixPrice": "20.00"
						}
					]
				}
			},
			{
				"ProductCode": "ProductCode1",
				"PriceBook": "Specials PriceBook",
				"Price": "30.00",
				"PricebookMatrixItems": {
					"PricebookMatrixItem": [
						{
							"PricebookMatrixSKUCode": "563245",
							"PricebookMatrixPrice": "30.00"
						},
						{
							"PricebookMatrixSKUCode": "563246",
							"PricebookMatrixPrice": "30.00"
						}
					]
				}
			},
			{
				"ProductCode": "ProductCode1",
				"PriceBook": "Volume PriceBook",
				"Price": "1:20.00;11:30.00;15:60.00",
				"PricebookMatrixItems": {
					"PricebookMatrixItem": [
						{
							"PricebookMatrixSKUCode": "563245",
							"PricebookMatrixPrice": "1:20.00;11:30.00;15:60.00"
						},
						{
							"PricebookMatrixSKUCode": "563246",
							"PricebookMatrixPrice": "1:20.00;11:30.00;15:60.00"
						}
					]
				}
			}
		]
	}
}
<ProductPricebooks>
    <ProductPricebook>
        <ProductCode>ProductCode1</ProductCode>
        <PriceBook>Retail PriceBook</PriceBook>
        <Price>20.00</Price>
        <PricebookMatrixItems>
            <PricebookMatrixItem>
                <PricebookMatrixSKUCode>563245</PricebookMatrixSKUCode>
                <PricebookMatrixPrice>20.00</PricebookMatrixPrice>
            </PricebookMatrixItem>
            <PricebookMatrixItem>
                <PricebookMatrixSKUCode>563246</PricebookMatrixSKUCode>
                <PricebookMatrixPrice>20.00</PricebookMatrixPrice>
            </PricebookMatrixItem>
        </PricebookMatrixItems>
    </ProductPricebook>
	<ProductPricebook>
        <ProductCode>ProductCode1</ProductCode>
        <PriceBook>Specials PriceBook</PriceBook>
        <Price>30.00</Price>
        <PricebookMatrixItems>
            <PricebookMatrixItem>
                <PricebookMatrixSKUCode>563245</PricebookMatrixSKUCode>
                <PricebookMatrixPrice>30.00</PricebookMatrixPrice>
            </PricebookMatrixItem>
            <PricebookMatrixItem>
                <PricebookMatrixSKUCode>563246</PricebookMatrixSKUCode>
                <PricebookMatrixPrice>30.00</PricebookMatrixPrice>
            </PricebookMatrixItem>
        </PricebookMatrixItems>
    </ProductPricebook>
	<ProductPricebook>
        <ProductCode>ProductCode1</ProductCode>
        <PriceBook>Volume PriceBook</PriceBook>
        <Price>1:20.00;11:30.00;15:60.00</Price>
        <PricebookMatrixItems>
            <PricebookMatrixItem>
                <PricebookMatrixSKUCode>563245</PricebookMatrixSKUCode>
                <PricebookMatrixPrice>1:20.00;11:30.00;15:60.00</PricebookMatrixPrice>
            </PricebookMatrixItem>
            <PricebookMatrixItem>
                <PricebookMatrixSKUCode>563246</PricebookMatrixSKUCode>
                <PricebookMatrixPrice>1:20.00;11:30.00;15:60.00</PricebookMatrixPrice>
            </PricebookMatrixItem>
        </PricebookMatrixItems>
    </ProductPricebook>
</ProductPricebooks>

Sample Response

{
  "MCM": {
    "response": {
      "objectType": "Products",
      "syncTime": "2021-06-11 05:31:14"
    },
    "parameters": {
      "results": {
        "message": {
          "ProductsPriceBook": {
            "SuccessNumber": 3,
            "FailureNumber": 0
          }
        }
      }
    }
  }
}
<MCM>
	<response>
		<objectType>Products</objectType>
		<syncTime>2021-06-11 05:31:14</syncTime>
	</response>
	<parameters>
		<results>
			<message>
				<ProductsPriceBook>
					<SuccessNumber>3</SuccessNumber>
					<FailureNumber>0</FailureNumber>
				</ProductsPriceBook>
			</message>
		</results>
	</parameters>
</MCM>

WADL

<?xml version="1.0" encoding="utf-8"?>
<application>
   <resources base="https://{yourCompany}.agiliron.net/agiliron/api-40/">
     <resource path="ProductsPriceBook">
       <method name="POST">
         <request>
           <param name="key" type="xsd:string" style="query" required="true"/>
           <param name="ProductCode" type="xsd:string" style="body" required="true"/>
           <param name="PriceBook" type="xsd:string" style="body" required="true"/>
           <param name="Price" type="xsd:decimal" style="body"/>
         </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>
<?xml version="1.0" encoding="utf-8"?>
<application>
   <resources base="https://{yourCompany}.agiliron.net/agiliron/api-22/">
     <resource path="ProductsPriceBook">
       <method name="POST">
         <request>
           <param name="key" type="xsd:string" style="query" required="true"/>
           <param name="ProductCode" type="xsd:string" style="body" required="true"/>
           <param name="PriceBook" type="xsd:string" style="body" required="true"/>
           <param name="Price" type="xsd:decimal" style="body"/>
           <param name="PricebookMatrixSKUCode" type="xsd:string" style="body"/>
           <param name="PricebookMatrixPrice" type="xsd:int" style="body"/>
         </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>