# Checkout button

The **ButtonCheckout** component is a dynamic button designed to handle payments and subscriptions seamlessly. It integrates with an API to create a checkout session and redirect users to complete their purchase.

<figure><img src="/files/o2VGoSC8qWDyz7stDNHd" alt="" width="375"><figcaption></figcaption></figure>

This button integrates directly with an API to create and manage checkout sessions. Depending on the selected mode, it supports both one-time payments and recurring subscriptions. Once triggered, the component communicates with the backend, retrieves a checkout URL, and redirects users to complete their purchase.

It accepts the `priceId`which allows you to point to a specific product price from different payment provider.

* **Simple payment flow** – Eliminates complexity by automating the checkout process.
* **Customizable behavior** – Supports different payment modes (`payment` or `subscription`).
* **Responsive UI** – Displays a loading state while processing and offers interactive visual feedback.
* **Localization support** – Uses `next-intl` for adapting button text based on language preferences.

####


---

# 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://accelerator.gitbook.io/docs/features/checkout-button.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.
