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