---
title: "Update Action of a Shipping Rule"
method: PATCH
path: "/2024-11/actions/{action_id}"
tags: ["Shipping Rule's Actions"]
---

# Update Action of a Shipping Rule

`PATCH /2024-11/actions/{action_id}`

## Request

- Base URL: `https://enterprise-api.easyship.com`
- URL: `https://enterprise-api.easyship.com/2024-11/actions/{action_id}`
- Auth: OAuth 2
  - Client credentials
  - Token URL: `https://enterprise-api.easyship.com/oauth2/token` scopes: `enterprise.shipping_rule`

Update shipping rule action.

Required authorization scope: `enterprise.shipping_rule:write`

## Path parameters

- `action_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: Box ID based on Box API. Box type is 'box'.
      - object
        - `force_flat_rate_box_id` string, uuid: 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
  - 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 `200`

action successfully updated

- 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: Box ID based on Box API. Box type is 'box'.
        - object
          - `force_flat_rate_box_id` string, uuid: 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
      - `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

- `403`: unauthorized
- `404`: record not found
- `422`: invalid content

---

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