> For the complete documentation index, see [llms.txt](https://docs.2checkout.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.2checkout.com/soap-api-reference/soap-api-6.0/api-requests/shipping-in-api/retrieve-shipping-price.md).

# Retrieve shipping price

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**.

## Requirements

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

## Request parameters

| Parameter                   | Type / Description                                                                                                                                         |
| --------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Items**                   | <p><strong>Object / Required</strong><br>Contains information on the tangible product added in cart.</p>                                                   |
| Items.Code                  | <p><strong>String / Required</strong></p><p>Product code defined in the <strong>Information</strong> tab from the Product level, in the Control Panel.</p> |
| Items.Quantity              | <p><strong>Integer / Optional</strong></p><p>Quantity of the product that is being purchased.</p><p>Default value is 1.</p>                                |
| **BillingDetails**          | <p><strong>Object / Required</strong><br>Contains customer billing information.</p>                                                                        |
| BillingDetails.CountryCode  | <p><strong>CoString / Required</strong></p><p>Two-digits code of customer billing country. Example: 'US'.<strong>untryCode</strong></p>                    |
| **DeliveryDetails**         | <p><strong>Object / Required</strong><br>Contains customer delivery information.</p>                                                                       |
| DeliveryDetails.CountryCode | <p><strong>String / Required</strong></p><p>Two-digits code of customer delivery country. Example: 'US'.</p>                                               |
| **Currency**                | <p><strong>String / Optional</strong><br>Three-digits code of purchase currency. Example: 'USD'.</p>                                                       |
| **CouponCodes**             | <p><strong>Array of strings / Optional</strong><br>Discount codes that can be applied to the purchase.</p>                                                 |

### Sample request

```php
<?php

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

try {
    $shippingPrice = $client->getShippingPrice($sessionID, $cartItems, $billingDetails, $deliveryDetails, $currency);
}
catch (SoapFault $e) {
    echo "ShippingPrice: " . $e->getMessage();
    exit;
}
var_dump("ShippingPrice", $shippingPrice);
```

## Response parameters

| Parameter                                                                                                                                                    | Type / Description                                                                                                                        |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------- |
| [**ShippingPrice**](https://verifone.cloud/docs/2checkout/API-Integration/Legacy-API-versions/JSON-RPC_API/JSON-RPC-API-5.0/08API-Responses/Shipping_price/) | <p><strong>Object</strong><br>This method returns an object containing the shipping price available for a certain cart configuration.</p> |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.2checkout.com/soap-api-reference/soap-api-6.0/api-requests/shipping-in-api/retrieve-shipping-price.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
