Create Automation Rule

This endpoint adds a new automation rule to the ruleset.

SecurityOAuth2
Request
path Parameters
automation-ruleset-id
required
string
header Parameters
x-api-key
string
tenant-id
string
Content-Type
string
Default: application/json
Request Body schema: application/json
rule_name
required
string
required
Array of objects

Carrier accounts result

carrier_choice
string

Mandatory if 'carrier_accounts' contains more than 1 entry. Used to select the best carrier

Value: "CHEAPEST_CARRIER"
sequence
required
number

Sequence number used for rules prioritisation (lower is more important)

description
string
status
required
string (status-field)
Enum: "ACTIVE" "INACTIVE" "DELETED"
object

shipment.source.source_type matches condition

object

shipment.payment.payment_type matches condition

object

shipment.delivery.delivery_type matches condition

object

shipment.order_type matches condition

object

shipment.merchant matches condition

object

shipment.pickup.partner_location_id matches condition

object

shipment.dropoff.partner_location_id matches condition

object

shipment.dropoff country state city area condition

object

shipment.pickup country state city area condition

object

shipment.parcels volumetric weight is inside range

object

shipment.parcels gross weight is inside range

object

shipment.parcels chargeable (gross or volumetric which higher) weight is inside range

object

shipment.parcels items count is inside range

object

shipment.custom_attributes matches condition

order_value_min
required
number

shipment.payment.total_amount not less. Use -1 value for infinite

order_value_max
required
number

shipment.payment.total_amount not more. Use -1 value for infinite

dangerous_goods
boolean

shipment.[items].dangerous_goods is any item matches

start_time
number

Time range when rule applies

end_time
number

Time range when rule applies

days
Array of strings

Days when rule applies

Items Enum: "MONDAY" "TUESDAY" "WEDNESDAY" "THURSDAY" "FRIDAY" "SATURDAY" "SUNDAY"
customer_address_verified
boolean

Customer is verified or not

Responses
200
post/automation-rulesets/{automation-ruleset-id}/rules
Request samples
application/json
{
  • "rule_name": "string",
  • "carrier_accounts": [
    ],
  • "carrier_choice": "CHEAPEST_CARRIER",
  • "sequence": 0,
  • "description": "string",
  • "status": "ACTIVE",
  • "source_type": {
    },
  • "payment_type": {
    },
  • "delivery_type": {
    },
  • "order_type": {
    },
  • "merchant": {
    },
  • "pickup_partner_location_ids": {
    },
  • "dropoff_partner_location_ids": {
    },
  • "dropoff_v2": {
    },
  • "pickup_v2": {
    },
  • "volumetric_weight": {
    },
  • "gross_weight": {
    },
  • "chargeable_weight": {
    },
  • "parcel_count": {
    },
  • "custom_conditions": {
    },
  • "order_value_min": 0,
  • "order_value_max": 0,
  • "dangerous_goods": true,
  • "start_time": 0,
  • "end_time": 0,
  • "days": [
    ],
  • "customer_address_verified": true
}
Response samples
application/json
{
  • "tenant": "string",
  • "rule_id": "string",
  • "rule_set_id": "string",
  • "rule_name": "string",
  • "carrier_accounts": [
    ],
  • "carrier_choice": "CHEAPEST_CARRIER",
  • "sequence": 0,
  • "description": "string",
  • "status": "ACTIVE",
  • "source_type": {
    },
  • "payment_type": {
    },
  • "delivery_type": {
    },
  • "order_type": {
    },
  • "merchant": {
    },
  • "pickup_partner_location_ids": {
    },
  • "dropoff_partner_location_ids": {
    },
  • "dropoff_v2": {
    },
  • "pickup_v2": {
    },
  • "volumetric_weight": {
    },
  • "gross_weight": {
    },
  • "chargeable_weight": {
    },
  • "parcel_count": {
    },
  • "custom_conditions": {
    },
  • "order_value_min": 0,
  • "order_value_max": 0,
  • "dangerous_goods": true,
  • "start_time": 0,
  • "end_time": 0,
  • "days": [
    ],
  • "customer_address_verified": true,
  • "creation_date": "2019-08-24T14:15:22Z",
  • "update_date": "2019-08-24T14:15:22Z"
}