webmens-ru/b24-partners-api-php-sdk 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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 requests
  • requests()->get(requestId, orderId) — Get single request
  • requests()->getPayment(requestId, orderId) — Get payment data
  • requests()->create(email, items, portalUrl, ...) — Create request

Netflow

  • netflow()->summary(dateFrom, dateTo) — Get summary
  • netflow()->events(page, limit, ...) — List events
  • netflow()->base(date) — Get base snapshot
  • netflow()->baseList(date, page, limit, ...) — List base
  • netflow()->clientList(page, limit, ...) — List clients
  • netflow()->attentionList(dateTo, page, limit, ...) — List attention clients
  • netflow()->dictionary(lang) — Get code dictionary

Requirements

  • PHP >= 8.0
  • Guzzle 7

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: proprietary
  • 更新时间: 2026-07-02

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固