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 .json suffix or ?format=json

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

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

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

{"APIKEY":"String","ProductId":0,"DocumentTypeId":0,"Quantity":0,"SupplierClientId":0,"Currency":"String","IssueDate":"\/Date(-62135596800000-0000)\/"}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"PricingDetails":[{"PricingRuleName":"String","PricingRuleID":0,"CalculatedBasePrice":0,"DiscountID":0,"TaxID":0,"MinimumQuantity":0,"MaximumQuantity":0,"AllowUserEdit":false}],"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String"}]},"InternalErrorCode":"String"}