Skip to main content
POST
/
shipping-rules
Create a shipping rule
curl --request POST \
  --url https://api.arcuserp.com/v1/shipping-rules \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "priority": 10,
  "is_active": true,
  "location_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "sales_channel_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "product_category_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "min_weight": 0,
  "max_weight": 999999,
  "item_count_min": 123,
  "item_count_max": 123,
  "shipping_tokens": [
    "<string>"
  ],
  "preferred_service_token": "<string>",
  "preferred_carrier": "<string>",
  "free_shipping_threshold": 123,
  "flat_rate": 123,
  "auto_buy": false,
  "absorb_cost": true,
  "outcome": "<string>",
  "condition": {},
  "actions": {},
  "external_source": "<string>",
  "external_id": "<string>"
}
'
import requests

url = "https://api.arcuserp.com/v1/shipping-rules"

payload = {
    "name": "<string>",
    "priority": 10,
    "is_active": True,
    "location_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "sales_channel_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "product_category_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "min_weight": 0,
    "max_weight": 999999,
    "item_count_min": 123,
    "item_count_max": 123,
    "shipping_tokens": ["<string>"],
    "preferred_service_token": "<string>",
    "preferred_carrier": "<string>",
    "free_shipping_threshold": 123,
    "flat_rate": 123,
    "auto_buy": False,
    "absorb_cost": True,
    "outcome": "<string>",
    "condition": {},
    "actions": {},
    "external_source": "<string>",
    "external_id": "<string>"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: JSON.stringify({
    name: '<string>',
    priority: 10,
    is_active: true,
    location_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
    sales_channel_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
    product_category_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
    min_weight: 0,
    max_weight: 999999,
    item_count_min: 123,
    item_count_max: 123,
    shipping_tokens: ['<string>'],
    preferred_service_token: '<string>',
    preferred_carrier: '<string>',
    free_shipping_threshold: 123,
    flat_rate: 123,
    auto_buy: false,
    absorb_cost: true,
    outcome: '<string>',
    condition: {},
    actions: {},
    external_source: '<string>',
    external_id: '<string>'
  })
};

fetch('https://api.arcuserp.com/v1/shipping-rules', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.arcuserp.com/v1/shipping-rules",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => json_encode([
    'name' => '<string>',
    'priority' => 10,
    'is_active' => true,
    'location_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
    'sales_channel_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
    'product_category_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
    'min_weight' => 0,
    'max_weight' => 999999,
    'item_count_min' => 123,
    'item_count_max' => 123,
    'shipping_tokens' => [
        '<string>'
    ],
    'preferred_service_token' => '<string>',
    'preferred_carrier' => '<string>',
    'free_shipping_threshold' => 123,
    'flat_rate' => 123,
    'auto_buy' => false,
    'absorb_cost' => true,
    'outcome' => '<string>',
    'condition' => [
        
    ],
    'actions' => [
        
    ],
    'external_source' => '<string>',
    'external_id' => '<string>'
  ]),
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer <token>",
    "Content-Type: application/json"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.arcuserp.com/v1/shipping-rules"

	payload := strings.NewReader("{\n  \"name\": \"<string>\",\n  \"priority\": 10,\n  \"is_active\": true,\n  \"location_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n  \"sales_channel_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n  \"product_category_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n  \"min_weight\": 0,\n  \"max_weight\": 999999,\n  \"item_count_min\": 123,\n  \"item_count_max\": 123,\n  \"shipping_tokens\": [\n    \"<string>\"\n  ],\n  \"preferred_service_token\": \"<string>\",\n  \"preferred_carrier\": \"<string>\",\n  \"free_shipping_threshold\": 123,\n  \"flat_rate\": 123,\n  \"auto_buy\": false,\n  \"absorb_cost\": true,\n  \"outcome\": \"<string>\",\n  \"condition\": {},\n  \"actions\": {},\n  \"external_source\": \"<string>\",\n  \"external_id\": \"<string>\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.arcuserp.com/v1/shipping-rules")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"<string>\",\n  \"priority\": 10,\n  \"is_active\": true,\n  \"location_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n  \"sales_channel_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n  \"product_category_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n  \"min_weight\": 0,\n  \"max_weight\": 999999,\n  \"item_count_min\": 123,\n  \"item_count_max\": 123,\n  \"shipping_tokens\": [\n    \"<string>\"\n  ],\n  \"preferred_service_token\": \"<string>\",\n  \"preferred_carrier\": \"<string>\",\n  \"free_shipping_threshold\": 123,\n  \"flat_rate\": 123,\n  \"auto_buy\": false,\n  \"absorb_cost\": true,\n  \"outcome\": \"<string>\",\n  \"condition\": {},\n  \"actions\": {},\n  \"external_source\": \"<string>\",\n  \"external_id\": \"<string>\"\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://api.arcuserp.com/v1/shipping-rules")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"name\": \"<string>\",\n  \"priority\": 10,\n  \"is_active\": true,\n  \"location_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n  \"sales_channel_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n  \"product_category_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n  \"min_weight\": 0,\n  \"max_weight\": 999999,\n  \"item_count_min\": 123,\n  \"item_count_max\": 123,\n  \"shipping_tokens\": [\n    \"<string>\"\n  ],\n  \"preferred_service_token\": \"<string>\",\n  \"preferred_carrier\": \"<string>\",\n  \"free_shipping_threshold\": 123,\n  \"flat_rate\": 123,\n  \"auto_buy\": false,\n  \"absorb_cost\": true,\n  \"outcome\": \"<string>\",\n  \"condition\": {},\n  \"actions\": {},\n  \"external_source\": \"<string>\",\n  \"external_id\": \"<string>\"\n}"

