I'm not completely following your pricing scenario, but you can make an external call for pricing from the CPQ Quote Calculator Plugin. The Quote Calculator Plugin allows you to define a Custom Script that can then call Apex which then makes a rest call.
The important part is using the connection (conn) parameter in the CPQ custom script:
export function onAfterPriceRules(quote, lines, conn) {
var body={< parametersPassedToRestFunction >};
return conn.apex.post('/services/apexrest/restName/getPricing',body).then(function(res)
{
if (res.success !== 'S')
{
// successful result
} else {
// unsuccessful result
}
return Promise.resolve();
}
return Promise.resolve();
}
< parametersPassedToRestFunction > are the parameters defined for your method in your Rest Class.
In my case, the variable res is a class defined within the Rest Class, so I can return lots of info.
Rest Class
@RestResource(UrlMapping='/restName/*')
global class restClass {
global class dataClass {
public String qtId;
public String qtName;
public String success;
// more quote parameters
public List<lineClass> myLines;
}
global class lineClass {
public String lineId;
// more line parameters
}
@HttpPost
global static dataClass getPricing(dataClass myInfo) {
// do rest call to external pricing and populate dataClass parameters
// return dataClass
}
}
Hope this helps.
Mike