Skip to content

check-fulfillment

Method: POST
Path: /fulfillment/serviceability

Tags: Carts

Summary

Check fulfillment

Description

Checking if fulfillment is available to the entered pincode based on shipping zones and inventories.

Storefront SDK Usage

SDK Method: sdk.cart.checkPincodeDeliverability()

Example:

typescript
// Cart-based fulfillment check
const { data, error } = await sdk.cart.checkPincodeDeliverability({
  cart_id: "cart_01H9XYZ12345ABCDE",
  delivery_pincode: "400001",
  fulfillment_type: "delivery" // optional: "delivery" | "collect-in-store"
});

// Items-based fulfillment check
const { data, error } = await sdk.cart.checkPincodeDeliverability({
  delivery_pincode: "400001",
  items: [
    { product_id: "prod_123", variant_id: "var_456" },
    { product_id: "prod_789", variant_id: null }
  ]
  // fulfillment_type is optional
});

if (error) {
  console.error("Failed to check fulfillment serviceability:", error.message);
} else {
  console.log("Serviceable:", data.is_serviceable);

  if (!data.is_serviceable && data.unserviceable_items) {
    data.unserviceable_items.forEach(item => {
      console.log(`Unserviceable: ${item.product_name}, max available: ${item.max_available_quantity}`);
    });
  }
}

TypeScript Definition

typescript
"check-fulfillment": {
        parameters: {
            query?: never;
            header?: never;
            path?: never;
            cookie?: never;
        };
        /** @description Fulfillment check request */
        requestBody: {
            content: {
                "application/json": components["schemas"]["CartBasedFulfillmentCheck"] | components["schemas"]["ItemsBasedFulfillmentCheck"];
            };
        };
        responses: {
            /** @description OK */
            200: {
                headers: {
                    [name: string]: unknown;
                };
                content: {
                    "application/json": {
                        message: string;
                        success: boolean;
                        content: {
                            is_serviceable: boolean;
                            /** @description List of unserviceable items if any. Empty array if all items are serviceable. */
                            unserviceable_items?: components["schemas"]["UnserviceableItem"][];
                        };
                    };
                };
            };
            400: components["responses"]["BadRequest"];
            401: components["responses"]["Unauthorized"];
            404: components["responses"]["NotFound"];
        };
    };

Component References

ReferenceResolves To
components["schemas"]["CartBasedFulfillmentCheck"]CartBasedFulfillmentCheck
components["schemas"]["ItemsBasedFulfillmentCheck"]ItemsBasedFulfillmentCheck
components["schemas"]["UnserviceableItem"]UnserviceableItem
components["responses"]["BadRequest"]BadRequest
components["responses"]["Unauthorized"]Unauthorized
components["responses"]["NotFound"]NotFound

Request Body

Fulfillment check request

Content Types: application/json

Responses

200

OK

400

Bad request

401

Not authorized for given operation on the Resource

404

Requested resource not found

OpenAPI Definition

json
{
  "tags": [
    "Carts"
  ],
  "operationId": "check-fulfillment",
  "summary": "Check fulfillment",
  "description": "Checking if fulfillment is available to the entered pincode based on shipping zones and inventories.",
  "externalDocs": {
    "url": "https://llm-docs.commercengine.io/storefront/operations/check-fulfillment",
    "description": "API reference for the check-fulfillment operation"
  },
  "parameters": [],
  "requestBody": {
    "description": "Fulfillment check request",
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "oneOf": [
            {
              "$ref": "#/components/schemas/CartBasedFulfillmentCheck"
            },
            {
              "$ref": "#/components/schemas/ItemsBasedFulfillmentCheck"
            }
          ]
        }
      }
    }
  },
  "responses": {
    "200": {
      "description": "OK",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "required": [
              "message",
              "success",
              "content"
            ],
            "properties": {
              "message": {
                "type": "string"
              },
              "success": {
                "type": "boolean"
              },
              "content": {
                "properties": {
                  "is_serviceable": {
                    "type": "boolean"
                  },
                  "unserviceable_items": {
                    "description": "List of unserviceable items if any. Empty array if all items are serviceable.",
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/UnserviceableItem"
                    }
                  }
                },
                "required": [
                  "is_serviceable"
                ],
                "type": "object"
              }
            }
          }
        }
      }
    },
    "400": {
      "$ref": "#/components/responses/BadRequest"
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    },
    "404": {
      "$ref": "#/components/responses/NotFound"
    }
  },
  "security": [
    {
      "Authorization": []
    }
  ],
  "x-speakeasy-group": "carts",
  "x-speakeasy-ignore": false,
  "x-speakeasy-name-override": "checkFulfillment"
}

Auto-generated from OpenAPI spec and TypeScript definitions

Last updated: