承接 landofcoder/trackingmore-php 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

landofcoder/trackingmore-php

Composer 安装命令:

composer require landofcoder/trackingmore-php

包简介

Trackingmore PHP Library

README 文档

README

The PHP SDK of Trackingmore API

Official document

Document

##Init

if (!defined("TRACKING_AUTOLOADER_PATH")) {
    define("TRACKING_AUTOLOADER_PATH", __DIR__);
}
require_once(__DIR__ . "/Autoloader.php");
use Tracking\Api;

# Pass api key parameter
$api = new Api('you api key');

Quick Start

  • Put your ApiKey in the constructor of the Api class
  • All returns are in Json format.
  • After instantiating the Api class, you can use its interface methods
  • You can set the sandbox of the Api instance to true to turn on the sandbox mode: $api->sandbox=true;
  • Most Api params receive multiple tracking numbers

Get a list of the couriers in Trackingmore

$response = $api->courier();

Detect which couriers defined in your account match a tracking number

$data = ['tracking_number': 'EA152563254CN']
$response = $api->detect($data);

Post trackings to your account

//Create single tracking numbers
$data = ["tracking_number" => "RP325552475CN", "carrier_code" => "china-post"];
//Create multiple tracking numbers
$data = [
    ["tracking_number" => "RP325552475CN", "carrier_code" => "china-post"],
    ["tracking_number" => "LZ448865302CN", "carrier_code" => "china-ems"],
];
$response =$api->create($data);

Summary of Connection API Methods with all the api and Methods

#sandbox model
$api->sandbox = true;
# Get a tracking number of real-time query result data
//$data = ["tracking_number" => "UB209300714LV", "carrier_code" => "cainiao"];
//$response = $api->realtime($data);

# archive
$data = ["tracking_number" => "RP325552475CN", "carrier_code" => "china-post"];
$response = $api->archive($data);

# Get a list of all carriers
$response = $api->courier();

# Create a tracking number
$data = ["tracking_number" => "RP325552475CN", "carrier_code" => "china-post"];
$response = $api->create($data);

# Create multiple tracking numbers
$data = [
["tracking_number" => "RP325552475CN", "carrier_code" => "china-post"],
["tracking_number" => "LZ448865302CN", "carrier_code" => "china-ems"],
];
$response =$api->create($data);
//
# Get logistics information for a tracking number
$response = $api->get("RP325552475CN","china-post");

# Get logistics information for multiple tracking numbers
$data = ["tracking_number" => "RP325552475CN,LZ448865302CN"];
$response = $api->get($data);

# Modify other information of a tracking number
$data = ['num'=>"RP325552475CN",'carrier_code'=>"china-post","order_id" => "#1234"];
$response = $api->modifyinfo($data);

# Modify the information of multiple tracking numbers
$data = [
["tracking_number" => "RP325552475CN", "carrier_code" => "china-post", "order_id" => "#1234",],
["tracking_number" => "LZ448865302CN", "carrier_code" => "china-ems", "order_id" => "#5678",],
];
$response =  $api->modifyinfo($data);

# Modify the carrier code of a tracking number
$data = ["tracking_number" => "RP325552475CN", "carrier_code" => "china-post", "new_carrier_code" => "china-ems"];
$response =  $api->modifyCourier($data);

# Delete a tracking number
$response = $api->delete("RP325552475CN","china-post");

# Delete multiple tracking numbers
$data = [
["tracking_number" => "RP325552475CN", "carrier_code" => "china-post"],
["tracking_number" => "LZ448865302CN", "carrier_code" => "china-ems"],
];
$response = $api->delete($data);

# Set multiple tracking numbers no longer update
$data = [
["tracking_number" => "RP325552475CN", "carrier_code" => "china-post"],
["tracking_number" => "LZ448865302CN", "carrier_code" => "china-ems"],
];
$response = $api->notUpdate($data);

# Get status statistics of tracking ticket number
$data = ["created_at_min" => time() - 3600 * 24 * 30, "created_at_max" => time()];
$response = $api->status($data);

# Get user information
$response =  $api->user();

# Query whether remote
$data = [
["country" => "Japan", "postcode" => "7621094"],
["country" => "NZ", "postcode" => "Papaaroha"],
];
$response = $api->remote($data);

# Get the timeliness of multiple carriers
$data = [
["original" => "CN", "destination" => "US", "carrier_code" => "dhl"],
["original" => "CN", "destination" => "RU", "carrier_code" => "dhl"],
];
$response = $api->transitTime($data);

Typical Server Responses

We will respond with one of the following status codes.

Code Type Message
200 Success Request response is successful
203 PaymentRequired API service is only available for paid account Please subscribe paid plan to unlock API services ul
204 No Content Request was successful, but no data returned Tracking NO. or target data possibly do not exist
400 Bad Request Request type error Please check the API documentation for the request type of this API
401 Unauthorized Authentication failed or has no permission Please check and ensure your API Key is correct
403 Bad Request Page does not exist Please check and ensure your link is correct ul
404 Not Found Page does not exist Please check and ensure your link is correct
408 Time Out Request timeout The official website did not return data, please try again later
411 Bad Request Specified request parameter length exceeds length limit Please check and ensure that the request parameters are of the required length
412 Bad Request Specified request parameter format doesn't meet requirements Please check and ensure that the request parameters are in the required format
413 Out limited The number of request parameters exceeds the limit Please check the API documentation for the limit of this API
417 Bad Request Missing request parameters or request parameters cannot be parsed Please check and ensure that the request parameters are complete and correctly formatted
421 Bad Request Some of required parameters are empty Some couriers need special parameters to track logistics information (Special Couriers)
422 Bad Request Unidentifiable courier code Please check and ensure that the courier code are correct(Courier code)
423 Bad Request Tracking No. already exists
424 Bad Request Tracking No. no exists Please use 「Create trckings」 API first to create trackings
429 Bad Request Exceeded API request limits, please try again later Please check the API documentation for the limit of this API
511 Server Error Server error Please contact us: service@trackingmore.org.
512 Server Error Server error Please contact us: service@trackingmore.org.
513 Server Error Server error Please contact us: service@trackingmore.org.

landofcoder/trackingmore-php 适用场景与选型建议

landofcoder/trackingmore-php 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 58 次下载、GitHub Stars 达 1, 最近一次更新时间为 2021 年 12 月 09 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「api」 「trackingmore」 「tracking shipment」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 landofcoder/trackingmore-php 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 landofcoder/trackingmore-php 我们能提供哪些服务?
定制开发 / 二次开发

基于 landofcoder/trackingmore-php 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-12-09