> ## Documentation Index
> Fetch the complete documentation index at: https://sendcloud.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Retrieve a shipping price

> Retrieve shipping rate information for a specific `shipping_method_id` and `from_country`.

<Warning>
  **API v2 is entering maintenance mode.** New users should start with API v3 to access our latest features and improved performance. Already using v2? Don't worry, your current integration remains fully functional. Read more about [maintenance mode](/docs/getting-started/api-version-guide), or check out the [migration guide for API v3](/docs/getting-started/migration-guidelines-for-api-v3).
</Warning>

For users that have uploaded their own prices, the response will show the prices that have been uploaded.

The response is an array of prices for all available receiver countries. If the `to_country` query parameter is present, the array will only contain one item.

Note that `price` and `currency` will be `null` when no pricing is available for a receiver country.

<Warning>
  If you have more than one active contract for a specific carrier, you must fill the `contract` attribute with your desired contract ID in your request. You can get your contract ID from the [Retrieve a list of contracts](/api/v2/contracts/retrieve-a-list-of-contracts) endpoint.
</Warning>

<Info>
  In order to view **remote surcharges**, you are required to provide the `to_country` and `to_postal_code`. Similarly, to access **zonal prices**, you need to provide `to_country`, `from_postal_code` and `to_postal_code`. This information ensures accurate and customized pricing based on the specific location, enabling you to understand any additional charges associated with remote areas and access pricing based on their designated zones.
</Info>


## OpenAPI

````yaml /.openapi/v2/shipping-price/openapi.yaml get /shipping-price
openapi: 3.1.0
info:
  title: Shipping price
  version: 2.0.0
  description: >-
    The Shipping prices API allows you to retrieve rates for a specific shipping
    method based on the specified `shipping_method_id`.
  contact:
    name: Sendcloud API Support
    url: https://www.sendcloud.dev
    email: contact@sendcloud.com
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
servers:
  - url: https://panel.sendcloud.sc/api/v2
    description: Sendcloud Production
security: []
tags:
  - name: Shipping price
paths:
  /shipping-price:
    parameters: []
    get:
      tags:
        - Shipping price
      summary: Retrieve a shipping price
      description: >-
        Retrieve shipping rate information for a specific `shipping_method_id`
        and `from_country`.
      operationId: sc-public-v2-scp-get-shipping_price
      parameters:
        - $ref: '#/components/parameters/shipping_method_id'
        - $ref: '#/components/parameters/from_country'
        - $ref: '#/components/parameters/to_country'
        - $ref: '#/components/parameters/weight'
        - $ref: '#/components/parameters/weight_unit'
        - $ref: '#/components/parameters/contract'
        - $ref: '#/components/parameters/from_postal_code'
        - $ref: '#/components/parameters/to_postal_code'
      responses:
        '200':
          $ref: '#/components/responses/200'
        '400':
          $ref: '#/components/responses/400'
      security:
        - HTTPBasicAuth: []
        - OAuth2ClientCreds: []
