---
title: "Create Action for a Shipping Rule"
method: POST
path: "/2024-09/shipping_rules/{shipping_rule_id}/actions"
tags: ["Shipping Rule's Actions"]
---

# Create Action for a Shipping Rule

`POST /2024-09/shipping_rules/{shipping_rule_id}/actions`

## Request

- Base URL: `https://public-api.easyship.com`
- URL: `https://public-api.easyship.com/2024-09/shipping_rules/{shipping_rule_id}/actions`
- Auth: HTTP bearer

Create action for a shipping rule.

Required authorization scope: `public.shipping_rule:write`

## Path parameters

- `shipping_rule_id` string, required

## Request body

- union
  - ActionAddNeverCourierCreate: Never add specific courier services
    - `type` 'add_never_courier_service', required
    - `options` object, required
      - `never_courier_service_ids` string[], required: List of courier service IDs based on Courier Service API
  - ActionAddPreferredCourierCreate: Use preferred courier services
    - `type` 'add_preferred_courier_service', required
    - `options` object, required
      - `preferred_courier_service_ids` string[], required: List of courier service IDs based on Courier Service API
  - ActionForceIncotermsCreate: Taxes & duties
    - `type` 'force_incoterms', required
    - `options` object, required
      - `incoterms` 'DDP' | 'DDU' | 'DDU_and_Best_DDP' | 'DDP_and_Best_DDU', required: "DDP": "Pre-paid (included in shipping cost)"<br> "DDU": "Post-paid (not included in shipping cost)"<br> "DDU_and_Best_DDP": "Offer 3 post-paid and 1 pre-paid shipping options (for checkout only)"<br> "DDP_and_Best_DDU": "Offer 1 post-paid and 3 pre-paid shipping options
  - ActionForceSortByCreate: Sort couriers by total_charge, delivery_time_rank or value_for_money_rank
    - `type` 'force_sort_by', required
    - `options` object, required
      - `sort_by` 'total_charge' | 'delivery_time_rank' | 'value_for_money_rank', required: total_charge: Cheapest delivery_time_rank: Fastest value_for_money_rank: Best value for money
  - ActionForceInsuranceCreate: Force applying insurance
    - `type` 'force_insurance', required
    - `options` object, required
      - `insured` boolean, required
  - ActionForceTrackingRatingCreate: Filter couriers by tracking quality **Note:** this option is very restrictive and you may not see rates. Please make sure to verify the items selected.
    - `type` 'force_tracking_rating', required
    - `options` object, required
      - `force_tracking_rating` integer[], required: List of tracking ratings to use For example: to filter out couriers with `limited` or `basic` tracking you'd set `force_tracking_rating` to `[2, 3]`
  - ActionForcePackageCreate: Use package
    - `type` 'force_package', required
    - `options` union, required
      - object
        - `force_box_id` string, uuid, required: Box ID based on Box API. Box type is 'box'.
      - object
        - `force_flat_rate_box_id` string, uuid, required: Box ID based on Box API. Box type is 'flat_rate_box'.
  - ActionRejectPackagesCreate: Exclude specified boxes
    - `type` 'reject_packages', required
    - `options` object, required
      - `never_package_ids` string[], required: Box IDs based on Box API.
  - ActionForceResidentialSurchargeCreate: Declare destination address as residential.
    - `type` 'force_residential_surcharge', required
    - `options` object, required
      - `set_as_residential` boolean, required
  - ActionForceShipFromCreate: Ship From
    - `type` 'force_ship_from', required
    - `options` object, required
      - `origin_address_id` string, uuid, required: Address ID based on Address API.
  - ActionForceAutomatedReturnRequestedCreate: Return labels for domestic shipments
    - `type` 'force_automated_return_requested', required
    - `options` object, required
      - `force_automated_return_requested` boolean, required
  - ActionAddForcedDeliveryTimeCreate: Restrict courier services based on delivery time
    - `type` 'add_forced_delivery_time', required
    - `options` object, required
      - `operator` 'less_than' | 'less_than_or_equal_to' | 'greater_than_or_equal_to' | 'greater_than', required: Operators for comparison include less than (<), less than or equal to (<=), greater than or equal to (>=), and greater than (>)
      - `value` integer, required: How many days

## Response `201`

action successfully created

