pos-update-fulfillment-preference
Method: POST
Path: /pos/carts/{id}/fulfillment-preference
Tags: Fulfillment
Summary
Update fulfillment preference
Description
Sets a collect-in-store or partial collect-and-delivery preference on a POS cart. For collection, provide a pickup location. For partial fulfillment, provide both pickup and delivery details with at least one item each. Returns the updated Cart.
Pos SDK Usage
SDK Method: pos.updateFulfillmentPreference()
Example:
const { data, error } = await pos.updateFulfillmentPreference(
{ id: "01H9CART12345ABCDE" },
{
fulfillment_type: "collect-in-store",
pickup_location_id: "01H9LOC12345ABCDE"
}
);
if (error) {
console.error("Failed to update fulfillment preference:", error.message);
} else {
console.log("Fulfillment preference updated:", data.cart.id);
console.log("Preference:", data.cart.fulfillment_preference);
}TypeScript Definition
"pos-update-fulfillment-preference": {
parameters: {
query?: never;
header?: never;
path: {
/** @description Cart ID */
id: string;
};
cookie?: never;
};
requestBody: {
content: {
"application/json": components["schemas"]["PosFulfillmentPreference"];
};
};
responses: {
/** @description OK */
200: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": {
message: string;
success: boolean;
content: {
cart: components["schemas"]["CartRead"];
};
};
};
};
/** @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
| Reference | Resolves To |
|---|---|
components["schemas"]["PosFulfillmentPreference"] | PosFulfillmentPreference |
components["schemas"]["CartRead"] | CartRead |
components["responses"]["BadRequest"] | BadRequest |
components["responses"]["Unauthorized"] | Unauthorized |
components["responses"]["Forbidden"] | Forbidden |
components["responses"]["InternalServerError"] | InternalServerError |
components["responses"]["GatewayTimeout"] | GatewayTimeout |
Parameters
- id (path): Cart ID
Request Body
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
{
"operationId": "pos-update-fulfillment-preference",
"summary": "Update fulfillment preference",
"description": "Sets a collect-in-store or partial collect-and-delivery preference on a POS cart. For collection, provide a pickup location. For partial fulfillment, provide both pickup and delivery details with at least one item each. Returns the updated `Cart`.",
"parameters": [
{
"name": "id",
"in": "path",
"description": "Cart ID",
"required": true,
"schema": {
"type": "string",
"maxLength": 128,
"minLength": 1,
"pattern": "^[A-Za-z0-9_-]{1,128}$"
}
}
],
"requestBody": {
"description": "",
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PosFulfillmentPreference"
}
}
}
},
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"message": {
"type": "string"
},
"success": {
"type": "boolean"
},
"content": {
"properties": {
"cart": {
"$ref": "#/components/schemas/CartRead"
}
},
"required": [
"cart"
],
"type": "object"
}
},
"required": [
"message",
"success",
"content"
]
}
}
},
"links": {
"EvaluateCoupons": {
"operationId": "pos-evaluate-coupons",
"parameters": {
"id": "$request.path.id"
},
"description": "Evaluate coupon eligibility for this cart."
},
"EvaluatePromotions": {
"operationId": "pos-evaluate-promotions",
"parameters": {
"id": "$request.path.id"
},
"description": "Evaluate promotion eligibility for this cart."
},
"CreateOrderFromCart": {
"operationId": "create-pos-order",
"requestBody": {
"cart_id": "$request.path.id"
},
"description": "Create a POS order from a cart."
}
}
},
"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"
}
},
"externalDocs": {
"url": "https://llm-docs.commercengine.io/admin-pos/operations/pos-update-fulfillment-preference"
},
"security": [
{
"Authorization": []
}
],
"tags": [
"Fulfillment"
],
"x-speakeasy-group": "pos",
"x-speakeasy-name-override": "updateFulfillmentPreference"
}Auto-generated from OpenAPI spec and TypeScript definitions