# 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<AttributeChangeResult> export function useApplyAttributeChange< Target extends RenderExtensionTarget = RenderExtensionTarget, >(): (change: AttributeChange) => Promise<AttributeChangeResult> { const api = useApi<Target>(); if ('applyAttributeChange' in api) { return api.applyAttributeChange; } throw new ExtensionHasNoMethodError( 'applyAttributeChange', api.extension.target, ); } ### AttributeChange ### type value: `"updateAttribute"` 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. ### AttributeChangeResult AttributeChangeResultSuccess | AttributeChangeResultError ### 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](/docs/api/checkout-ui-extensions/apis/standardapi) - [CheckoutApi](/docs/api/checkout-ui-extensions/apis/checkoutapi) - [OrderStatusApi](/docs/api/checkout-ui-extensions/apis/orderstatusapi) - [CartLineItemApi](/docs/api/checkout-ui-extensions/apis/cartlineitemapi) - [PickupPointListApi](/docs/api/checkout-ui-extensions/apis/pickuppointlistapi) - [PickupLocationListApi](/docs/api/checkout-ui-extensions/apis/pickuplocationlistapi) - [ShippingOptionItemApi](/docs/api/checkout-ui-extensions/apis/shippingoptionitemapi) - [ExtensionTargets](/docs/api/checkout-ui-extensions/apis/extensiontargets)