Skip to main content
knowledgecenter.avangate.com

Retrieve product price

Overview

Get the price for a product in a new purchase scenario, based on the product ID, the pricing list it's assigned to and specific pricing options.

Requirements

This method requires you to set a specific partner using setPartner.

Parameters

Parameter Type/Description
sessionID Required (string)
  Session identifier, which is the output of the Login method. An exception will be thrown if the values are incorrect.
productId Required (string)
  The unique identifier of the product from your system.
pricingListCode Required (string)
  The unique identifier of the pricing list.
priceOptions Optional (StringArray)
  Array of pricing option codes. These identifiers mark the individual options inside pricing options configuration groups. Can be NULL.

Response

Parameter Type/Description
UnitPrice Object
  UnitPrice object.

Request

<?php

require('PATH_TO_AUTH'); // Authentication example: https://knowledgecenter.avangate.com/Integration/Channel_Manager_API/SOAP/02Authentication
require('PATH_TO_setPartner'); // setPartner example: https://knowledgecenter.avangate.com/Integration/Channel_Manager_API/SOAP/06Reference/Partner/00Set_partner

$productId = 'YOUR_PRODUCT_ID';
$pricingListCode = 'YOUR_PRICING_LIST_CODE';
$priceOptions = array(
'Pricing_options_group_code1',
'Pricing_options_group_code2'
);

try {
    $ProdPrice= $client->getProductPrice($sessionID, $productId, $pricingListCode, $priceOptions);
} catch (SoapFault $e) {
    echo "ProductUnitPrice: " . $e->getMessage();
    exit;
}

Errors

Error Description

INVALID_PARTNER

No partner is set.

PRODUCT_ERROR

Invalid product ID.

PARTNER_PRICING_LISTS_NOT_FOUND

There are no pricing lists with the provided code.

PRODUCT_NOT_FOUND

There is no active product with the provided ID in the given pricing list.