cURL
curl -X POST "$EXSITED_BASE_URL/api/v4/settings/shipping_rules/sr_7f8091a2b3c4d5e6f708192a3b4c5d6e/configuration" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"configuration": {
"zones": [
{
"zone": "0a1b2c3d-4e5f-6071-8293-a4b5c6d7e8f9"
}
],
"rate": {
"name": "Flat rate",
"method": "FLAT_RATE",
"handling_cost": 1,
"shipping_cost": 5
}
}
}'from exsited import build_client
client = build_client()
response = client.shipping_rules.create_settings_shipping_rule_configuration(
"sr_7f8091a2b3c4d5e6f708192a3b4c5d6e",
{
"configuration": {
"zones": [{"zone": "0a1b2c3d-4e5f-6071-8293-a4b5c6d7e8f9"}],
"rate": {
"name": "Flat rate",
"method": "FLAT_RATE",
"handling_cost": 1,
"shipping_cost": 5,
},
}
},
)
print(response.data)
import {buildClient} from 'exsited';
const client = await buildClient();
const response = await client.shippingRules.createSettingsShippingRuleConfiguration(
'sr_7f8091a2b3c4d5e6f708192a3b4c5d6e',
{
configuration: {
zones: [{zone: '0a1b2c3d-4e5f-6071-8293-a4b5c6d7e8f9'}],
rate: {name: 'Flat rate', method: 'FLAT_RATE', handling_cost: 1, shipping_cost: 5},
},
},
);
console.log(response.data);
use Exsited\Client\ClientRegistry;
$client = ClientRegistry::buildClient();
$response = $client->shippingRules->createSettingsShippingRuleConfiguration(
'sr_7f8091a2b3c4d5e6f708192a3b4c5d6e',
[
'configuration' => [
'zones' => [['zone' => '0a1b2c3d-4e5f-6071-8293-a4b5c6d7e8f9']],
'rate' => [
'name' => 'Flat rate',
'method' => 'FLAT_RATE',
'handling_cost' => 1,
'shipping_cost' => 5,
],
],
],
);
print_r($response->data);
import com.exsited.client.ApiResponse;
import com.exsited.client.ClientRegistry;
import com.exsited.client.ExsitedClient;
import com.exsited.resources.shipping_rules.shipping_rules_dto.ShippingRulesDto.SettingsShippingRule;
import java.util.List;
import java.util.Map;
ExsitedClient client = ClientRegistry.buildClient();
ApiResponse<SettingsShippingRule> response = client.shippingRules().createSettingsShippingRuleConfiguration(
"sr_7f8091a2b3c4d5e6f708192a3b4c5d6e",
Map.of(
"configuration", Map.of(
"zones", List.of(Map.of("zone", "0a1b2c3d-4e5f-6071-8293-a4b5c6d7e8f9")),
"rate", Map.of(
"name", "Flat rate",
"method", "FLAT_RATE",
"handling_cost", 1,
"shipping_cost", 5))));
System.out.println(response.getMap());
using Exsited.Client;
await using var client = ExsitedClient.BuildClient();
var response = await client.ShippingRules.CreateSettingsShippingRuleConfigurationAsync(
"sr_7f8091a2b3c4d5e6f708192a3b4c5d6e",
new Dictionary<string, object?>
{
["configuration"] = new Dictionary<string, object?>
{
["zones"] = new List<object?>
{
new Dictionary<string, object?>
{
["zone"] = "0a1b2c3d-4e5f-6071-8293-a4b5c6d7e8f9",
},
},
["rate"] = new Dictionary<string, object?>
{
["name"] = "Flat rate",
["method"] = "FLAT_RATE",
["handling_cost"] = 1,
["shipping_cost"] = 5,
},
},
});
Console.WriteLine(response.Json);
import 'package:exsited/exsited.dart';
final client = buildClient();
final response = await client.shippingRules
.createSettingsShippingRuleConfiguration(
'sr_7f8091a2b3c4d5e6f708192a3b4c5d6e',
{
'configuration': {
'zones': [
{'zone': '0a1b2c3d-4e5f-6071-8293-a4b5c6d7e8f9'},
],
'rate': {
'name': 'Flat rate',
'method': 'FLAT_RATE',
'handling_cost': 1,
'shipping_cost': 5,
},
},
},
);
print(response.map);
import (
"context"
"fmt"
"log"
exsited "github.com/exsited/exsited-sdk-go/v4"
)
client, err := exsited.BuildClient(nil)
if err != nil {
log.Fatal(err)
}
defer client.Close()
response, err := client.ShippingRules().CreateSettingsShippingRuleConfiguration(context.Background(), "sr_7f8091a2b3c4d5e6f708192a3b4c5d6e", map[string]any{
"configuration": map[string]any{
"zones": []any{
map[string]any{
"zone": "0a1b2c3d-4e5f-6071-8293-a4b5c6d7e8f9",
},
},
"rate": map[string]any{
"name": "Flat rate",
"method": "FLAT_RATE",
"handling_cost": 1,
"shipping_cost": 5,
},
},
}, nil)
if err != nil {
log.Fatal(err)
}
fmt.Println(response.Map)
{
"shipping_rule": {
"configuration": {
"rate": "<unknown>",
"zones": "<array>"
},
"created_by": "<unknown>",
"created_on": "<string>",
"description": "<string>",
"href": "<string>",
"id": "<string>",
"last_updated_by": "<unknown>",
"last_updated_on": "<string>",
"name": "<string>",
"object": "<string>",
"shipping_class": "<unknown>",
"status": "<string>",
"version": 123
}
}{
"object": "<string>",
"request_id": "<string>",
"status": 123,
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"errors": [
{
"field": "<string>",
"code": "<string>",
"message": "<string>",
"doc_url": "<string>"
}
]
}Shipping rules
Set a shipping rule's configuration
Sets the zones and rate of a shipping rule and returns the rule.
POST
/
settings
/
shipping_rules
/
{shipping_rule_id}
/
configuration
cURL
curl -X POST "$EXSITED_BASE_URL/api/v4/settings/shipping_rules/sr_7f8091a2b3c4d5e6f708192a3b4c5d6e/configuration" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"configuration": {
"zones": [
{
"zone": "0a1b2c3d-4e5f-6071-8293-a4b5c6d7e8f9"
}
],
"rate": {
"name": "Flat rate",
"method": "FLAT_RATE",
"handling_cost": 1,
"shipping_cost": 5
}
}
}'from exsited import build_client
client = build_client()
response = client.shipping_rules.create_settings_shipping_rule_configuration(
"sr_7f8091a2b3c4d5e6f708192a3b4c5d6e",
{
"configuration": {
"zones": [{"zone": "0a1b2c3d-4e5f-6071-8293-a4b5c6d7e8f9"}],
"rate": {
"name": "Flat rate",
"method": "FLAT_RATE",
"handling_cost": 1,
"shipping_cost": 5,
},
}
},
)
print(response.data)
import {buildClient} from 'exsited';
const client = await buildClient();
const response = await client.shippingRules.createSettingsShippingRuleConfiguration(
'sr_7f8091a2b3c4d5e6f708192a3b4c5d6e',
{
configuration: {
zones: [{zone: '0a1b2c3d-4e5f-6071-8293-a4b5c6d7e8f9'}],
rate: {name: 'Flat rate', method: 'FLAT_RATE', handling_cost: 1, shipping_cost: 5},
},
},
);
console.log(response.data);
use Exsited\Client\ClientRegistry;
$client = ClientRegistry::buildClient();
$response = $client->shippingRules->createSettingsShippingRuleConfiguration(
'sr_7f8091a2b3c4d5e6f708192a3b4c5d6e',
[
'configuration' => [
'zones' => [['zone' => '0a1b2c3d-4e5f-6071-8293-a4b5c6d7e8f9']],
'rate' => [
'name' => 'Flat rate',
'method' => 'FLAT_RATE',
'handling_cost' => 1,
'shipping_cost' => 5,
],
],
],
);
print_r($response->data);
import com.exsited.client.ApiResponse;
import com.exsited.client.ClientRegistry;
import com.exsited.client.ExsitedClient;
import com.exsited.resources.shipping_rules.shipping_rules_dto.ShippingRulesDto.SettingsShippingRule;
import java.util.List;
import java.util.Map;
ExsitedClient client = ClientRegistry.buildClient();
ApiResponse<SettingsShippingRule> response = client.shippingRules().createSettingsShippingRuleConfiguration(
"sr_7f8091a2b3c4d5e6f708192a3b4c5d6e",
Map.of(
"configuration", Map.of(
"zones", List.of(Map.of("zone", "0a1b2c3d-4e5f-6071-8293-a4b5c6d7e8f9")),
"rate", Map.of(
"name", "Flat rate",
"method", "FLAT_RATE",
"handling_cost", 1,
"shipping_cost", 5))));
System.out.println(response.getMap());
using Exsited.Client;
await using var client = ExsitedClient.BuildClient();
var response = await client.ShippingRules.CreateSettingsShippingRuleConfigurationAsync(
"sr_7f8091a2b3c4d5e6f708192a3b4c5d6e",
new Dictionary<string, object?>
{
["configuration"] = new Dictionary<string, object?>
{
["zones"] = new List<object?>
{
new Dictionary<string, object?>
{
["zone"] = "0a1b2c3d-4e5f-6071-8293-a4b5c6d7e8f9",
},
},
["rate"] = new Dictionary<string, object?>
{
["name"] = "Flat rate",
["method"] = "FLAT_RATE",
["handling_cost"] = 1,
["shipping_cost"] = 5,
},
},
});
Console.WriteLine(response.Json);
import 'package:exsited/exsited.dart';
final client = buildClient();
final response = await client.shippingRules
.createSettingsShippingRuleConfiguration(
'sr_7f8091a2b3c4d5e6f708192a3b4c5d6e',
{
'configuration': {
'zones': [
{'zone': '0a1b2c3d-4e5f-6071-8293-a4b5c6d7e8f9'},
],
'rate': {
'name': 'Flat rate',
'method': 'FLAT_RATE',
'handling_cost': 1,
'shipping_cost': 5,
},
},
},
);
print(response.map);
import (
"context"
"fmt"
"log"
exsited "github.com/exsited/exsited-sdk-go/v4"
)
client, err := exsited.BuildClient(nil)
if err != nil {
log.Fatal(err)
}
defer client.Close()
response, err := client.ShippingRules().CreateSettingsShippingRuleConfiguration(context.Background(), "sr_7f8091a2b3c4d5e6f708192a3b4c5d6e", map[string]any{
"configuration": map[string]any{
"zones": []any{
map[string]any{
"zone": "0a1b2c3d-4e5f-6071-8293-a4b5c6d7e8f9",
},
},
"rate": map[string]any{
"name": "Flat rate",
"method": "FLAT_RATE",
"handling_cost": 1,
"shipping_cost": 5,
},
},
}, nil)
if err != nil {
log.Fatal(err)
}
fmt.Println(response.Map)
{
"shipping_rule": {
"configuration": {
"rate": "<unknown>",
"zones": "<array>"
},
"created_by": "<unknown>",
"created_on": "<string>",
"description": "<string>",
"href": "<string>",
"id": "<string>",
"last_updated_by": "<unknown>",
"last_updated_on": "<string>",
"name": "<string>",
"object": "<string>",
"shipping_class": "<unknown>",
"status": "<string>",
"version": 123
}
}{
"object": "<string>",
"request_id": "<string>",
"status": 123,
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"errors": [
{
"field": "<string>",
"code": "<string>",
"message": "<string>",
"doc_url": "<string>"
}
]
}Send the configuration under
configuration: zones lists each zone by its UUID with dashes in zone, and rate gives the rate’s name, method such as FLAT_RATE, handling_cost and shipping_cost.
The SDK samples get their client from credentials your app registers once when it starts, as shown in Authentication. To try the call here, click Try it, set
host to your Exsited API host name and paste an access token from Get an access token. To send a raw JSON body instead of filling in fields, copy the cURL sample and edit its -d payload.Authorizations
An access token from POST /api/v4/oauth2/token. The SDKs get and renew it for you.
Path Parameters
The shipping rule's id, from the listing.
Body
application/json
Show child attributes
Show child attributes
Response
The shipping rule with its configuration, under shipping_rule.
Show child attributes
Show child attributes