Shipping Rate API

配送料APIは受取人の所在地と注文の内容に基づいて注文の配送料を計算します。

返された配送料IDを使って、注文を作成する際の配送方法を指定することができます。

国コードの情報については 国別API をご確認ください 。

バリエーションIDの情報については Printful カタログAPI をご確認ください。

Calculate shipping rates

POST https://api.printful.com/shipping/rates

Returns available shipping options and rates for the given list of products.

Input parameters:
Request body ShippingRequest Order information
recipient AddressInfo Recipient location information
address1 string Address line 1
city string City
country_code string Country code
state_code string State code (optional)
zip string ZIP or postal code (optional, required for some countries to calculate expedited shipping rates)
items ItemInfo [ ] Array of order items
variant_id string Catalog Variant ID of the item ordered. See Product Catalog API

* Required if no other IDs given
external_variant_id string External Variant ID of the item ordered. See E-commerce Platform Sync API.

* Required if no other IDs given
warehouse_product_variant_id string Warehouse product variant ID of the item ordered. See Warehouse Products API.

* Required if no other IDs given
quantity integer Number of items ordered
value string Item retail value - optional but can help to properly calculate insurance costs for large orders
currency string 3 letter currency code (optional), required if the rates need to be converted to another currency instead of store default currency
locale string Locale in which shipping rate names will be returned. Available options - 'en_US' (default), 'es_ES'
レスポンス形式:
code integer ステータスコードのレスポンス 200
result ShippingInfo [ ]
id string Shipping method ID
name string Shipping method name
rate string Shipping rate
currency string Currency code in which the rate is returned
minDeliveryDays int Estimated minimum delivery days. Warning this value may not be present in response.
maxDeliveryDays int Estimated maximum delivery days. Warning this value may not be present in response.
APIキー
Request body
Execute
Calculate shipping rates to US for order that contains 1 poster and 5 T-shirts.
Request body:
{
    "recipient": {
        "address1": "19749 Dearborn St",
        "city": "Chatsworth",
        "country_code": "US",
        "state_code": "CA",
        "zip": 91311
    },
    "items": [
        {
            "quantity": 1,
            "variant_id": 2
        },
        {
            "quantity": 5,
            "variant_id": 202
        }
    ]
}
Response data:
{
    "code": 200,
    "result": [{
            "id": "STANDARD",
            "name": "Flat Rate (3-5 business days)",
            "rate": "18.45",
            "currency": "USD"
     }]
}
外部(あなた)のバリエーションIDのアイテムを含む注文のアメリカへの配送料金を計算
Request body:
{
    "recipient": {
        "address1": "19749 Dearborn St",
        "city": "Chatsworth",
        "country_code": "US",
        "state_code": "CA",
        "zip": 91311
    },
    "items": [
        {
            "quantity": 1,
            "external_variant_id": 2
        },
        {
            "quantity": 5,
            "variant_id": 202
        }
    ]
}
Response data:
{
    "code": 200,
    "result": [{
        "id": "STANDARD",
        "name": "Flat Rate (3-5 business days)",
        "rate": "18.45",
        "currency": "USD"
    }]
}
倉庫バリエーションIDのアイテムを含む注文のアメリカへの配送料金を計算する
Request body:
{
    "recipient": {
        "address1": "19749 Dearborn St",
        "city": "Chatsworth",
        "country_code": "US",
        "state_code": "CA",
        "zip": 91311
    },
    "items": [
        {
            "quantity": 1,
            "warehouse_product_variant_id": 2
        },
        {
            "quantity": 5,
            "variant_id": 202
        }
    ]
}
Response data:
{
    "code": 200,
    "result": [{
        "id": "STANDARD",
        "name": "Flat Rate (3-5 business days)",
        "rate": "18.45",
        "currency": "USD"
    }]
}

Printfulを試す準備はできましたか?