Megaventory API v2017a

<back to all web services

ProductPriceGet

The following routes are available for this service:
GET POST/PricingRule/ProductPriceGetGets pricing details for a product Uses your API Key, a ProductId, a DocumentTypeId, Quantity and some other optional parameters to return pricing details for the requested product. If the SupplierClientId parameter is provided, then specific pricing details for that Supplier/Client are returned. The IssueDate parameter will only take effect if the pricing rule affecting the product is valid within a date range.

Examples:



A.

Get pricing details for a product that is unaffected by pricing rules.

Value:

{
  "APIKEY": "YOUR_API_KEY_HERE",
  "ProductId": 61598,
  "DocumentTypeId": 3,
  "Quantity": 1
}


Response:

{
  "PricingDetails": [
    {
      "PricingRuleName": "Default Sales Price",
      "PricingRuleID": 0,
      "CalculatedBasePrice": 100,
      "DiscountID": 0,
      "TaxID": 0,
      "MinimumQuantity": -1,
      "MaximumQuantity": 100000000,
      "AllowEdit": true
    }
  ],
  "ResponseStatus": {
    "ErrorCode": "0"
  }
}



B.

Get pricing details for a product that is affected by a pricing rule.

Value:

{
  "APIKEY": "YOUR_API_KEY_HERE",
  "ProductId": 61599,
  "DocumentTypeId": 3,
    "Quantity": 1
}


Response:

{
  "PricingDetails": [
    {
      "PricingRuleName": "Targeted Product Discount",
      "PricingRuleID": 104,
      "CalculatedBasePrice": 120,
      "DiscountID": 0,
      "TaxID": 0,
      "MinimumQuantity": -1,
      "MaximumQuantity": 100000000,
      "AllowEdit": true
    },
    {
      "PricingRuleName": "Default Sales Price",
      "PricingRuleID": 0,
      "CalculatedBasePrice": 150,
      "DiscountID": 0,
      "TaxID": 0,
      "MinimumQuantity": -1,
      "MaximumQuantity": 100000000,
      "AllowEdit": true
    }
  ],
  "ResponseStatus": {
    "ErrorCode": "0"
  }
}



C.

Get pricing details for a product that is affected by a pricing rule for a specific Supplier/Client.

Value:

{
  "APIKEY": "YOUR_API_KEY_HERE",
  "ProductId": 61599,
  "DocumentTypeId": 3,
  "Quantity": 1,
  "SupplierClientId": 5486
}


Response:

{
  "PricingDetails": [
    {
      "PricingRuleName": "Returning Customer",
      "PricingRuleID": 100,
      "CalculatedBasePrice": 85,
      "DiscountID": 0,
      "TaxID": 0,
      "MinimumQuantity": -1,
      "MaximumQuantity": 100000000,
      "AllowEdit": true
    },
    {
      "PricingRuleName": "Default Sales Price",
      "PricingRuleID": 0,
      "CalculatedBasePrice": 100,
      "DiscountID": 0,
      "TaxID": 0,
      "MinimumQuantity": -1,
      "MaximumQuantity": 100000000,
      "AllowEdit": true
    }
  ],
  "ResponseStatus": {
    "ErrorCode": "0"
  }
}



To override the Content-type in your clients HTTP Accept Header, append the .xml suffix or ?format=xml

HTTP + XML

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /xml/reply/ProductPriceGet HTTP/1.1 
Host: api.megaventory.com 
Content-Type: application/xml
Content-Length: length

<ProductPriceGet xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Megaventory.APIEndpoints.Operations">
  <APIKEY>String</APIKEY>
  <ProductId>0</ProductId>
  <DocumentTypeId>0</DocumentTypeId>
  <Quantity>0</Quantity>
  <SupplierClientId>0</SupplierClientId>
  <Currency>String</Currency>
  <IssueDate>0001-01-01T00:00:00</IssueDate>
</ProductPriceGet>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<ProductPriceGetResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Megaventory.APIEndpoints.Operations">
  <PricingDetails xmlns:d2p1="https://api.megaventory.com/types">
    <d2p1:mvProductPricingDetails>
      <d2p1:PricingRuleName>String</d2p1:PricingRuleName>
      <d2p1:PricingRuleID>0</d2p1:PricingRuleID>
      <d2p1:CalculatedBasePrice>0</d2p1:CalculatedBasePrice>
      <d2p1:DiscountID>0</d2p1:DiscountID>
      <d2p1:TaxID>0</d2p1:TaxID>
      <d2p1:MinimumQuantity>0</d2p1:MinimumQuantity>
      <d2p1:MaximumQuantity>0</d2p1:MaximumQuantity>
      <d2p1:AllowUserEdit>false</d2p1:AllowUserEdit>
    </d2p1:mvProductPricingDetails>
  </PricingDetails>
  <ResponseStatus xmlns:d2p1="http://schemas.servicestack.net/types">
    <d2p1:ErrorCode>String</d2p1:ErrorCode>
    <d2p1:Message>String</d2p1:Message>
    <d2p1:StackTrace>String</d2p1:StackTrace>
    <d2p1:Errors>
      <d2p1:ResponseError>
        <d2p1:ErrorCode>String</d2p1:ErrorCode>
        <d2p1:FieldName>String</d2p1:FieldName>
        <d2p1:Message>String</d2p1:Message>
      </d2p1:ResponseError>
    </d2p1:Errors>
  </ResponseStatus>
  <InternalErrorCode>String</InternalErrorCode>
</ProductPriceGetResponse>