webmens-ru/b24-partners-api-php-sdk
Composer 安装命令:
composer require webmens-ru/b24-partners-api-php-sdk
包简介
PHP SDK for Bitrix24 Partner REST API (sb.api.v1.partner.*)
README 文档
README
PHP SDK for Bitrix24 Partner REST API (sb.api.v1.partner.*).
Installation
composer require webmens-ru/b24-partners-api-php-sdk
Quick Start
use Webmens\B24PartnersApi\PartnerApi; $api = new PartnerApi( accessToken: 'your-access-token', refreshToken: 'your-refresh-token', clientId: 'your-client-id', clientSecret: 'your-client-secret', ); // Get profile $profile = $api->profile()->get(); echo $profile->name; // List cloud clients $clients = $api->clients()->list(type: 'cloud', limit: 50); foreach ($clients->items as $client) { echo $client->portalUrl; } // Create order use Webmens\B24PartnersApi\Requests\RequestItem; $request = $api->requests()->create( email: 'client@example.com', portalUrl: 'demo.bitrix24.ru', items: [new RequestItem(productId: 16204918, quantity: 1)], ); echo $request->shortUrl; // Payment link // Netflow $attention = $api->netflow()->attentionList(withForecast: true);
Error Handling
use Webmens\B24PartnersApi\Exceptions\ValidationException; use Webmens\B24PartnersApi\Exceptions\UnauthorizedException; try { $request = $api->requests()->create(...); } catch (ValidationException $e) { foreach ($e->errors as $error) { echo "{$error['field']}: {$error['reason']}"; } } catch (UnauthorizedException $e) { // Refresh failed — need to reissue token }
Available Methods
Profile
profile()->get()— Get partner profile
Clients
clients()->list(type, page, limit)— List clients (cloud/box)clients()->get(type, cloudId, clientId)— Get single client
Requests
requests()->list(status, orderId, page, limit, sortField, sortOrder)— List requestsrequests()->get(requestId, orderId)— Get single requestrequests()->getPayment(requestId, orderId)— Get payment datarequests()->create(email, items, portalUrl, ...)— Create request
Netflow
netflow()->summary(dateFrom, dateTo)— Get summarynetflow()->events(page, limit, ...)— List eventsnetflow()->base(date)— Get base snapshotnetflow()->baseList(date, page, limit, ...)— List basenetflow()->clientList(page, limit, ...)— List clientsnetflow()->attentionList(dateTo, page, limit, ...)— List attention clientsnetflow()->dictionary(lang)— Get code dictionary
Requirements
- PHP >= 8.0
- Guzzle 7
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: proprietary
- 更新时间: 2026-07-02