commercetools icon

commercetools

Interact with the commercetools API. Operations are auto-generated from the official Postman collection.

Actions671

Shipping-method → Check if matching ShippingMethod exists for a Cart and Location

AI-generated

Summary

Check if a matching shipping method exists for a specified cart and country location, optionally filtering by state.

Inputs

  • Country (required) — The country code to check the shipping method against.
  • Cart Id (required) — The identifier of the cart to check against.
  • Filters — Optional filters, currently supporting filter by 'State'.

Output shape

a JSON object indicating existence, with 'exists' boolean, 'statusCode', and the requested URL.

Returns an object containing 'exists' (true if a matching shipping method found, false otherwise), 'statusCode' from the HTTP HEAD request (200 if exists, 404 if not found), and the full URL queried. Uses a HEAD request to efficiently check existence, and throws an error for unexpected HTTP responses.

Examples

Example 1: Check if a shipping method exists for cart '12345' in country 'US' with optional state filter 'CA'.

Provide Country='US', Cart Id='12345', and Filters including State='CA' (optional). The node returns existence info as described.

Links

Discussion