# Entity Quick Actions

Entity Quick Actions allow you to display a button directly in the entity editor screen for important actions that require instant access.

![Quick Actions](https://3343668521-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlHETtFOx4I72xhuc27Kt%2Fuploads%2Fgit-blob-7cd4b8d5bd677bc7b8548c250086baf47082a200%2Fquick-actions.png?alt=media)

## Registering a Quick Action

```typescript
import { UcManifestEntityQuickAction } from "@umbraco-commerce/backoffice";

export const manifests : UcManifestEntityQuickAction[] = [
    {
        type: 'ucEntityQuickAction',
        kind: 'default',
        alias: 'My.EntityQuickAction.MyQuickAction',
        name: 'My Quick Action Action',
        weight: 300,
        api: () => import('./my-quick-action.api.js'),
        meta: {
            entityType: 'uc:order',
            label: "#quickActions_myQuickAction",
            look: 'primary'
        }
    }
];

extensionRegistry.register(manifests);
```

Each entry must have a type of `ucEntityQuickAction` along with a unique `alias` and `name`. Unless you wish to override the button, the `kind` key should be set to `default`. An `api` key should be defined that imports the implementation of the `UcEntityQuickActionApi` interface.

A `meta` entry provides configuration options for quick actions:

| Name         | Description                                                                        |
| ------------ | ---------------------------------------------------------------------------------- |
| `entityType` | The entity type for which this quick action should be displayed                    |
| `label`      | A label for this quick action (supports the `#` prefix localization string syntax) |
| `look`       | Can be `primary` for a highlighted button, or `secondary` for a more muted button  |

## The Entity Quick Action API

In order to define the logic to perform when a quick action button is clicked, you'll need to implement the `UcEntityQuickActionApi` interface. This interface is defined as

```typescript
export interface UcEntityQuickActionApi extends UmbApi {
    manifest: UcManifestEntityQuickAction;
    execute(): Promise<void>;
}
```

This provides quick action implementations with access to the defined `manifest` and expects the implementation of an `execute` method to act.

An example implementation would be

```typescript
// my-quick-action.api.js

import { UcEntityQuickActionApi, UcManifestEntityQuickAction } from "@umbraco-commerce/backoffice";
import { UmbControllerBase } from "@umbraco-cms/backoffice/class-api";

export default class MyEntityQuickActionApi extends UmbControllerBase implements UcEntityQuickActionApi {
    manifest!: UcManifestEntityQuickAction;
    async execute() {
        console.log("You clicked the My Quick Action");
    }
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.umbraco.com/umbraco-commerce/key-concepts/ui-extensions/entity-quick-actions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
