Visit Main Site
Join Partner Program
Login
     
Introduction
Authentication
Documentation
Category
GET
POST
PUT
DELETE
Products
GET
POST
PUT
DELETE
Carts
GET
POST
PATCH
DELETE
Variations
GET
POST
PUT
DELETE
Currency
GET
POST
PUT
DELETE
Tax
Tax Profile
GET
POST
PUT
DELETE
Tax Rule
GET
POST
PUT
DELETE
Tax Code
GET
POST
PUT
DELETE
Tax Zone
GET
POST
PUT
DELETE
Discount
GET
POST
PUT
DELETE
Shipping
Shipping Profile
GET
POST
PUT
DELETE
Shipping Rate
GET
POST
PUT
DELETE
Shipping Rules
GET
POST
PUT
DELETE
Customer
GET
POST
PUT
DELETE
Orders
GET
POST
PATCH
Blog
GET
POST
PUT
DELETE
Settings
GET
» Shipping Rate PUT API Documentation

Updating a Shipping Rate

Endpoint: PUT /admin/shipping_rates/{shipping_rate_id}

Purpose

This API updates the attributes of an existing shipping rate identified by its ID. This includes modifying the policy type, conditions, cost settings, and other relevant shipping configurations.

Path Parameters

ParameterTypeDescription
shipping_rate_idIntegerRequired. ID of the shipping rate.

Query Parameters

No query parameters for this endpoint.

Use Case

An admin needs to revise an existing flat-rate shipping policy by enabling cumulative charges and updating the cost-related conditions for better pricing flexibility.

Request Body

Key Type Description
name String Name of the shipping rate.
policy_type String Policy type that governs the rate (e.g., flat_rate, dynamic).
additional_amount Number Extra amount to add on top of base rate.
additional_cost Number Extra cost (could be based on rules or weight).
is_cumulative Boolean Whether the rate should be cumulative with other rates.
includes_tax Boolean Indicates if tax is included in the shipping rate.
is_additional Boolean Marks if this is an additional shipping rate option.
conditions Array List of rate condition objects defining specific pricing logic.
JSON
{
  "shipping_rate": {
    "name": "SHIPPING_RATE_NAME",
    "policy_type": "POLICY_TYPE",
    "additional_amount": ADDITIONAL_AMOUNT,
    "additional_cost": ADDITIONAL_COST,
    "is_cumulative": BOOLEAN,
    "includes_tax": BOOLEAN,
    "is_additional": BOOLEAN,
    "conditions": [
      {
        "from_amount": FROM_AMOUNT,
        "to_amount": TO_AMOUNT,
        "packet_weight": PACKET_WEIGHT,
        "handling_cost": HANDLING_COST,
        "shipping_cost": SHIPPING_COST,
        "shipping_cost_type": "SHIPPING_COST_TYPE",
        "handling_cost_type": "HANDLING_COST_TYPE",
        "api_type": API_TYPE,
        "api_service_type": API_SERVICE_TYPE,
        "extra_cover": EXTRA_COVER,
        "packing_algorithm": PACKING_ALGORITHM,
        "item_attributes": ITEM_ATTRIBUTES
      }
    ]
  }
}

Response

Returns the updated shipping rate object with its ID and the latest values, including conditions and timestamps for creation and update.

PUT
https://{your_site_domain}/api/v4/admin/shipping_rates/{shipping_rate_id}
Try It Out
JSON
{
    "shipping_rate": [
      {
        "id": SHIPPING_RATE_ID,
        "name": "NAME",
        "policy_type": "POLICY_TYPE",
        "additional_amount": ADDITIONAL_AMOUNT,
        "additional_cost": ADDITIONAL_COST,
        "is_cumulative": BOOLEAN,
        "includes_tax": BOOLEAN,
        "is_additional": BOOLEAN,
        "conditions": [
          {
            "id": CONDITION_ID,
            "from_amount": FROM_AMOUNT,
            "to_amount": TO_AMOUNT,
            "packet_weight": PACKET_WEIGHT,
            "handling_cost": HANDLING_COST,
            "shipping_cost": SHIPPING_COST,
            "shipping_cost_type": "SHIPPING_COST_TYPE",
            "handling_cost_type": "HANDLING_COST_TYPE",
            "api_type": API_TYPE,
            "api_service_type": API_SERVICE_TYPE,
            "extra_cover": EXTRA_COVER,
            "packing_algorithm": PACKING_ALGORITHM,
            "item_attributes": ITEM_ATTRIBUTES,
            "shipping_policy": [
              {
                "id": SHIPPING_RATE_ID
              }
            ]
          }
        ],
        "created_at": "YYYY-MM-DDTHH:MM:SS",
        "updated_at": "YYYY-MM-DDTHH:MM:SS"
      }
    ]
  }
  
Terms and Conditions
Privacy Policy

© 2024 WebCommander | All Rights Reserved

contact@webcommander.com
1300 797 571

WebCommander
About Us
Features
Pricing
Compare
Partners
Contact Us
Resource
Find a Partner
Help Centre
Community
Blog
Solutions
Inventory Management
Omnichannel Sales
Ecommerce Automation
B2B Ecommerce
Headless Commerce
Website Design and Performance