1---2name: click-integration3description: Expert-level Click payment integration skill for Uzbekistan's Click SuperApp. Use whenever user mentions Click, click.uz, SHOP API, Merchant API, Click to'lov, Click integratsiya, Click callback, prepare/complete, click_trans_id, merchant_trans_id, Click fiscalization, Click button, Click invoice, card token, Click Pass, checkout.js, createPaymentRequest, Click Telegram, mobile SDK, merchant.click.uz, my.click.uz, api.click.uz, or Click error codes (-1 to -9). Covers SHOP API (Prepare/Complete), Merchant API (invoices, payments, tokens, reversal), payment button, inline checkout, CLICK Pass (QR POS), fiscalization (OFD/IKPU), Telegram bot payments, mobile SDK, CMS plugins (WooCommerce, OpenCart, 1C-Bitrix), testing, and deployment. Trigger for partial mentions like "click", "shop api", "click payment", "click pass", "click telegram", "click plugin" in Uzbek, Russian, or English.4---56# Click Payment Integration — Expert Guide78This skill makes you a **super-expert** on Click payment system integration in Uzbekistan. Every page from docs.click.uz is captured in the reference files below — nothing is cut or summarized.910## Quick Reference1112| Item | Value |13|------|-------|14| Payment page URL | `https://my.click.uz/services/pay` |15| Merchant API endpoint | `https://api.click.uz/v2/merchant/` |16| Merchant cabinet | `https://merchant.click.uz` |17| Documentation | `https://docs.click.uz` |18| SHOP API Protocol | HTTP/HTTPS POST, `application/x-www-form-urlencoded` |19| Merchant API Protocol | HTTPS, `application/json` (also supports `application/xml`) |20| Currency | UZS, amounts in **so'm** (NOT tiyin — unlike Payme!) |21| Amount format | float with 2 decimal places (e.g., `1000.00`) |22| SHOP API auth | MD5 sign_string hash |23| Merchant API auth | SHA1 digest in `Auth` header |24| Checkout.js CDN | `https://my.click.uz/pay/checkout.js` |25| Android SDK | `https://github.com/click-llc/android-msdk` |2627## Choosing the Right Integration Method2829Click offers **multiple** ways to accept payments. Read the appropriate reference file for full details.3031### 1. SHOP API — "Click calls YOUR server" (most common)32- User pays via Click → Click sends Prepare/Complete to your server33- You implement 1 callback endpoint handling 2 actions34- **Read**: `references/02-shop-api-requests.md`3536### 2. Payment Button/Link — "Redirect user to Click"37- Simple link/form redirects user to my.click.uz payment page38- Works with SHOP API callback on your server39- **Read**: `references/05-payment-button.md`4041### 3. Inline Checkout — "Pay on YOUR site without redirect"42- Embed `checkout.js` widget — payment form opens as overlay43- No redirect to my.click.uz needed44- **Read**: `references/06-inline-checkout.md`4546### 4. Merchant API — "YOU call Click's server"47- Create invoices, check payment status, refund, card tokens48- Supplements SHOP API, not a replacement49- **Read**: `references/08-merchant-api-requests.md`5051### 5. CLICK Pass — "QR-code POS payment"52- Merchant scans QR from user's Click app53- For physical retail, kiosks54- **Read**: `references/10-click-pass.md`5556### 6. Telegram Bot Payments57- Accept payments inside Telegram via Click provider58- Uses Telegram Bot API with Click provider_token59- **Read**: `references/12-telegram-payments.md`6061### 7. Mobile SDK / Deep Links62- Android SDK library or deep link integration (Android + iOS)63- **Read**: `references/13-mobile-sdk.md`6465### Decision Matrix6667| Method | Who initiates | Where user pays | Best for |68|--------|--------------|-----------------|----------|69| SHOP API + Payment Button | User clicks link | Click web/app | E-commerce, web |70| SHOP API + Inline Checkout | User on your site | Overlay on your site | SPA, custom UX |71| Merchant API Invoice | Merchant sends invoice | User confirms in Click app | Subscriptions, push billing |72| Merchant API Card Token | Merchant charges token | No user interaction | Recurring, card-on-file |73| CLICK Pass | Merchant scans QR | Already in Click app | Physical retail, POS |74| Telegram Payments | User in Telegram | Telegram payment UI | Telegram bots |75| Mobile SDK / Deep Link | User in your app | Click app or browser | Mobile apps |7677## Sign String Formulas (SHOP API)7879| Request | Formula |80|---------|---------|81| Prepare (action=0) | `MD5(click_trans_id + service_id + SECRET_KEY + merchant_trans_id + amount + action + sign_time)` |82| Complete (action=1) | `MD5(click_trans_id + service_id + SECRET_KEY + merchant_trans_id + merchant_prepare_id + amount + action + sign_time)` |8384**CRITICAL**: Parameters concatenated WITHOUT separators. Use constant-time comparison (e.g., `crypto.timingSafeEqual`).8586## Merchant API Authentication8788```89Auth: {merchant_user_id}:{digest}:{timestamp}90```91- `digest` = `SHA1(timestamp + secret_key)`92- `timestamp` = UNIX timestamp (10-digit seconds)9394## Error Codes Summary (SHOP API)9596| error | error_note | Description |97|-------|------------|-------------|98| 0 | Success | OK |99| -1 | SIGN CHECK FAILED! | Signature verification failed |100| -2 | Incorrect parameter amount | Wrong amount |101| -3 | Action not found | Unknown action |102| -4 | Already paid | Duplicate payment |103| -5 | User does not exist | Order/user not found |104| -6 | Transaction does not exist | Payment record not found |105| -7 | Failed to update user | DB/balance update error |106| -8 | Error in request from click | Malformed request |107| -9 | Transaction cancelled | Previously cancelled |108109## Merchant API HTTP Error Codes110111| Code | Description |112|------|-------------|113| 200, 201 | OK |114| 400 | Bad request (malformed data or URI) |115| 401 | Not authorized (auth error) |116| 403 | Forbidden (method not allowed) |117| 404 | Not found (method not found) |118| 406 | Not acceptable (invalid data type) |119| 410 | Gone (deprecated method) |120| 500 | Internal server error |121| 502 | Service is down or being upgraded |122123## Before You Start — Setup Checklist1241251. Register with Click and sign contract with connected bank1262. Receive credentials: `merchant_id`, `service_id`, `SECRET_KEY`, `merchant_user_id`1273. Get access to merchant cabinet at `merchant.click.uz`1284. Set **Prepare URL** and **Complete URL** in merchant cabinet → Сервисы → pencil icon1295. Request service activation from Click support (disabled by default!)1306. If NOT on TAS-IX: provide domain + IP + port for firewall whitelisting1317. Static IP required — notify Click before changing132133## Critical Implementation Rules1341351. **Single callback endpoint** — one URL for both Prepare (action=0) and Complete (action=1)1362. **Content-Type is form-urlencoded** — SHOP API sends `application/x-www-form-urlencoded`, NOT JSON1373. **Amounts in SO'M** — NOT tiyin! Float format: `50000.00`1384. **Always verify sign_string** with constant-time comparison1395. **Check `error` field in requests** — if Click sends error ≤ -1, respond with error -91406. **Protect against duplicate click_trans_id** processing1417. **Verify merchant_prepare_id** in Complete matches Prepare record1428. **Complete error=0 → fulfill order; error<0 → cancel order**1439. **Fiscalization mandatory** for more than 1 IKPU code14410. **Service must be activated** by Click support before real payments14511. **IP must be static** — notify Click before any change14612. **Log click_paydoc_id** — shown in user's SMS, needed for support queries147148## Common Gotchas149150- **Callback URLs must be publicly accessible** — `localhost` won't work in production151- **Prepare URL validation** — merchant cabinet validates format; must be valid HTTPS URL152- **sign_string concatenation** — NO separators between params153- **merchant_prepare_id overflow** — use proper integer, `Date.now() % 2147483647` causes collisions154- **Response must always be JSON** with all required fields, even on error155- **After successful Complete (error=0)** — response CANNOT be error (except -4 or -9)156- **If fulfillment fails after successful Complete** — respond success, then cancel via Merchant API reversal157158## Reference Files — Complete docs.click.uz Mirror159160Each file corresponds 1:1 to a docs.click.uz page. Nothing is cut.161162### SHOP API163- `references/01-shop-api-overview.md` — General provisions, terms, flow diagram164- `references/02-shop-api-requests.md` — Prepare & Complete full spec with code examples165- `references/03-shop-api-errors.md` — All error codes (Click-side and merchant-side)166- `references/04-shop-api-testing.md` — Testing software, scenarios, report generation167168### Payment Integration169- `references/05-payment-button.md` — Payment link URL and HTML form (with redirect)170- `references/06-inline-checkout.md` — checkout.js widget, createPaymentRequest() JS API171172### Merchant API173- `references/07-merchant-api-overview.md` — General provisions, terms, flow diagram, contract info174- `references/08-merchant-api-requests.md` — All endpoints: invoice, payment status, reversal, card token175- `references/09-merchant-api-errors.md` — HTTP status codes176177### Additional178- `references/10-click-pass.md` — QR-code POS payments, confirm mode179- `references/11-fiscalization.md` — OFD submit_items, submit_qrcode, get fiscal data180- `references/12-telegram-payments.md` — Bot setup, sendInvoice, pre_checkout_query, live mode181- `references/13-mobile-sdk.md` — Android SDK, iOS deep links, return_url handling182- `references/14-server-examples.md` — Official PHP, Django repos + community Node.js/TypeScript183- `references/15-cms-plugins.md` — WooCommerce, OpenCart, Drupal, 1C-Bitrix, Joomla, CS-Cart