定制 select-co/module-sage200-api 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

select-co/module-sage200-api

最新稳定版本:1.1.1

Composer 安装命令:

composer require select-co/module-sage200-api

包简介

Magento 2 connector to interact with Sage200 API

README 文档

README

Github license Open issues Open Pull Requests Last commit

An unofficial API client to interact with the Sage200 API.

Requirements

  • Sage200
    • Sage200 API setup and configured.
    • Developer subscription key
    • Client ID & Client Secret
  • Magento 2 (tested with 2.3.5)
  • PHP ^7.3

Sage 200 API Credentials Request Form

Admin configuration for Refresh Token Expiry Days must match the value on Sage 200 API Credentials Request Form.

The callback URL entered on the request form must be https://{SUBDOMAIN}.{DOMAIN}/{ADMIN_ROUTE}/s200/oauth/callback

e.g. https://shop.example.com/admin_5fj7t/s200/oauth/callback

Authentication

This client uses league/oauth2-client for authentication using the Authorization Code Grant and credentials provided in Admin configuration.

For more information, please refer to the official Sage200 API Documentation.

Installation

Add GitHub repo to your composer.json repositories.

{
  "repositories": [
    {
      "type": "vcs",
      "url": "https://github.com/SelectCo/magento2-module-sage200-api.git"
    }
  ]
}

Require package with composer.

composer require select-co/module-sage200-api

Configuration

Admin configurations must be set before use.

  • API OAuth Details
    • Client Id
    • Client Secret
    • Developer Subscription Key
    • X-Site Id
    • X-Company Id

Default values used for:-

  • Sage200 Base Url
  • Authorise URL
  • Access Token URL
  • Resource Owner URL
  • Scope Access

Token Management

Token management is done through Admin => System => Other Settings => Sage200 Token Management where you can refresh, or get a new token.

Details of a valid token are displayed here with available companies.

CLI/Console Commands

  • sage200:token:check

    • Checks whether the current access token and refresh token are valid and reports time to expiry.
    • Usage: bin/magento sage200:token:check
  • sage200:token:refresh

    • Tries to refresh the access token using the stored refresh token and outputs new expiry times.
    • Usage: bin/magento sage200:token:refresh

Cron

  • The module includes a scheduled job that:
    • Refreshes the access token automatically when it has less than 30 minutes remaining. This can be changed in the Admin configuration.
    • Sends email notifications when the access token is missing/expired or the refresh token is nearing expiry, according to Admin configuration.
  • Ensure Magento cron is configured on your environment.

Usage

$results = json_decode(
    $this->connector->send(
        'sop_orders',
        'GET',
        $query
    ), true
);
$results = json_decode(
    $this->connector->send(
      'sop_orders/' . $id,
      'GET',
      $query
    ), true
);

Changelog

Please see CHANGELOG for more information on what has changed recently.

Resources

Sage 200 API Documentation

License

MIT. See LICENSE.

Support

If you have a feature request or spotted a bug or a technical problem, create a GitHub issue.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-10-20