Create a shipping rule
POST
/rules
const url = 'https://shipjay.com/api/v1/rules';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"name":"example","phase":"shipment","priority":100,"enabled":true,"stop_on_match":false,"conditions":{"all":[]},"actions":[{"type":"block","message":"example"}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://shipjay.com/api/v1/rules \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "name": "example", "phase": "shipment", "priority": 100, "enabled": true, "stop_on_match": false, "conditions": { "all": [] }, "actions": [ { "type": "block", "message": "example" } ] }'Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
name
required
string
phase
required
string
priority
integer
enabled
boolean
stop_on_match
boolean
conditions
Any of:
actions
required
Array
One of:
object
type
required
string
message
required
string
object
type
required
string
object
type
required
string
amount_cents
required
integer
object
type
required
string
carrier
required
string
object
type
required
string
contains
required
string
object
type
required
string
cents
required
integer
object
type
required
string
days
required
integer
object
type
required
string
strategy
required
string
carrier
string
Responses
Section titled “Responses”Success.
Media typeapplication/json
object
id
required
string
Example generated
{ "id": "example"}Missing or invalid API key.
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
details
object
key
additional properties
any
request_id
required
string
Example
{ "error": { "code": "validation" }}The key lacks the required permission, or the account is suspended.
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
details
object
key
additional properties
any
request_id
required
string
Example
{ "error": { "code": "validation" }}The resource does not exist.
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
details
object
key
additional properties
any
request_id
required
string
Example
{ "error": { "code": "validation" }}The request is not valid. error.details.issues lists the problems.
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
details
object
key
additional properties
any
request_id
required
string
Example
{ "error": { "code": "validation" }}Too many requests. Wait Retry-After seconds.
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
details
object
key
additional properties
any
request_id
required
string
Example
{ "error": { "code": "validation" }}© 2026 Ship Jay. All rights reserved. Created & Developed by WCWS Internet
