Shipi Resources
Shipi Resources
Shipi Resources

Shipi Shipping Rates API Documentation

Written on November 22, 2025 by myshipi.com • Updated on February 17, 2026
Categories:
Tags:

Shipi Shipping Rates API Documentation

Table of Contents

18 sections

The Get Shipping Rates endpoint returns real-time shipping rates from all your configured carriers for a given destination and package. Use it to show live rates at checkout or compare carrier pricing in your application.

Base URL

https://app.myshipi.com

Authentication

Every API request requires two credentials sent in the request body:

ParameterTypeDescription
shop_idstringYour store’s integration key. Found in Settings > General.
sitekeystringYour website URL, base64-encoded. Example: base64_encode("https://mystore.com")

Generating your sitekey

// PHP
$sitekey = base64_encode("https://mystore.com");

// JavaScript
const sitekey = btoa("https://mystore.com");

// Python
import base64
sitekey = base64.b64encode(b"https://mystore.com").decode()

Keep your credentials safe. Never expose your shop_id in client-side code. Always make API calls from your server.

Endpoint

POST /rates_api/shipi_rates.php

Returns real-time shipping rates from all configured carriers for a given destination and package.

Request Body Parameters

FieldTypeRequiredDescription
shop_idstringYesYour integration key
sitekeystringYesBase64-encoded website URL
receiver_addressobjectYesDestination address
productsarrayYesArray of product objects with weight/dimensions
currencystringNoCurrency code for rates (e.g. “USD”, “EUR”). Defaults to your store currency.

Receiver Address Object

You only need the destination fields for rate calculation:

FieldTypeRequiredDescription
r_citystringYesDestination city
r_statestringNoState/Province code (required for US, CA, AU)
r_zipstringYesDestination postal/ZIP code
r_countrystringYesISO 2-letter country code (e.g. “US”, “DE”, “GB”)

Product Object

FieldTypeDescription
namestringProduct name
quantityintegerQuantity of this product
weightnumberWeight per unit (in kg or lbs based on your settings)
pricenumberProduct price (used for customs/insurance calculations)

Example Request

{
  "shop_id": "your_integration_key",
  "sitekey": "aHR0cHM6Ly9teXN0b3JlLmNvbQ==",
  "receiver_address": {
    "r_city": "Berlin",
    "r_state": "",
    "r_zip": "10115",
    "r_country": "DE"
  },
  "products": [
    {
      "name": "T-Shirt",
      "quantity": 2,
      "weight": 0.3,
      "price": 29.99
    }
  ],
  "currency": "USD"
}

Success Response

The response returns an array of available rates sorted by price:

{
  "success": true,
  "rates": [
    {
      "carrier": "dhl",
      "service_name": "DHL Express Worldwide",
      "service_code": "P",
      "rate": 24.50,
      "currency": "USD",
      "estimated_days": "2-4"
    },
    {
      "carrier": "fedex",
      "service_name": "FedEx International Economy",
      "service_code": "INTERNATIONAL_ECONOMY",
      "rate": 31.20,
      "currency": "USD",
      "estimated_days": "4-6"
    }
  ]
}

Rate Object Fields

FieldTypeDescription
carrierstringCarrier code (e.g. “dhl”, “fedex”, “ups”)
service_namestringHuman-readable service name
service_codestringCarrier-specific service code (use this when creating shipments)
ratenumberShipping cost
currencystringCurrency of the rate
estimated_daysstringEstimated delivery time range

Error Response

{
  "success": false,
  "msg": "Invalid credentials or store not found."
}

Important Notes

  • Only carriers you have configured in your Shipi account will return rates.
  • Rates are cached for 90 seconds to improve performance. Identical requests within this window return cached results.
  • All configured carriers are queried in parallel for the fastest possible response.
  • If a carrier returns an error (e.g., doesn’t ship to the destination), it will be omitted from the results — you’ll only see successful rates.
  • The service_code from the rate response can be passed directly to the Create Shipment endpoint.

Code Examples

cURL

curl -X POST https://app.myshipi.com/rates_api/shipi_rates.php \
  -H "Content-Type: application/json" \
  -d '{
    "shop_id": "your_integration_key",
    "sitekey": "aHR0cHM6Ly9teXN0b3JlLmNvbQ==",
    "receiver_address": {
      "r_city": "Berlin",
      "r_state": "",
      "r_zip": "10115",
      "r_country": "DE"
    },
    "products": [
      {
        "name": "T-Shirt",
        "quantity": 2,
        "weight": 0.3,
        "price": 29.99
      }
    ],
    "currency": "USD"
  }'

PHP

$data = [
    'shop_id' => 'your_integration_key',
    'sitekey' => base64_encode('https://mystore.com'),
    'receiver_address' => [
        'r_city' => 'Berlin',
        'r_state' => '',
        'r_zip' => '10115',
        'r_country' => 'DE'
    ],
    'products' => [
        [
            'name' => 'T-Shirt',
            'quantity' => 2,
            'weight' => 0.3,
            'price' => 29.99
        ]
    ],
    'currency' => 'USD'
];

$ch = curl_init('https://app.myshipi.com/rates_api/shipi_rates.php');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = json_decode(curl_exec($ch), true);
curl_close($ch);

if ($response['success']) {
    foreach ($response['rates'] as $rate) {
        echo $rate['carrier'] . ' - ' . $rate['service_name'] . ': $' . $rate['rate'] . "\n";
    }
} else {
    echo "Error: " . $response['msg'];
}

Node.js

const response = await fetch('https://app.myshipi.com/rates_api/shipi_rates.php', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    shop_id: 'your_integration_key',
    sitekey: Buffer.from('https://mystore.com').toString('base64'),
    receiver_address: {
      r_city: 'Berlin',
      r_state: '',
      r_zip: '10115',
      r_country: 'DE'
    },
    products: [
      { name: 'T-Shirt', quantity: 2, weight: 0.3, price: 29.99 }
    ],
    currency: 'USD'
  })
});

const result = await response.json();

if (result.success) {
  result.rates.forEach(rate => {
    console.log(`${rate.carrier} - ${rate.service_name}: $${rate.rate} (${rate.estimated_days} days)`);
  });
} else {
  console.error(`Error: ${result.msg}`);
}

Python

import requests
import base64

response = requests.post('https://app.myshipi.com/rates_api/shipi_rates.php', json={
    'shop_id': 'your_integration_key',
    'sitekey': base64.b64encode(b'https://mystore.com').decode(),
    'receiver_address': {
        'r_city': 'Berlin',
        'r_state': '',
        'r_zip': '10115',
        'r_country': 'DE'
    },
    'products': [
        {'name': 'T-Shirt', 'quantity': 2, 'weight': 0.3, 'price': 29.99}
    ],
    'currency': 'USD'
})

result = response.json()

if result['success']:
    for rate in result['rates']:
        print(f"{rate['carrier']} - {rate['service_name']}: ${rate['rate']} ({rate['estimated_days']} days)")
else:
    print(f"Error: {result['msg']}")

Common Use Case: Checkout Rate Display

A typical integration flow for showing rates at checkout:

  1. Customer enters their shipping address at checkout.
  2. Your server calls the Get Shipping Rates endpoint with the destination and cart items.
  3. Display the returned rates as shipping options for the customer to choose from.
  4. When the customer selects a rate and places the order, use the carrier and service_code from their chosen rate to call the Create Shipment endpoint with exec_type: "auto".

Need help? Contact us at support@myshipi.com