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 Rule PUT API Documentation

Updating a Shipping Rule

Endpoint: PUT /admin/shipping_rules/{shipping_rule_id}

Purpose

This endpoint updates an existing shipping rule by its unique ID. It allows admins to modify the rule’s name, associated shipping policy, shipping class, zones, and description. This is essential for maintaining flexible, region-specific shipping logic as business needs or logistics partners evolve.

Path Parameters

ParameterTypeDescription
shipping_rule_idIntegerThe ID of the shipping rule to update.

Query Parameters

No query parameters for this endpoint.

Use Case

An admin updates a previously created shipping rule to apply a different shipping policy and change the assigned shipping class and zone configuration. This is helpful during pricing strategy updates, shipping provider changes, or when introducing zone-specific delivery options.

Request Body

Key Type Description
name String Name of the shipping rule.
profile_id String ID of the associated shipping profile.
shipping_class String ID of the related shipping class.
shipping_policy String ID of the shipping policy applied to this rule.
zones Array of Objects List of zone objects that this rule applies to (each with an id).
description String Description of the shipping rule.
Json
{
  "shipping_rule": {
    "name": "SHIPPING_RULE_NAME",
    "profile_id": "SHIPPING_PROFILE_ID",
    "shipping_class": "SHIPPING_CLASS_ID",
    "shipping_policy": "SHIPPING_POLICY_ID",
    "zones": [
      {
        "id": ZONE_ID_1
      },
      {
        "id": ZONE_ID_2
      }
    ],
    "description": "SHIPPING_RULE_DESCRIPTION"
  }
}

Response

Returns the updated shipping rule object, including rule ID, new name, linked shipping policy and class, updated zones, and timestamps. This response confirms the changes and ensures the admin can verify the update was successfully applied.

PUT
https://{your_site_domain}/api/v4/admin/shipping_rules/{shipping_rule_id}
Try It Out
Json
{
  "shipping_rule": {
    "id": SHIPPING_RULE_ID,
    "name": "SHIPPING_RULE_NAME",
    "shipping_policy": {
      "id": SHIPPING_POLICY_ID,
      "name": "SHIPPING_POLICY_NAME"
    },
    "shipping_class": {
      "id": SHIPPING_CLASS_ID,
      "name": "SHIPPING_CLASS_NAME"
    },
    "zones": [
      {
        "id": ZONE_ID_1,
        "name": "ZONE_NAME_1"
      },
      {
        "id": ZONE_ID_2,
        "name": "ZONE_NAME_2"
      }
    ],
    "description": "SHIPPING_RULE_DESCRIPTION",
    "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