Shipping
Shipping zones and the methods they offer.
Shipping zones and the methods they offer. See Shipping.
List shipping zones
/api/v1/kahunacart/shipping/zones
Every shipping zone in the merchant's own order, with its country, region and postcode criteria decoded and the delivery methods it offers. Method costs and free-shipping thresholds come back as decimal strings in the store currency. On a store that sells in more than one currency each method also carries currency_amounts (its rates in the other currencies), priced_in (the currencies it is offered in, the base first) and missing_in (per currency it is not offered in, the fields that are missing).
Create a shipping zone
/api/v1/kahunacart/shipping/zones
Create a shipping zone and the methods it offers. A name is required and an unknown method type is refused with 422. min_total is the free-shipping threshold and is genuinely nullable: leaving it empty means the method is always offered, which is not the same as a threshold of zero.
Parameters
| Name | Type | Description |
|---|---|---|
| name required | string | |
| countries optional | array of string | ISO country codes; empty matches every country |
| regions optional | array of string | States or provinces, as an ISO 3166-2 code or a name |
| postcodes optional | array of string | |
| position optional | integer | The merchant's own sort order for the zone list |
| methods optional | array of object | The delivery options this zone offers. Keys: `type`, `label`, `enabled`, `cost`, `per_class`, `class_costs_mode`, `weight_rules`, `min_total`, `free_mode`, `free_minimum`, `free_minimum_before_discount`, `free_minimum_shipped_only`, `free_minimum_charges_below`, `position`, `translations`, `currency_amounts` |
Update a shipping zone
/api/v1/kahunacart/shipping/zones/{id}
Change a zone's fields. Sending methods writes the zone's whole set of methods: send each existing method back with its id and it is edited in place and keeps that id, leave the id off and a new method is created, and any method you leave out is deleted. Send each method's translations back unchanged too, because the whole set is written and a language you leave out is a language you have removed. Omitting methods leaves every method standing.
Parameters
| Name | Type | Description |
|---|---|---|
| id required | integer | Shipping zone id |
| name optional | string | |
| countries optional | array of string | |
| regions optional | array of string | |
| postcodes optional | array of string | |
| position optional | integer | |
| methods optional | array of object | Writes the whole set when present. Keys: `id`, `type`, `label`, `enabled`, `cost`, `per_class`, `class_costs_mode`, `weight_rules`, `min_total`, `free_mode`, `free_minimum`, `free_minimum_before_discount`, `free_minimum_shipped_only`, `free_minimum_charges_below`, `position`, `translations` |
Delete a shipping zone
/api/v1/kahunacart/shipping/zones/{id}
Delete a shipping zone and the methods it offered. Orders already placed keep the postage they were charged.
Parameters
| Name | Type | Description |
|---|---|---|
| id required | integer | Shipping zone id |
Zone fields are name, countries, regions, postcodes and position. A method takes type (flat, free or pickup), label, enabled, cost, per_class, weight_rules, min_total and position. An unknown type is a 422. min_total is genuinely nullable: an empty value means "always offered", which a stored zero would not say. Methods are re-inserted on every zone update, so their ids change. Send their translations back in the payload to carry the overrides across.