Skip to main content

Documentation Index

Fetch the complete documentation index at: https://shipmagic-docs.speedysquirrelhq.com/llms.txt

Use this file to discover all available pages before exploring further.

The ShipMagic API can be used to fetch rates from ShipMagic App and display them on custom pages like cart and product details pages.
Endpoint
 POST https://shipmagic.fly.dev/api/shipping-rate/get
Headers
x-api-key = <YOUR_API_KEY>
Payload
{
    "rate": {
        "origin": {
            "country": "IN",
            "postal_code": "444001",
            "province": "MH",
            "city": "Akola",
            "address1": "150 Elgin St.",
            "address2": ""
        },
        "destination": {
            "country": "GB",
            "postal_code": "G4 0DS",
            "province": "SCT",
            "city": "Glasgow",
            "name": "Barney Stinson",
            "address1": "24 Sussex Dr.",
            "address2": ""
        },
        "items": [
            {
                "name": "Short Sleeve T-Shirt",
                "sku": "T123",
                "quantity": 1,
                "grams": 100,
                "price": 500,
                "vendor": "Reebok",
                "properties": null,
                "product_id": 8134077955815,
                "variant_id": 47520005882151
            },
            {
                "name": "Cargo Pants",
                "sku": "P432",
                "quantity": 2,
                "grams": 200,
                "price": 700,
                "vendor": "Adidas",
                "properties": {
		               "color": "black",
		               "gift-item": "yes"
	               },
                "product_id":8124778954811,
                "variant_id": 49520505832142
            }
        ]
    },
    "blend_type": "no_blending"
}
ParameterDescriptionRequired
countryTwo letter country code following the ISO 3166-1 alpha-2 guidelines. You can find all the country codes here.Yes
provinceTwo letter province codes following the ISO 3166 guidelines. You can find all the province codes here.Yes
destination → nameFirst name + last name of the buyer.Yes
blend_typeAccepts either of the following values.
1. no_blending
2. add_rates
3. highest_rate_only
4. lowest_rate_only
Yes
postal_codePost-code / Zip-code / Pin-code.No
cityCity name.No
address1Address Line 1.No
address2Address Line 2.No
items → nameFull name of the item (Product title + Variant name).No
skuSKU.No
quantityQuantity.No
gramsWeight of item in grams.No
pricePrice of item in store’s default currency.No
vendorVendor name.No
propertiesKey value pairs of line item properties.No
product_idShopify Product IDNo
variant_idShopify Variant IDNo
Return Data
{
    "rates": [
        {
            "service_name": "Standard Shipping",
            "service_code": "standard_shipping",
            "currency": "INR",
            "total_price": 600,
            "description": "Delivery in 3-4 business days"
        }
    ]
}
ParameterDescription
service_nameThe name of the rate, which customers see at checkout.
service_codeA unique code associated with the rate.
total_priceThe total price expressed in subunits. If the currency doesn’t use subunits, then the value must be multiplied by 100. For example: "total_price": 500 for 5.00 CAD, "total_price": 100000 for 1000 JPY.
currencyThe currency of the shipping rate.
descriptionA description of the rate, which customers see at checkout.
Contact aditya@speedysquirrelhq.com for API Key and any questions that you may have.