# Three-Step Integration

This guide helps you complete Widget SDK integration in 30 minutes.

## Overview

Widget SDK is the fastest way to integrate BlockATM. You can embed a cryptocurrency cashier in your website or application in just three steps:

1. Import SDK script
2. Add cashier container
3. Initialize SDK

## Integration Flowchart

The following diagram shows the complete integration process:

## Step 1: Import SDK

Import BlockATM SDK in your HTML page:

{% tabs %}
{% tab title="Production" %}

```html
<script src="https://pay.blockatm.net/libs/v2/BlockATM.umd.js?apiKey=YOUR_API_KEY"></script>
```

{% endtab %}

{% tab title="Test" %}

```html
<script src="https://test-pay.blockatm.net/libs/v2/BlockATM.umd.js?apiKey=YOUR_API_KEY"></script>
```

{% endtab %}
{% endtabs %}

## Step 2: Add Container

Add a container element on the page where the cashier will be displayed:

```html
<div id="blockatm-container"></div>
```

{% hint style="info" %}
**Container Style**: It is recommended to set appropriate height and width for the container to accommodate the cashier interface.
{% endhint %}

## Step 3: Initialize

Initialize SDK in your application code:

```javascript
window.BlockATM.init(
  document.getElementById('blockatm-container'),
  {
    cashierId: 'YOUR_CASHIER_ID',
    orderNo: 'ORDER_' + Date.now(),
    amount: '100',
    symbol: 'USDT',
    chainId: 'TRON',
    callback: function(result) {
      if (result.type === 'finish') {
        console.log('Payment successful!', result.data);
      }
    }
  }
);
```

## Get API Key

You can get API Key in BlockATM admin dashboard:

1. Login to BlockATM admin dashboard
2. Go to "Cashier" → "Integration"

{% hint style="info" %}
**Integration Info**: On the integration page, you can get cashier ID and API key.
{% endhint %}

## Complete Example

```html
<!DOCTYPE html>
<html>
<head>
  <title>BlockATM Integration Example</title>
  <style>
    #blockatm-container {
      min-height: 400px;
      width: 100%;
      max-width: 500px;
    }
  </style>
</head>
<body>
  <h1>Cryptocurrency Payment</h1>

  <div id="blockatm-container"></div>

  <script src="https://pay.blockatm.net/libs/v2/BlockATM.umd.js?apiKey=YOUR_API_KEY"></script>

  <script>
    window.BlockATM.init(
      document.getElementById('blockatm-container'),
      {
        cashierId: 'YOUR_CASHIER_ID',
        orderNo: 'ORDER_' + Date.now(),
        amount: '100',
        symbol: 'USDT',
        chainId: 'TRON',
        lang: 'en-US',
        callback: function(result) {
          if (result.type === 'finish') {
            console.log('Payment successful!', result.data);
          } else if (result.type === 'cancel') {
            console.log('User cancelled');
          }
        }
      }
    );
  </script>
</body>
</html>
```

## Next Steps

* [View complete parameter description →](/widget-sdk/parameters.md)
* [View API documentation →](/open-api/open-api.md)
* [View Webhook configuration →](/webhook/webhooks.md)


---

# 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.blockatm.net/widget-sdk/integration.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.