- ShippingRuleActionSingle: Shipping Rule Action detail
  - `action` union
    - ActionAddNeverCourier: Never add specific courier services
      - `type` 'add_never_courier_service', required
      - `options` object, required
        - `never_courier_service_ids` string[], required: List of courier service IDs based on Courier Service API
      - `id` string, uuid
    - ActionAddPreferredCourier: Use preferred courier services
      - `type` 'add_preferred_courier_service', required
      - `options` object, required
        - `preferred_courier_service_ids` string[], required: List of courier service IDs based on Courier Service API
      - `id` string, uuid
    - ActionForceIncoterms: Taxes & duties
      - `type` 'force_incoterms', required
      - `options` object, required
        - `incoterms` 'DDP' | 'DDU' | 'DDU_and_Best_DDP' | 'DDP_and_Best_DDU', required: "DDP": "Pre-paid (included in shipping cost)"<br> "DDU": "Post-paid (not included in shipping cost)"<br> "DDU_and_Best_DDP": "Offer 3 post-paid and 1 pre-paid shipping options (for checkout only)"<br> "DDP_and_Best_DDU": "Offer 1 post-paid and 3 pre-paid shipping options
      - `id` string, uuid
    - ActionForceSortBy: Sort couriers by total_charge, delivery_time_rank or value_for_money_rank
      - `type` 'force_sort_by', required
      - `options` object, required
        - `sort_by` 'total_charge' | 'delivery_time_rank' | 'value_for_money_rank', required: total_charge: Cheapest delivery_time_rank: Fastest value_for_money_rank: Best value for money
      - `id` string, uuid
    - ActionForceInsurance: Force applying insurance
      - `type` 'force_insurance', required
      - `options` object, required
        - `insured` boolean, required
      - `id` string, uuid
    - ActionForceTrackingRating: Filter couriers by tracking quality **Note:** this option is very restrictive and you may not see rates. Please make sure to verify the items selected.
      - `type` 'force_tracking_rating', required
      - `options` object, required
        - `force_tracking_rating` integer[], required: List of tracking ratings to use For example: to filter out couriers with `limited` or `basic` tracking you'd set `force_tracking_rating` to `[2, 3]`
      - `id` string, string
    - ActionForcePackage: Use package
      - `type` 'force_package', required
      - `options` union, required
        - object
          - `force_box_id` string, uuid, required: Box ID based on Box API. Box type is 'box'.
        - object
          - `force_flat_rate_box_id` string, uuid, required: Box ID based on Box API. Box type is 'flat_rate_box'.
      - `id` string, uuid
    - ActionRejectPackages: Exclude specified boxes
      - `type` 'reject_packages', required
      - `options` object, required
        - `never_package_ids` string[], required: Box IDs based on Box API.
      - `id` string, uuid
    - ActionForceResidentialSurcharge: Declare destination address as residential.
      - `type` 'force_residential_surcharge', required
      - `options` object, required
        - `set_as_residential` boolean, required
      - `id` string, uuid
    - ActionForceShipFrom: Ship From
      - `type` 'force_ship_from', required
      - `options` object, required
        - `origin_address_id` string, uuid, required: Address ID based on Address API.
      - `id` string, uuid
    - ActionForceAutomatedReturnRequested: Return labels for domestic shipments
      - `type` 'force_automated_return_requested', required
      - `options` object, required
        - `force_automated_return_requested` boolean, required
      - `id` string, uuid
    - ActionAddForcedDeliveryTime: Restrict courier services based on delivery time
      - `type` 'add_forced_delivery_time', required
      - `options` object, required
        - `operator` 'less_than' | 'less_than_or_equal_to' | 'greater_than_or_equal_to' | 'greater_than', required: Operators for comparison include less than (<), less than or equal to (<=), greater than or equal to (>=), and greater than (>)
        - `value` integer, required: How many days
      - `id` string, uuid
  - `meta` Meta
    - `request_id` string: An unique ID represent the request.

## Other responses

- `422`: invalid content

## Changes

- **2026-11-03** `b47b54b748a7`: 3 breaking, 1 warning, 4 info
  - the request property `oneOf[#/components/schemas/ActionForceAutomatedReturnRequestedCreate]/options/force_automated_return_requested` became required
  - removed `subschema #1, subschema #2` from the `oneOf[#/components/schemas/ActionForcePackageCreate]/options` request property `oneOf` list
  - added `subschema #1, subschema #2` to the `action/oneOf[#/components/schemas/ActionForcePackage]/allOf[#/components/schemas/ActionForcePackageCreate]/options` response property `oneOf` list for the response status `201`
  - added the new `-1.00` enum value to the `action/oneOf[#/components/schemas/ActionForceTrackingRating]/allOf[#/components/schemas/ActionForceTrackingRatingCreate]/options/force_tracking_rating/items/` response property for the response status `201`
  - …4 more

[Operation history](https://skmtc.dev/easyship/apis/easyship-public-api/changes/2024-09/shipping_rules/:shipping_rule_id/actions/post.md)

---

[API](https://skmtc.dev/easyship/apis/easyship-public-api.md) - [All operations](https://skmtc.dev/easyship/apis/easyship-public-api/llms.txt) - [OpenAPI document](https://skmtc.dev/easyship/apis/easyship-public-api/revisions/b47b54b748a7?raw)
