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 GET API Documentation

Getting All Shipping Rules

Endpoint: GET /admin/shipping_rules

Purpose

This API fetches a list of all shipping rules configured in the system. Each shipping rule defines the linkage between a shipping policy, shipping zones, and an optional shipping class.

Path Parameters

No path parameters for this endpoint.

Query Parameters

ParameterTypeDescription
limitIntegerNumber of records per request.
offsetIntegerStarting point for pagination. 
order_byStringField to sort results by.
directionStringSort order by ascending or descending.

Use Case

An admin retrieves the full list of shipping rules to manage zone-based shipping strategies, ensuring the correct policies are applied across different regions.

Request Body

No data is required for the request body.

Response

Returns a paginated list of shipping rules. Each rule includes an ID, name, associated shipping policy details, assigned zones, description, and timestamps for creation and update.

GET
https://{your_site_domain}/api/v4/admin/shipping_rules
Try It Out
Json
{
  "shipping_rules": [
    {
      "id": SHIPPING_RULE_ID,
      "name": "SHIPPING_RULE_NAME",
      "shipping_policy": {
        "id": SHIPPING_POLICY_ID,
        "name": "SHIPPING_POLICY_NAME"
      },
      "shipping_class": {},
      "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"
    }
  ],
  "pagination": {
    "records": TOTAL_RECORDS,
    "limit": PAGINATION_LIMIT,
    "offset": PAGINATION_OFFSET,
    "previous_page": "PREVIOUS_PAGE_URL",
    "next_page": "NEXT_PAGE_URL"
  }
}

Getting a Specific Shipping Rule

Endpoint: GET /admin/shipping_rules/{shipping_rule_id}

Purpose

This API retrieves the detailed configuration of a specific shipping rule, including its associated shipping policy, shipping class, applicable zones, and descriptive information.

Path Parameters

ParameterTypeDescription
shipping_rule_idIntegerRequired. ID of the shipping rule.

Query Parameters

No query parameters for this endpoint.

Use Case

An admin reviews the complete setup of a shipping rule to verify which policy and zones are connected, or to prepare for updating zone-based shipping strategies.

Request Body

No data is required for the request body.

Response

Returns the shipping rule's details, including its ID, name, associated shipping policy, shipping class, assigned zones, description, and timestamps for creation and update.

GET
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": {},
    "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