# Shipping Zone API Reference

Shipping zone object:

{
	"type": "shipping_zones",
	"id": "string|uuid",
	"attributes": {
		"title": "string",
		"description": "string",
		"rate": Float,
		"calculation_method": "string|in:all,each,product,variant",
		"countries": [
			{
				"code": "US",
				"provinces": ["CA", "NY"]
			},
			{
				"code": "CA"
			},
			...
		],
		"created_at": "string|datetime",
		"updated_at": "string|datetime"
	},
	"relationships": {
		"shipping": {
			"data": Object (Shipping Resource)
		},
		"shipping_rules": {
			"data": Array [Shipping Rule Resources]
		}
	}
}

Related resources: Shipping, Shipping Rule

# Writable fields

Field name Creating Updating
title required|string|min:1|max:255 string|min:1|max:255
description string|min:1|max:255 string|min:1|max:255
rate float|>=0 float|>=0
calculation_method string in:all,each,product,variant
countries array array

# Writable relationships

Relationship name Relationship resource type Type Creating Updating
shipping shippings To-one Yes - Required No

# Countries format

"countries" field must be an array of multiple objects. Each object MUST contain "code" member, code value is a valid ISO 3166 country code, and MAY contain "provinces" member (For US, CA, UK, AU countries only).

Example of countries field data:

[
	{
		"code": "US",
		"provinces": [
			"AZ", "NY", "CA"
		]
	},
	{
		"code": "DE"
	},
	{
		"code": "JP"
	}
]