response = http.request(request)
puts response.read_body
{}
{
  "error": "not_found",
  "code": "not_found",
  "type": "not_found",
  "hint": "The requested order does not exist or does not belong to this entity.",
  "param": "expand[0]",
  "required": "accounts:read",
  "request_id": "req_abc123"
}
{
  "error": "not_found",
  "code": "not_found",
  "type": "not_found",
  "hint": "The requested order does not exist or does not belong to this entity.",
  "param": "expand[0]",
  "required": "accounts:read",
  "request_id": "req_abc123"
}

Authorizations

Authorization
string
header
required

API key issued per entity via Settings > Developers > API Keys. Each key carries scopes (e.g. orders:read, products:write). Bearer token format: Authorization: Bearer ark_live_ent_ Test keys use ark_test_ent_. Both are issued per entity via Settings > Developers > API Keys.

Headers

Idempotency-Key
string

Client-generated unique key for idempotent POST/PATCH/DELETE operations. Alias for the Idempotency parameter. Max 255 chars. On retry with the same key, the original response is returned without re-executing the operation. Keys expire after 24 hours.

Maximum string length: 255

Body

application/json
name
string
required
priority
integer
default:10

Lower runs first.

is_active
boolean
default:true
location_id
string<uuid> | null

Layer 4 per-location scope. NULL = entity-wide.

sales_channel_id
string<uuid> | null

Source-channel condition. NULL = applies to all channels.

product_category_id
string<uuid> | null

Category condition. When set, the rule wins over a non-category rule even at higher priority (TUF-TITE pattern).

min_weight
number
default:0

Inclusive weight band lower bound (lb).

max_weight
number
default:999999

Inclusive weight band upper bound (lb).

item_count_min
integer | null

Inclusive item-count band lower bound. NULL = no filter.

item_count_max
integer | null

Inclusive item-count band upper bound. NULL = no filter.

shipping_tokens
string[]

Allowed Shippo carrier service tokens. First = primary suggestion when preferred_service_token is unset.

preferred_service_token
string | null

Primary suggested Shippo service token (e.g. usps_ground_advantage).

preferred_carrier
string | null

Primary suggested carrier (USPS/UPS/FedEx/DHL Express).

free_shipping_threshold
number | null
flat_rate
number | null
auto_buy
boolean
default:false

When true and the rule resolves to one unambiguous service, Pack-with-Arcus auto-purchases the label.

absorb_cost
boolean | null

Per-rule cost-absorption override. NULL = use entity default; true = absorb (Freight Out GL); false = charge customer.

outcome
string | null

Freight-rule outcome (force_freight/force_parcel/etc). Presence marks a freight rule rather than a carrier-routing rule.

condition
object | null

Freight-rule condition JSONB (validated).

actions
object

Freight-rule actions (block_message / accessorials).

external_source
string | null

Migration provenance tag.

external_id
string | null

Response

Shipping rule created

The response is of type object.