# PS Wallet Pay overview

> What PS Wallet Pay is, how to create an app, get a token, and make your first API request.

PS Wallet Pay is the PS Wallet payment system for accepting crypto in your bots, websites, and apps. You create an invoice via the API — in a coin, dollars, or rubles — the user pays it in PS Wallet in a couple of taps, and the funds arrive on your app's balance. From there you can withdraw them to your own account or send them to users via a transfer or a check.

## How it works

1. Your server creates an invoice with the [createInvoice](https://help.pswallet.org/en/pay-api/invoices#createinvoice) method and receives a payment link.
2. You send the link to the user. The invoice opens in PS Wallet: in the bot chat with a payment button, or directly on the payment screen in the mini app.
3. The user pays from their PS Wallet account.
4. The payment amount minus the [fee](https://help.pswallet.org/en/pay-api/fees-and-limits) — 0.3% — is credited to the app balance, and if [webhooks](https://help.pswallet.org/en/pay-api/webhooks) are connected, your server immediately receives an `invoice_paid` notification.
5. You can withdraw funds from the balance to your PS Wallet accounts in the dashboard, or send them to users via [transfer](https://help.pswallet.org/en/pay-api/transfers) and [checks](https://help.pswallet.org/en/pay-api/checks).

## Getting started

1. Open PS Wallet in Telegram ([@pswallet](https://t.me/pswallet)) → "Profile" → "PS Wallet Pay" → "Create new".
2. Set the name, description, project link, and logo in the "App information" section — your customers see them on the payment screen.
3. Copy the token in the "API token" section (you will need your PIN). The token gives full access to the app, so store it only on the server and never share it. If the token leaks, tap "Regenerate": the old one stops working immediately.
4. If you need payment notifications, specify your server address in the "Webhooks" section.
5. If you are going to send money to users, enable the `transfer` and `createCheck` methods in the "Security" section. They are disabled by default.

> [!WARNING]
> The token is access to the money on the app's balance. Do not put it in the code of mini apps, websites, or mobile clients. For more details, see the [Security](https://help.pswallet.org/en/pay-api/security) section.

## How to test

There is no separate test network. For development, create a separate app and test everything with small amounts: you can pay your own app's invoices yourself.

> [!TIP]
> It is convenient to test webhooks with the "Send test" button in the "Webhooks" section: your server will receive a `test` event signed the same way as real notifications.

## First request

Check the token with the [getMe](https://help.pswallet.org/en/pay-api/balance#getme) method. Replace `$TOKEN` with your app's token.

```bash title="cURL"
curl https://pay.pswallet.org/api/getMe \
  -H "PSWallet-Pay-API-Token: $TOKEN"
```

```js title="Node.js"
// Node.js 18+ (built-in fetch)
const response = await fetch("https://pay.pswallet.org/api/getMe", {
  headers: { "PSWallet-Pay-API-Token": process.env.PSWALLET_PAY_TOKEN },
});
const data = await response.json();
console.log(data.result);
```

```python title="Python"
import os
import requests

response = requests.get(
    "https://pay.pswallet.org/api/getMe",
    headers={"PSWallet-Pay-API-Token": os.environ["PSWALLET_PAY_TOKEN"]},
    timeout=15,
)
print(response.json()["result"])
```

Response:

```json
{
  "ok": true,
  "result": {
    "app_id": 1234,
    "name": "My Shop",
    "payment_processing_bot_username": "pswallet"
  }
}
```

## API methods

| Method | HTTP | What it does |
|---|---|---|
| [getMe](https://help.pswallet.org/en/pay-api/balance#getme) | GET, POST | Checks the token and returns app information. |
| [createInvoice](https://help.pswallet.org/en/pay-api/invoices#createinvoice) | POST | Creates a payment invoice. |
| [getInvoices](https://help.pswallet.org/en/pay-api/invoices#getinvoices) | GET, POST | Lists invoices. |
| [deleteInvoice](https://help.pswallet.org/en/pay-api/invoices#deleteinvoice) | POST | Deletes an unpaid invoice. |
| [transfer](https://help.pswallet.org/en/pay-api/transfers#transfer) | POST | Transfers money to a PS Wallet user. |
| [getTransfers](https://help.pswallet.org/en/pay-api/transfers#gettransfers) | GET, POST | Lists transfers. |
| [createCheck](https://help.pswallet.org/en/pay-api/checks#createcheck) | POST | Creates a check. |
| [getChecks](https://help.pswallet.org/en/pay-api/checks#getchecks) | GET, POST | Lists checks. |
| [deleteCheck](https://help.pswallet.org/en/pay-api/checks#deletecheck) | POST | Deletes an unactivated check. |
| [getBalance](https://help.pswallet.org/en/pay-api/balance#getbalance) | GET, POST | App balance. |
| [getExchangeRates](https://help.pswallet.org/en/pay-api/balance#getexchangerates) | GET, POST | Coin rates to USD and RUB. |
| [getCurrencies](https://help.pswallet.org/en/pay-api/balance#getcurrencies) | GET, POST | Coins the API currently accepts. |
| [getStats](https://help.pswallet.org/en/pay-api/balance#getstats) | GET, POST | App statistics for a period. |

## Documentation sections

- [Requests and responses](https://help.pswallet.org/en/pay-api/requests) — API address, authorization, parameter and response formats, request limit.
- [Coins and amounts](https://help.pswallet.org/en/pay-api/assets) — coin codes, precision, USDT on any network, invoices in dollars and rubles.
- [Invoices](https://help.pswallet.org/en/pay-api/invoices) — `createInvoice`, `getInvoices`, `deleteInvoice`.
- [Transfers](https://help.pswallet.org/en/pay-api/transfers) — `transfer`, `getTransfers`.
- [Checks](https://help.pswallet.org/en/pay-api/checks) — `createCheck`, `getChecks`, `deleteCheck`.
- [App, balance, and rates](https://help.pswallet.org/en/pay-api/balance) — `getMe`, `getBalance`, `getExchangeRates`, `getCurrencies`, `getStats`.
- [Object types](https://help.pswallet.org/en/pay-api/types) — fields of Invoice, Transfer, Check, and other objects.
- [Webhooks](https://help.pswallet.org/en/pay-api/webhooks) — payment notifications, signature verification, retries.
- [Errors](https://help.pswallet.org/en/pay-api/errors) — error format and codes.
- [Fees and limits](https://help.pswallet.org/en/pay-api/fees-and-limits) — how much accepting payments costs and what limits apply.
- [Security](https://help.pswallet.org/en/pay-api/security) — token, allowed methods, IP allowlist.

---
Source: https://help.pswallet.org/en/pay-api/overview
