# Purchase Address Widget

{% hint style="info" %}

### Important Note:

**Widget Types Supported in inabit:**\
Inabit currently supports two widget types, each with its own implementation instructions.

The information displayed below is an example of how a widget implementation setup/guide looks like.\
You can access your widget implementation guide at all times by clicking the "Code" Icon on the widget drawer that's pinned to the top right hand side of the<br>

<img src="https://169705515-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7MJDbDRceJewtuE7YSVs%2Fuploads%2Ff2k9xyZkKxfVYSwzGr9M%2Fimage.png?alt=media&#x26;token=bf3dc55b-8cb6-48f7-b0fc-aeef5ea2ffe1" alt="" data-size="original">
{% endhint %}

## Purchase Address Widget

### **Step 1: Implement Server-Side Terminal Call**

```
curl --location https://api-stage.inabit.biz/api/v1/purchase
--header Content-Type: application/json
--Authorization: Bearer 9de7db51f9d1ce9d52112e13f341915b4551d2ff6ec229f55d453c1dc5861b44
data-row-{
  title: <Your title goes here>,
  subTitle: <your subtitle goes here>,
  siteName: <your siteName goes here>,
  purchaseIdentifier: <your purchase identifier goes here>,
  fiatAmount: <fiat amount goes here>,
  fiatCurrency: <fiat currency goes here>
}
```

**Widget API Key:** (i.e.) `8119595e07cb3a87ccfa46..............1885e89d7ef4ed8c2cb`

### **Step 2: Add Script Tag to page Header**

**a. Add the following script tag to your page header:**

```
<script src="https://stage.inabit.biz/widget.js" ></script>
```

### **Step 3:  Call open.widget Function**

Call openwidget function with purchase id, should open in popup After the customer clicks on the button (buy with crypto for example )

```
// purchaseId is the id from response of previous step.
 window.openWidget(purchaseId);

//if you want to open the widget in a popup, you can use the following code:
 window.openWidget(purchaseId, {mode:'popup'})
```

{% hint style="info" %}
You will also be able to preview the widget by clicking on the "Preview Widget" button from within the implementation guide popup displayed.
{% endhint %}

<figure><img src="https://169705515-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7MJDbDRceJewtuE7YSVs%2Fuploads%2FrOxDJfVMu4ln5YkgzRzI%2Fimage.png?alt=media&#x26;token=fafbb5d7-4de7-48f0-b32a-de400592b5eb" alt=""><figcaption></figcaption></figure>

Need further help? Feel free to [reach out to us ](mailto:support@inabit.com)if you encounter any issues during the widget implementation process.
