» 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
{
  "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
{
  "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"
  }
}