Skip to main content

Retrieve shipping price

Last updated: 20-Jun-2019
Rate this article:


Use getShippingPrice to retrieve the shipping method and price available, based on a current cart configuration. This API call returns the available shipping methods defined in your Control Panel, together with the fees you configured based on order total amount/weight/country.


It's mandatory to have tangible products defined in your Control Panel, to retrieve shipping method and price information.


Parameters Type/Description

Object / Required

Contains information on the tangible product added in cart.


String / Required

Product code defined in the Information tab from the Product level, in the Control Panel.


Integer / Optional

Quantity of the product that is being purchased.

Default value is 1.


Object / Required

Contains customer billing information.


String / Required

Two-digits code of customer billing country. Example: 'US'.


Object / Required

Contains customer delivery information.


String / Required

Two-digits code of customer delivery country. Example: 'US'.


String / Optional

Three-digits code of purchase currency. Example: 'USD'.


Array of strings / Optional

Discount codes that can be applied to the purchase.

Sample request


require ('PATH_TO_AUTH'); // authentication call

$cartItems = [];
$cartItem = new stdClass();
$cartItem->Code = 'my_product_code_1'; // product code defined in the Information tab, at product level
$cartItem->Quantity = 2; // quantity that is being purchased
$cartItems[0] = $cartItem;
$billingDetails = new stdClass();
$billingDetails->CountryCode = 'US'; // billing country
$deliveryDetails = new stdClass();
$deliveryDetails->CountryCode = 'AU'; // delivery country

$currency = 'USD'; // purchase currency

$couponCode = ['TANGIBLEPROMO']; // apply discount to promotion

$jsonRpcRequest = new stdClass();
$jsonRpcRequest->jsonrpc = '2.0';
$jsonRpcRequest->method = 'getShippingPrice';
$jsonRpcRequest->params = array($sessionID, $cartItems, $billingDetails, $deliveryDetails, $currency);
$jsonRpcRequest->id = $i++;

$getShippingPrice = callRPC($jsonRpcRequest, $host);


Parameters Type/Description


This method returns an object, containing the shipping price available for a certain cart configuration.

Rate this article:

Need help?

Do you have a question? If you didn’t find the answer you are looking for in our documentation, you can contact our Support teams for more information. If you have a technical issue or question, please contact us. We are happy to help.

Not yet a Verifone customer?

We’ll help you choose the right payment solution for your business, wherever you want to sell, in-person or online. Our team of experts will happily discuss your needs.

Verifone logo