remove-loyalty-points
Method: DELETE
Path: /carts/{id}/loyalty-points
Tags: Carts
Summary
Remove loyalty points
Description
Removes redeemed loyalty points from the cart. Returns a fully updated Cart object with recalculated totals.
Storefront SDK Usage
SDK Method: sdk.cart.removeLoyaltyPoints()
Example:
typescript
const { data, error } = await sdk.cart.removeLoyaltyPoints({
id: "01H9CART12345ABCDE"
});
if (error) {
console.error("Failed to remove loyalty points:", error.message);
} else {
console.log("Loyalty points removed, new total:", data.cart.grand_total);
}TypeScript Definition
typescript
"remove-loyalty-points": {
parameters: {
query?: never;
header?: never;
path: {
/** @description Cart ID */
id: string;
};
cookie?: never;
};
requestBody?: never;
responses: {
/** @description OK */
200: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": {
message: string;
success: boolean;
content: {
cart: components["schemas"]["CartRead"];
};
};
};
};
400: components["responses"]["BadRequest"];
401: components["responses"]["Unauthorized"];
403: components["responses"]["Forbidden"];
/** @description The active cart or requested customer resource was not found. */
404: components["responses"]["NotFound"];
500: components["responses"]["InternalServerError"];
504: components["responses"]["GatewayTimeout"];
};
};Component References
| Reference | Resolves To |
|---|---|
components["schemas"]["CartRead"] | CartRead |
components["responses"]["BadRequest"] | BadRequest |
components["responses"]["Unauthorized"] | Unauthorized |
components["responses"]["Forbidden"] | Forbidden |
components["responses"]["NotFound"] | NotFound |
components["responses"]["InternalServerError"] | InternalServerError |
components["responses"]["GatewayTimeout"] | GatewayTimeout |
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.
404
Requested resource not found
500
The request failed because of an unexpected error.
504
The request timed out.
OpenAPI Definition
json
{
"tags": [
"Carts"
],
"operationId": "remove-loyalty-points",
"summary": "Remove loyalty points",
"description": "Removes redeemed loyalty points from the cart. Returns a fully updated `Cart` object with recalculated totals.",
"externalDocs": {
"url": "https://llm-docs.commercengine.io/storefront/operations/remove-loyalty-points",
"description": "API reference for the remove-loyalty-points operation"
},
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"message",
"success",
"content"
],
"properties": {
"message": {
"type": "string"
},
"success": {
"type": "boolean"
},
"content": {
"properties": {
"cart": {
"$ref": "#/components/schemas/CartRead"
}
},
"required": [
"cart"
],
"type": "object"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"description": "The active cart or requested customer resource was not found.",
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
},
"504": {
"$ref": "#/components/responses/GatewayTimeout"
}
},
"security": [
{
"Authorization": []
}
],
"x-speakeasy-group": "carts",
"x-speakeasy-ignore": false,
"x-speakeasy-name-override": "removeLoyaltyPoints"
}Auto-generated from OpenAPI spec and TypeScript definitions