# useApplyAttributeChange Returns a function to mutate the `attributes` property of the checkout. ## ### UseApplyAttributeChangeGeneratedType Returns a function to mutate the `attributes` property of the checkout. #### Returns: (change: AttributeChange) => Promise export function useApplyAttributeChange< Target extends RenderExtensionTarget = RenderExtensionTarget, >(): (change: AttributeChange) => Promise { const api = useApi(); if ('applyAttributeChange' in api) { return api.applyAttributeChange; } throw new ExtensionHasNoMethodError( 'applyAttributeChange', api.extension.target, ); } ### AttributeChange ### type value: `"updateAttribute"` - Attribute: export interface Attribute { /** * The key for the attribute. */ key: string; /** * The value for the attribute. */ value: string; } The type of the `AttributeUpdateChange` API. ### key value: `string` Key of the attribute to add or update ### value value: `string` Value for the attribute to add or update ### Attribute ### key value: `string` The key for the attribute. ### value value: `string` The value for the attribute. ### AttributeChangeResultSuccess The returned result of a successful update to an attribute. ### type value: `"success"` The type of the `AttributeChangeResultSuccess` API. ### AttributeChangeResultError The returned result of an unsuccessful update to an attribute with a message detailing the type of error that occurred. ### type value: `"error"` The type of the `AttributeChangeResultError` API. ### message value: `string` A message that explains the error. This message is useful for debugging. It is **not** localized, and therefore should not be presented directly to the buyer. ## Related - [StandardApi](https://shopify.dev/docs/api/checkout-ui-extensions/apis/standardapi) - [CheckoutApi](https://shopify.dev/docs/api/checkout-ui-extensions/apis/checkoutapi) - [OrderStatusApi](https://shopify.dev/docs/api/checkout-ui-extensions/apis/orderstatusapi) - [CartLineItemApi](https://shopify.dev/docs/api/checkout-ui-extensions/apis/cartlineitemapi) - [PickupPointListApi](https://shopify.dev/docs/api/checkout-ui-extensions/apis/pickuppointlistapi) - [PickupLocationListApi](https://shopify.dev/docs/api/checkout-ui-extensions/apis/pickuplocationlistapi) - [ShippingOptionItemApi](https://shopify.dev/docs/api/checkout-ui-extensions/apis/shippingoptionitemapi) - [ExtensionTargets](https://shopify.dev/docs/api/checkout-ui-extensions/apis/extensiontargets)