The Shipping Rule object

Attributes

id string

Unique identifier for the object.

created_at string

ISO 8601 timestamp of when the object was created.

updated_at string

ISO 8601 timestamp of when the object was last updated.

label string required
disabled boolean

Default: false

shipping_rule_type string
company string required
account string required
cost_center string required
calculate_based_on string

Default: Fixed

shipping_amount number
project string
The Shipping Rule object
{
  "id": "shipping-rule_abc123",
  "created_at": "2024-01-15T09: 30: 00Z",
  "updated_at": "2024-01-15T09: 30: 00Z",
  "label": "label_example",
  "disabled": false,
  "shipping_rule_type": "shipping_rule_type_example",
  "company": "Example Corp",
  "account": "account_example",
  "cost_center": "cost_center_example",
  "calculate_based_on": "Fixed",
  "shipping_amount": 0,
  "project": "project_example"
}
GET /api/accounts/shipping-rule/{id}

Retrieve a shipping rule

Retrieves the details of an existing shipping rule. Supply the unique shipping rule ID that was returned from a previous request.

Path parameters

id string required

The identifier of the shipping rule to retrieve.

Returns

Returns the shipping rule object if a valid identifier was provided.

GET /api/accounts/shipping-rule/{id}
curl https://api.overplane.dev/api/accounts/shipping-rule/shipping-rule_abc123 \
  -H "Authorization: Bearer sk_test_..."
Response
{
  "id": "shipping-rule_abc123",
  "created_at": "2024-01-15T09: 30: 00Z",
  "updated_at": "2024-01-15T09: 30: 00Z",
  "label": "label_example",
  "disabled": false,
  "shipping_rule_type": "shipping_rule_type_example",
  "company": "Example Corp",
  "account": "account_example",
  "cost_center": "cost_center_example",
  "calculate_based_on": "Fixed",
  "shipping_amount": 0,
  "project": "project_example"
}
GET /api/accounts/shipping-rule

List all shipping rules

Returns a list of shipping rules. The results are sorted by creation date, with the most recently created appearing first.

Query parameters

limit integer

Maximum number of objects to return. Default: 20.

offset integer

Number of objects to skip for pagination. Default: 0.

Returns

A paginated list of shipping rule objects.

GET /api/accounts/shipping-rule
curl https://api.overplane.dev/api/accounts/shipping-rule \
  -H "Authorization: Bearer sk_test_..."
Response
{
  "data": [
    {
      "id": "shipping-rule_abc123",
      "created_at": "2024-01-15T09: 30: 00Z",
      "updated_at": "2024-01-15T09: 30: 00Z",
      "label": "label_example",
      "disabled": false,
      "shipping_rule_type": "shipping_rule_type_example",
      "company": "Example Corp",
      "account": "account_example",
      "cost_center": "cost_center_example",
      "calculate_based_on": "Fixed",
      "shipping_amount": 0,
      "project": "project_example"
    }
  ],
  "has_more": false,
  "total": 1
}
POST /api/accounts/shipping-rule

Create a shipping rule

Creates a new shipping rule object.

Body parameters

label string required
disabled boolean

Default: false

shipping_rule_type string
company string required
account string required
cost_center string required
calculate_based_on string

Default: Fixed

shipping_amount number
project string

Returns

Returns the newly created shipping rule object if the call succeeded.

POST /api/accounts/shipping-rule
curl https://api.overplane.dev/api/accounts/shipping-rule \
  -H "Authorization: Bearer sk_test_..." \
  -X POST \
  -H "Content-Type: application/json" \
  -d '{"label":"label_example","company":"Example Corp","account":"account_example","cost_center":"cost_center_example"}'
Response
{
  "id": "shipping-rule_abc123",
  "created_at": "2024-01-15T09: 30: 00Z",
  "updated_at": "2024-01-15T09: 30: 00Z",
  "label": "label_example",
  "disabled": false,
  "shipping_rule_type": "shipping_rule_type_example",
  "company": "Example Corp",
  "account": "account_example",
  "cost_center": "cost_center_example",
  "calculate_based_on": "Fixed",
  "shipping_amount": 0,
  "project": "project_example"
}
PATCH /api/accounts/shipping-rule/{id}

Update a shipping rule

Updates the specified shipping rule by setting the values of the parameters passed. Any parameters not provided will be left unchanged.

Path parameters

id string required

The identifier of the shipping rule to update.

Body parameters

label string
disabled boolean

Default: false

shipping_rule_type string
company string
account string
cost_center string
calculate_based_on string

Default: Fixed

shipping_amount number
project string

Returns

Returns the updated shipping rule object.

PATCH /api/accounts/shipping-rule/{id}
curl https://api.overplane.dev/api/accounts/shipping-rule/shipping-rule_abc123 \
  -H "Authorization: Bearer sk_test_..." \
  -X PATCH \
  -H "Content-Type: application/json" \
  -d '{"label":"label_example","disabled":false}'
Response
{
  "id": "shipping-rule_abc123",
  "created_at": "2024-01-15T09: 30: 00Z",
  "updated_at": "2024-01-15T09: 30: 00Z",
  "label": "label_example",
  "disabled": false,
  "shipping_rule_type": "shipping_rule_type_example",
  "company": "Example Corp",
  "account": "account_example",
  "cost_center": "cost_center_example",
  "calculate_based_on": "Fixed",
  "shipping_amount": 0,
  "project": "project_example"
}
DELETE /api/accounts/shipping-rule/{id}

Delete a shipping rule

Permanently deletes a shipping rule. This cannot be undone.

Path parameters

id string required

The identifier of the shipping rule to delete.

Returns

Returns a confirmation that the shipping rule has been deleted.

DELETE /api/accounts/shipping-rule/{id}
curl https://api.overplane.dev/api/accounts/shipping-rule/shipping-rule_abc123 \
  -H "Authorization: Bearer sk_test_..." \
  -X DELETE
Response
{
  "id": "shipping-rule_abc123",
  "deleted": true
}

Line items

Child objects that belong to this shipping rule. These are accessed via the parent's ID.

Shipping Rule Condition

Attributes

idx integer
shipping_rule_id string required
from_value number required
to_value number
shipping_amount number required

Endpoints

GET /api/accounts/shipping-rule-condition?parent_id={id}
POST /api/accounts/shipping-rule-condition
PATCH /api/accounts/shipping-rule-condition/{id}
DELETE /api/accounts/shipping-rule-condition/{id}
POST /api/accounts/shipping-rule-condition/reorder
Shipping Rule Condition object
{
  "id": "shipping-rule-condition_abc123",
  "idx": 1,
  "shipping_rule_id": "shipping_rule_id_example",
  "from_value": 0,
  "to_value": 0,
  "shipping_amount": 0
}

Shipping Rule Country

Attributes

idx integer
shipping_rule_id string required
country string required

Endpoints

GET /api/accounts/shipping-rule-country?parent_id={id}
POST /api/accounts/shipping-rule-country
PATCH /api/accounts/shipping-rule-country/{id}
DELETE /api/accounts/shipping-rule-country/{id}
POST /api/accounts/shipping-rule-country/reorder
Shipping Rule Country object
{
  "id": "shipping-rule-country_abc123",
  "idx": 1,
  "shipping_rule_id": "shipping_rule_id_example",
  "country": "country_example"
}