get-fulfillment-options
Method: POST
Path: /shipping/fulfillment-options
Tags: Shipping
Summary
Retrieve fulfillment options
Description
This endpoint returns the available fulfillment options for a given cart and delivery pincode. It provides both delivery options and collect-in-store (Click & Collect) options, including details of store locations where the item can be collected.
Storefront SDK Usage
SDK Method: sdk.shipping.getFulfillmentOptions()
Example:
typescript
const { data, error } = await sdk.shipping.getFulfillmentOptions({
cart_id: "cart_01H9XYZ12345ABCDE",
delivery_pincode: "400001"
});
if (error) {
console.error("Failed to get fulfillment options:", error.message);
} else {
// Check summary information
console.log("Collect available:", data.summary.collect_available);
console.log("Deliver available:", data.summary.deliver_available);
console.log("Recommended fulfillment type:", data.summary.recommended_fulfillment_type);
// Access collect options
if (data.collect && data.collect.length > 0) {
console.log("Available stores for collection:");
data.collect.forEach(store => {
console.log(`${store.name} - ${store.distance_km}km away, ETA: ${store.collect_eta_minutes} minutes`);
});
}
// Access delivery options
if (data.deliver && data.deliver.is_serviceable) {
console.log("Available shipping methods:");
data.deliver.shipping_methods.forEach(method => {
console.log(`${method.name} - ${method.shipping_amount}, ${method.estimated_delivery_days} days`);
});
}
}TypeScript Definition
typescript
"get-fulfillment-options": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
requestBody: {
content: {
"application/json": components["schemas"]["CartBasedServiceabilityCheck"];
};
};
responses: {
/** @description OK */
200: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": {
message: string;
success: boolean;
content: {
summary: {
collect_available: boolean;
deliver_available: boolean;
/** @enum {unknown} */
recommended_fulfillment_type: "collect-in-store" | "delivery";
recommended_store?: components["schemas"]["CollectInStore"];
};
collect?: components["schemas"]["CollectInStore"][];
deliver?: components["schemas"]["PincodeServiceability"];
};
};
};
};
400: components["responses"]["BadRequest"];
401: components["responses"]["Unauthorized"];
404: components["responses"]["NotFound"];
};
};Component References
| Reference | Resolves To |
|---|---|
components["schemas"]["CartBasedServiceabilityCheck"] | CartBasedServiceabilityCheck |
components["schemas"]["CollectInStore"] | CollectInStore |
components["schemas"]["PincodeServiceability"] | PincodeServiceability |
components["responses"]["BadRequest"] | BadRequest |
components["responses"]["Unauthorized"] | Unauthorized |
components["responses"]["NotFound"] | NotFound |
Request Body
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": [
"Shipping"
],
"operationId": "get-fulfillment-options",
"summary": "Retrieve fulfillment options",
"description": "This endpoint returns the available fulfillment options for a given cart and delivery pincode. It provides both delivery options and collect-in-store (Click & Collect) options, including details of store locations where the item can be collected.",
"externalDocs": {
"url": "https://llm-docs.commercengine.io/storefront/operations/get-fulfillment-options",
"description": "API reference for the get-fulfillment-options operation"
},
"parameters": [],
"requestBody": {
"description": "",
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CartBasedServiceabilityCheck"
}
}
}
},
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"message",
"success",
"content"
],
"properties": {
"message": {
"type": "string"
},
"success": {
"type": "boolean"
},
"content": {
"properties": {
"summary": {
"type": "object",
"properties": {
"collect_available": {
"type": "boolean"
},
"deliver_available": {
"type": "boolean"
},
"recommended_fulfillment_type": {
"enum": [
"collect-in-store",
"delivery"
]
},
"recommended_store": {
"$ref": "#/components/schemas/CollectInStore"
}
},
"required": [
"collect_available",
"deliver_available",
"recommended_fulfillment_type"
]
},
"collect": {
"type": "array",
"items": {
"$ref": "#/components/schemas/CollectInStore"
}
},
"deliver": {
"$ref": "#/components/schemas/PincodeServiceability"
}
},
"required": [
"summary"
],
"type": "object"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"404": {
"$ref": "#/components/responses/NotFound"
}
},
"security": [
{
"Authorization": []
}
],
"x-speakeasy-group": "shipping",
"x-speakeasy-ignore": false,
"x-speakeasy-name-override": "fulfillmentOptions"
}Auto-generated from OpenAPI spec and TypeScript definitions