Skip to content

check-fulfillment ​

Method: POST
Path: /fulfillment/serviceability

Tags: Fulfillment

Summary ​

Check fulfillment

Description ​

Checking if fulfillment is available to the entered pincode based on shipping zones and inventories. Requires an anonymous or signed-in bearer session. Unserviceable pincodes return a pincode validation error; unavailable item results use product_image_url.

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" // or "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: "delivery"
});

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"][];
                        };
                    };
                };
            };
            /** @description The cart is missing or inactive, or the request is invalid. */
            400: components["responses"]["BadRequest"];
            401: components["responses"]["Unauthorized"];
            403: components["responses"]["Forbidden"];
            500: components["responses"]["InternalServerError"];
            504: components["responses"]["GatewayTimeout"];
        };
    };

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"]["Forbidden"]Forbidden
components["responses"]["InternalServerError"]InternalServerError
components["responses"]["GatewayTimeout"]GatewayTimeout

Request Body ​

Fulfillment check request

Content Types: application/json

Responses ​

200 ​

OK

400 ​

Bad request

401 ​

Authentication failed. Codes include token-required, token-expired and token_not_valid for an invalid or expired token.

403 ​

Access denied. token-required requires an authenticated session; permission-denied means the caller cannot access this resource. On POS, session-expired requires signing in again.

500 ​

The request failed because of an unexpected error.

504 ​

The request timed out.

OpenAPI Definition ​

json
{
  "tags": [
    "Fulfillment"
  ],
  "operationId": "check-fulfillment",
  "summary": "Check fulfillment",
  "description": "Checking if fulfillment is available to the entered pincode based on shipping zones and inventories. Requires an anonymous or signed-in bearer session. Unserviceable pincodes return a pincode validation error; unavailable item results use product_image_url.",
  "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": {
          "anyOf": [
            {
              "$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": {
      "description": "The cart is missing or inactive, or the request is invalid.",
      "$ref": "#/components/responses/BadRequest"
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    },
    "403": {
      "$ref": "#/components/responses/Forbidden"
    },
    "500": {
      "$ref": "#/components/responses/InternalServerError"
    },
    "504": {
      "$ref": "#/components/responses/GatewayTimeout"
    }
  },
  "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: