Storeware Docs
REST

Shipping

The groups a shop sorts its goods into for delivery.

List shipping classes

GET /api/v1/stores/{storeId}/shipping-classes

Every class the shop has, oldest first. A class holds variants that cost the same to send, and a delivery rate can name classes to depend on. meta.gaps lists the delivery zones with no rate for a class that has variants in it, because a basket holding one of those cannot be checked out to that zone.

Needs stores:read.

Parameters

ParameterInTypeDescription
storeIdpathstringThe shop.

Answers 200

FieldTypeDescription
dataarray of ShippingClassRow
metaobject
meta.totalinteger
meta.gapsmap of array of string (uuid)Class id to the ids of the zones with no rate for it.
curl "https://api.storeware.ai/api/v1/stores/$STORE_ID/shipping-classes" \
  -H "Authorization: Bearer $TOKEN"

Create a shipping class

POST /api/v1/stores/{storeId}/shipping-classes

Answers with the class already holding that name, unchanged, if there is one. Refused with shipping_class_name_invalid for a name with no letter or number in it. Send Idempotency-Key to make a retry safe.

Needs stores:write.

Parameters

ParameterInTypeDescription
storeIdpathstringThe shop.

Body

FieldTypeRequiredDescription
namestringYes1 to 120 characters.
descriptionstring or nullNoUp to 500 characters.

Answers 201

FieldTypeDescription
dataShippingClass
curl -X POST "https://api.storeware.ai/api/v1/stores/$STORE_ID/shipping-classes" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d @body.json

Update a shipping class

PATCH /api/v1/stores/{storeId}/shipping-classes/{classId}

Changes only the fields sent. Renaming a class keeps its slug. Refused with shipping_class_not_found for a class this shop does not have.

Needs stores:write.

Parameters

ParameterInTypeDescription
storeIdpathstringThe shop.
classIdpathstringThe class.

Body

FieldTypeRequiredDescription
namestringNo1 to 120 characters.
descriptionstring or nullNoUp to 500 characters.

Answers 200

FieldTypeDescription
dataShippingClass
curl -X PATCH "https://api.storeware.ai/api/v1/stores/$STORE_ID/shipping-classes/$CLASS_ID" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d @body.json

Delete a shipping class

DELETE /api/v1/stores/{storeId}/shipping-classes/{classId}

The variants in it are left in no class. Refused with shipping_class_in_use while a delivery rate names it, because the rate would then be offered to the wrong baskets.

Needs stores:write.

Parameters

ParameterInTypeDescription
storeIdpathstringThe shop.
classIdpathstringThe class.

Answers 200

FieldTypeDescription
dataobject
data.variantsClearedintegerHow many variants were left in no class.
curl -X DELETE "https://api.storeware.ai/api/v1/stores/$STORE_ID/shipping-classes/$CLASS_ID" \
  -H "Authorization: Bearer $TOKEN"

On this page