components:
  parameters:
    shipping_method_id:
      schema:
        type: integer
      in: query
      name: shipping_method_id
      description: >-
        The id of the shipping method retrieved via [shipping
        products](/api/v2/shipping-products/retrieve-a-list-of-shipping-products)
        or [shipping
        methods](/api/v2/shipping-methods/retrieve-a-list-of-shipping-methods).
      required: true
    from_country:
      schema:
        type: string
      in: query
      name: from_country
      description: >-
        The sender country of the shipment, as an [ISO 3166-1
        alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2).
      required: true
    to_country:
      schema:
        type: string
      in: query
      name: to_country
      description: >-
        The receiver country of the shipment, as an [ISO 3166-1
        alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). Required if
        the carrier is zonal. Also required to see if remote surcharges apply.
    weight:
      schema:
        type: integer
      in: query
      name: weight
      description: The weight of the shipment, in weight_unit.
      required: true
    weight_unit:
      schema:
        type: string
      in: query
      name: weight_unit
      description: One of `kilogram` or `gram`.
      required: true
    contract:
      name: contract
      in: query
      required: false
      schema:
        type: integer
        minimum: 1
        example: 123
      description: >-
        Id of the contract that you would like to use to get the price. If you
        are requesting price for a direct contract then you need to upload your
        own price via the Sendcloud platform.
    from_postal_code:
      name: from_postal_code
      in: query
      required: false
      schema:
        type: string
        maxLength: 12
        example: '01000'
      description: Postal code of the sender. Required if the carrier is zonal.
    to_postal_code:
      name: to_postal_code
      in: query
      required: false
      schema:
        type: string
        maxLength: 12
        example: '01000'
      description: >-
        Postal code of the recipient. Required if the carrier is zonal. Also
        required to see if remote surcharges apply.
  responses:
    '200':
      description: OK
      content:
        application/json:
          schema:
            type: array
            items:
              $ref: '#/components/schemas/ShippingPrice'
          examples:
            RetrieveShippingPrices:
              $ref: '#/components/examples/ShippingPrice'
              summary: Shipping prices
            NotPrices:
              $ref: '#/components/examples/NoPrice'
              summary: No prices available
            NoData:
              $ref: '#/components/examples/NoData'
              summary: No data available
    '400':
      description: Bad Request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            BadRequest:
              $ref: '#/components/examples/required_field_error'
              summary: Bad Request
  schemas:
    ShippingPrice:
      type: object
      description: Shipping price response
      properties:
        price:
          type: string
          description: Shipping price
          format: currency
          example: '6.50'
          nullable: true
        currency:
          type: string
          description: 3 letter currency code as defined by ISO-4217
          example: EUR
          format: iso-4217
          nullable: true
        to_country:
          type: string
          description: >-
            The receiver country of the shipment, as an [ISO 3166-1
            alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)
          example: NL
          format: iso 3166-1
        breakdown:
          $ref: '#/components/schemas/shipping-price-breakdown'
    Error:
      type: object
      description: Error response for shipping price
      properties:
        error:
          type: object
          properties:
            request:
              type: string
              format: uri-reference
              example: api/v2/shipping-price/
              description: The requested URL
            code:
              type: integer
              format: int32
              example: 400
              description: Code of the error
            message:
              type: string
              example: Bad request
              description: Description of the error
    shipping-price-breakdown:
      title: Shipping Price Breakdown Object
      description: A Sendcloud shipping price breakdown.
      type: array
      items:
        type: object
        properties:
          type:
            type: string
            example: price_without_insurance
            description: Type of the price. It is an identifier of category of the price.
          label:
            type: string
            example: Initial price per parcel
            description: >-
              This label is a friendly name for type of the price type and can
              be used to represent it.
          value:
            type: number
            format: float
            example: 6.4
            description: Price amount of the breakdown item.
  examples:
    ShippingPrice:
      summary: Shipping price
      value:
        - price: '6.50'
          currency: EUR
          to_country: NL
          breakdown:
            - type: price_without_insurance
              label: Label
              value: 6.5
    NoPrice:
      summary: No prices
      value:
        - price: null
          currency: null
          to_country: BE
    NoData:
      summary: No data
      value: []
    required_field_error:
      value:
        error:
          code: 400
          request: api/v2/shipping-price/
          message: 'shipping_method_id: "This field is required."'
  securitySchemes:
    HTTPBasicAuth:
      type: http
      description: >-
        Basic Authentication using API key and secrets is currently the main
        authentication mechanism.
      scheme: basic
    OAuth2ClientCreds:
      type: oauth2
      description: >-
        OAuth2 is a standardized protocol for authorization that allows users to
        share their private resources stored on one site with another site
        without having to provide their credentials. OAuth2 Client Credentials
        Grant workflow. This workflow is typically used for server-to-server
        interactions that require authorization to access specific resources.
      flows:
        clientCredentials:
          tokenUrl: https://account.sendcloud.com/oauth2/token/
          scopes:
            api: Default OAuth scope required to access Sendcloud API.

````