# 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< ID extends RenderExtensionPoint = RenderExtensionPoint, >(): (change: AttributeChange) => Promise { const api = useApi(); if ('applyAttributeChange' in api) { return api.applyAttributeChange; } throw new ExtensionHasNoMethodError( 'applyAttributeChange', api.extensionPoint, ); } ### 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) - [CartLineDetailsApi](https://shopify.dev/docs/api/checkout-ui-extensions/apis/cartlinedetailsapi) - [PickupPointsApi](https://shopify.dev/docs/api/checkout-ui-extensions/apis/pickuppointsapi) - [PickupLocationsApi](https://shopify.dev/docs/api/checkout-ui-extensions/apis/pickuplocationsapi) - [ShippingMethodDetailsApi](https://shopify.dev/docs/api/checkout-ui-extensions/apis/shippingmethoddetailsapi) - [ExtensionPoints](https://shopify.dev/docs/api/checkout-ui-extensions/apis/extensionpoints)