updateGiftCertificateInBasket
Updates a gift certificate item of an existing basket.
This method communicates with the updateGiftCertificateInBasket endpoint of the Vue Storefront API Middleware. In turn, it receives data from the updateGiftCertificateItemInBasket or the Updates a gift certificate item of a basket endpoints exposed by SCAPI / OCAPI depending on the middleware configuration.
Signature
export declare function updateGiftCertificateInBasket(
props: BasketGiftCertificateUpdateParams & {
basketId?: string;
}
): Promise<import("commerce-sdk/dist/checkout/checkout").ShopperBaskets.Basket>;Parameters
| Name | Required | Type | Description |
|---|---|---|---|
props | Required | BasketGiftCertificateUpdateParams & { basketId?: string; } | Parameter object which can be used with this method. Refer to its type definition to learn about possible properties. |
Returns
Returns a representation of a Basket object.
Referenced Types
BasketGiftCertificateUpdateParamsShopperBaskets.Basket
Examples
Updating gift certificate recipientName by recipientName
import { sdk } from '~/sdk.config.ts';
const basket = await sdk.commerce.updateGiftCertificateInBasket({
basketId: 'basketId',
amount: 100,
recipientEmail: 'testEmail@provider.com',
recipientName: 'Recipient Name',
giftCertificateItemId: '83726a8351540534af93f3b15f'
});Updating gift certificate message by id for a different than the currently active locale.
import { sdk } from '~/sdk.config.ts';
const basket = await sdk.commerce.updateGiftCertificateInBasket({
basketId: 'basketId',
amount: 100,
recipientEmail: 'testEmail@provider.com',
recipientName: 'Recipient Name',
message: 'New gift certificate message'
});