> For the complete documentation index, see [llms.txt](https://help.unitpay.ru/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.unitpay.ru/en/payments/create-payment-easy.md).

# Creating a payment (form)

{% hint style="info" %}
If your website was created using CMS please take a look at the list of our [modules](/en/modules.md).
{% endhint %}

To initiate a payment through a single form of payment, you just need to direct the user to a special URL and transfer a number of required parameters.

## pay

<mark style="color:blue;">`GET`</mark> `https://unitpay.ru/pay/PUBLICKEY?sum&account&desc&signature`

The request is used to initialize a payment

#### Path Parameters

| Name      | Type   | Description                                                        |
| --------- | ------ | ------------------------------------------------------------------ |
| publickey | string | public key. You can find it under the Settings tab of your project |

#### Query Parameters

<table><thead><tr><th width="130.6416015625">Name</th><th width="99.6605224609375">Type</th><th>Description</th></tr></thead><tbody><tr><td>backurl</td><td>string</td><td>The user's return address from the payment form without making a purchase; the project address is used by default. The project domain must be used in the address. Examples: https://redirect.&#x3C;project domain>/?someParams", "https://&#x3C;project domain>/redirect/</td></tr><tr><td>locale</td><td>string</td><td>It is mandatory to specify the payment form language, acceptable values: ru, en. By default, the form language is determined based on the country that the user's IP address belongs to</td></tr><tr><td>currency</td><td>string</td><td>The order currency according to ISO 4217 (RUB, UAH, BYN, EUR, USD etc. Currency codes https://help.unitpay.ru/v/master/book-of-reference/payment-system-codes). <br>If the payment system does not support the required currency, the amount will be converted to the payment system currency</td></tr><tr><td>signature</td><td>string</td><td>It protects you from hackers: substituting the description or price of the order, placing a link to the payment on the resources of fraudsters.</td></tr><tr><td>desc</td><td>string</td><td>Order description. It is used only for informing when making a payment</td></tr><tr><td>account</td><td>string</td><td>Subscriber ID in your system (for example, email or order number).</td></tr><tr><td>sum</td><td>number</td><td>Payment amount. In rubles by default. See the additional currency parameter</td></tr><tr><td>resultUrl</td><td>string</td><td><p></p><p>The full URL to which the user is redirected after payment (e.g., <code>https://your-site.com</code>). The payer will be automatically redirected to this URL after the payment is completed.</p><div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>The combined length of resultUrl and account must not exceed 225 characters; otherwise, the payment creation request will be rejected.</p></div><div data-gb-custom-block data-tag="hint" data-style="warning" class="hint hint-warning"><p><strong>Important</strong>: The domain must match the domain of the project. If the parameter is not specified, the payment receipt page URL will be used.</p></div></td></tr></tbody></table>

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

```
```

{% endtab %}
{% endtabs %}

**Example:**

```
https://unitpay.ru/pay/111111-11111?sum=100&account=222111&desc=Online%20course&signature=2c38bb3114b2f02222ee35f6b60c6bbe628ad31bed59633787204ae59659a02e
```

\*\*\*\*

**PUBLIC KEY**: The value of the project public key can be found on the project page in the special Payment Form section of your personal account.

<figure><img src="https://244174165-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M9Y_k8Gr-WxeECFRelw-887967055%2Fuploads%2Fgw7Ty37amow7wJMVH8nx%2Fproject_api_keys_example_en.png?alt=media&amp;token=9373b9ac-f9da-4203-a83a-f1f57df7e013" alt=""><figcaption></figcaption></figure>

**Request digital signature**

For additional security of your payments, we perform mandatory verification of the digital signature when creating a payment. The signature guarantees protection against the substitution of the transmitted values (e.g., changing the payment amount or order number).

|               | **Value** | **Description**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| ------------- | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **signature** | line      | <p>Digital signature. It is formed as sha256( account + "{up}" + currency + "{up}" + desc + "{up}" + sum + "{up}" + secretKey),<br>where <strong>sha256</strong> is the hashing method;<br> <strong>{up}</strong> is the parameter separator in the hash function;<br> <strong>account, sum, currency, desc</strong> are the payment initialization parameters described above;<br> <strong>secretKey</strong> is the secret key of the project (available in your personal account);</p><p><strong>Important Note</strong>. If you do not transmit <strong>currency</strong> to the payment form, this parameter should not be used in signature generation.</p> |

**Default payment method**

You can define the payment system that will be used for the user by default. To do this, add parameter / **system\_code** corresponding to the [alphabetic code of the payment system](/en/book-of-reference/payment-system-codes.md) at the end of the URL of your payment form (for example: <https://unitpay.money/pay/demo\\>).

**Return to the store's website**

After initializing the payment, the user goes to the receipt page where the payment status is tracked. After users have received a successful or error status, they are redirected to the partner's site (Fail URL/Success URL fields in the personal account settings) with GET parameters:

|           | **Value** | **Description**                                                                      |
| --------- | --------- | ------------------------------------------------------------------------------------ |
| account   | text      | Subscriber ID in the partner's system (for example, the subscriber's login or email) |
| paymentId | number    | Payment number in the UnitPay system                                                 |
