# IFrame order

## Description

This functionality allows you to create payments without accessing our API by embedding an 'iframe\` on your page.

## Parameters

The following parameters are available to manage the created order:

| Parameter   | Required | Description                                                                               |
| ----------- | -------- | ----------------------------------------------------------------------------------------- |
| apiKey      | NO       | Public part of the API key (used to sign payment webhooks)                                |
| theme       | NO       | Design theme (light/dark)                                                                 |
| lang        | NO       | Language (ru, en, kr, lv, lt, de, pl, tp, tr, ua, fi, fr, ee, jp, bg, gr, es, it, cn, bn) |
| OrderID     | YES      | Payment ID                                                                                |
| description | NO       | Payment description                                                                       |
| currency    | NO       | Coin payment                                                                              |
| network     | NO       | Payment network                                                                           |
| amount      | NO       | Amount to be paid                                                                         |
| email       | NO       | Payer's email (to be pre-filled)                                                          |

> In the section **"Integration" -> "Integration settings"** in your personal account, you can configure the parameters for silence to create an order
>
> For example, you can fill URL for sending webhooks

## Example

As an example, let's create an order with the following parameters

* Organization ID: `817f197e-3b00-4359-8298-6097aeb52c69`
* `apiKey: odz2fn1+JhC...8J0fac4TnT6jew==`
* `orderId: Payment #1234`
* `description: Some payment description`
* `currency: USDT`
* `network: ethereum`

> Order parameters are specified in `query`

As a result, we will get the following URL

```
https://iframe-order.onchainpay.io/817f197e-3b00-4359-8298-6097aeb52c69?
    apiKeyId=odz2fn1%2BJhC...8J0fac4TnT6jew%3D%3D&
    orderId=Payment%20%231234&
    description=Some%20payment%20description&
    currency=USDT&
    network=ethereum
```

> To insert data into `query`, it must be escaped. In JavaScript, this can be done using the `encodeURIComponent` function
>
> const apikeyId = encodeURIComponent('odz2fn1+JhC...8J0fac4TnT6jew==');

The final embed code will be as follows:

```html
<iframe
    allow="clipboard-read; clipboard-write"
    src="https://iframe-order.onchainpay.io/817f197e-3b00-4359-8298-6097aeb52c69?apiKeyId=odz2fn1%2BJhC...8J0fac4TnT6jew%3D%3D&orderId=Payment%20%231234&description=Some%20payment%20description&currency=USDT&network=ethereum"
></iframe>
```

> The `allow="clipboard-read; clipboard-write"` attribute is required so that your customers can copy the payment address by clicking the "Copy" button


---

# 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.onchainpay.io/iframe-order.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.
