Bog'lash havolasini yaratish
Foydalanuvchi "Karta qo'shish" tugmasini bosganda, hamkor backend'i bir martalik bog'lash havolasini (bindUrl) so'raydi.
Endpoint details
Method:
POST
URL: BASE_URL/merchant/userCard/createBindLink/
Header:
http
Authorization: Bearer < ACCESS_TOKEN >
Content-Type: application/jsonRequest body
| Fields | Type | Required | Description |
|---|---|---|---|
| userId | string | Yes | Hamkor tizimidagi foydalanuvchi ID'si (ichki ID, hamkor o'zi beradi) |
| returnUrl | string | No | Webview tugagach qaytariladigan manzil |
json
{
"userId": "partner-user-10234",
"returnUrl": "https://partner-app.example/wallet/cards"
}Request example
bash
curl -X POST https://gw2.paylov.uz/merchant/userCard/createBindLink/ \
-H "Authorization: Bearer <ACCESS_TOKEN>" \
-H "Content-Type: application/json" \
-d '{
"userId": "partner-user-10234",
"returnUrl": "https://partner-app.example/wallet/cards"
}'Success response
json
{
"result": {
"token": "pR3x...kLq9",
"bindUrl": "https://my.paylov.uz/card-bind/?token=pR3x...kLq9",
"expiresAt": "2026-10-30T12:20:00+00:00"
},
"error": null
}| Field | Type | Description |
|---|---|---|
| token | string | Bir martalik token. Webhook va holatni tekshirishda so'rovni aniqlash uchun ishlatiladi |
| bindUrl | string | Webview'da ochiladigan havola |
| expiresAt | string | Havola amal qilish muddati (ISO 8601) |
Eslatma
bindUrl — bir martalik, taxminan 20 daqiqa amal qiladi va faqat bitta karta bog'lash uchun ishlaydi. Yangi karta bog'lash uchun har safar yangi havola so'ralishi kerak.
Fail response
json
{
"result": null,
"error": {
"code": "permission_denied",
"message": "permission_denied"
}
}Keyingi qadam: bindUrlni webview'da oching — Karta bog'lash.