nethead.co/otto-php-client 问题修复 & 功能扩展

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

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

nethead.co/otto-php-client

Composer 安装命令:

composer require nethead.co/otto-php-client

包简介

README 文档

README

This PHP package is automatically generated by the Swagger Codegen project:

  • API version: 1.0.0
  • Package version: 1.0.0
  • Build package: io.swagger.codegen.v3.generators.php.PhpClientCodegen

Requirements

PHP 5.5 and later

Installation & Usage

Composer

To install the bindings via Composer, add the following to composer.json:

{
  "repositories": [
    {
      "type": "git",
      "url": "http://github.com/nethead-co/otto-php-client.git"
    }
  ],
  "require": {
    "nethead-co/otto-php-client": "*@dev"
  }
}

Then run composer install

Manual Installation

Download the files and include autoload.php:

    require_once('/path/to/otto-php-client/vendor/autoload.php');

Tests

To run the unit tests:

composer install
./vendor/bin/phpunit

Getting Started

Please follow the installation procedure and then run the following:

<?php
require_once(__DIR__ . '/vendor/autoload.php');


$apiInstance = new Otto\Client\Api\OrdersV4Api(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$sales_order_id = "sales_order_id_example"; // string | The salesOrderId of the order
$position_item_id = array("position_item_id_example"); // string[] | The positionItemIds of the order to cancel

try {
    $apiInstance->ordersV4CancelPartnerOrderPositionItems($sales_order_id, $position_item_id);
} catch (Exception $e) {
    echo 'Exception when calling OrdersV4Api->ordersV4CancelPartnerOrderPositionItems: ', $e->getMessage(), PHP_EOL;
}


$apiInstance = new Otto\Client\Api\OrdersV4Api(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$sales_order_id = array("sales_order_id_example"); // string[] | The salesOrderIds of the orders to cancel

try {
    $apiInstance->ordersV4CancelPartnerOrders($sales_order_id);
} catch (Exception $e) {
    echo 'Exception when calling OrdersV4Api->ordersV4CancelPartnerOrders: ', $e->getMessage(), PHP_EOL;
}


$apiInstance = new Otto\Client\Api\OrdersV4Api(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$from_date = "from_date_example"; // string | Defines earliest change date (ISO 8601) the returned orders should have
$from_order_date = "from_order_date_example"; // string | Only orders newer than the date specified (ISO 8601) will be returned
$to_order_date = "to_order_date_example"; // string | Only orders older than the date specified (ISO 8601) will be returned
$fulfillment_status = "fulfillment_status_example"; // string | <br>ANNOUNCED: Orders with at least one position item in state ANNOUNCED<br>PROCESSABLE: Orders with at least one position item in state PROCESSABLE and none in ANNOUNCED<br>SENT: Orders with at least one position item in state SENT and none in either ANNOUNCED or PROCESSABLE<br>RETURNED: Orders with at least one position item in state RETURNED and none in either ANNOUNCED, PROCESSABLE, or SENT<br>CANCELLED_BY_PARTNER: Orders with at least one position item in state CANCELLED_BY_PARTNER<br>CANCELLED_BY_MARKETPLACE: Orders with at least one position item in state CANCELLED_BY_MARKETPLACE<br><br>If no state is provided, orders in all possible states are returned.<br>Several values can be passed; it will return a combination of these states without duplicates. Also see parameter 'mode'.<br><br>Example: ?fulfillmentStatus=PROCESSABLE&fulfillmentStatus=CANCELLED_BY_MARKETPLACE
$limit = 128; // int | The maximum amount of orders to return
$order_direction = "ASC"; // string | Sort result by 'orderColumnType' in ASCending or DESCending order
$order_column_type = "ORDER_LIFECYCLE_DATE"; // string | The column on which to apply 'orderDirection' parameter
$mode = "BUCKET"; // string | In search mode AT_LEAST_ONE orders with at least one  position item in given 'fulfillmentStatus' will always be returned
$nextcursor = "nextcursor_example"; // string | Cursor for paging requests. If a next cursor is provided, the only other request parameter being considered is 'limit'<br><br>Note: Only the cursor string is required - not the whole link

try {
    $result = $apiInstance->ordersV4FindPartnerOrders($from_date, $from_order_date, $to_order_date, $fulfillment_status, $limit, $order_direction, $order_column_type, $mode, $nextcursor);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling OrdersV4Api->ordersV4FindPartnerOrders: ', $e->getMessage(), PHP_EOL;
}


$apiInstance = new Otto\Client\Api\OrdersV4Api(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$order_number = "order_number_example"; // string | 

try {
    $result = $apiInstance->ordersV4GetPartnerOrderByOrderNumber($order_number);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling OrdersV4Api->ordersV4GetPartnerOrderByOrderNumber: ', $e->getMessage(), PHP_EOL;
}


$apiInstance = new Otto\Client\Api\OrdersV4Api(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$sales_order_id = "sales_order_id_example"; // string | 

try {
    $result = $apiInstance->ordersV4GetPartnerOrderBySalesOrderId($sales_order_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling OrdersV4Api->ordersV4GetPartnerOrderBySalesOrderId: ', $e->getMessage(), PHP_EOL;
}
?>

Documentation for API Endpoints

All URIs are relative to https://api.otto.market

Class Method HTTP request Description
OrdersV4Api ordersV4CancelPartnerOrderPositionItems POST /v4/orders/{salesOrderId}/positionItems/{positionItemId}/cancellation Cancel specific position items of an order
OrdersV4Api ordersV4CancelPartnerOrders POST /v4/orders/{salesOrderId}/cancellation Cancel all position items of an order
OrdersV4Api ordersV4FindPartnerOrders GET /v4/orders List of orders filtered by fulfillment state
OrdersV4Api ordersV4GetPartnerOrderByOrderNumber GET /v4/orders/{orderNumber} Get an order via order number
OrdersV4Api ordersV4GetPartnerOrderBySalesOrderId GET /v4/orders/{salesOrderId} Get an order via sales order id
ProductsV2Api productsV2CreateOrUpdateProductVariations POST /v2/products Create or update your product variations
ProductsV2Api productsV2FailedByProcessId GET /v2/products/update-tasks/{processUuid}/failed List failed products of a product data delivery
ProductsV2Api productsV2GetActiveStatus GET /v2/products/active-status Read the active status of your product variations
ProductsV2Api productsV2GetBrands GET /v2/products/brands List brands
ProductsV2Api productsV2GetCategoryGroups GET /v2/products/categories Read the product categories
ProductsV2Api productsV2GetContentChanges GET /v2/products/{sku}/content-changes Read content changes for a single product variation
ProductsV2Api productsV2GetContentChanges2 GET /v2/products/content-changes Read content changes within time period
ProductsV2Api productsV2GetMarketPlaceStatus GET /v2/products/{sku}/marketplace-status Read the marketplace status for a single product variation
ProductsV2Api productsV2GetMarketPlaceStatusList GET /v2/products/marketplace-status Read the marketplace status for your product variations
ProductsV2Api productsV2GetPartnerProducts GET /v2/products Read your product variations
ProductsV2Api productsV2GetProductVariation GET /v2/products/{sku} Read a single product variation
ProductsV2Api productsV2GetProductVariationPrice GET /v2/products/{sku}/prices Read product variations prices
ProductsV2Api productsV2GetProductVariationPrices GET /v2/products/prices Read product variations prices
ProductsV2Api productsV2GetVariationActiveStatus GET /v2/products/{sku}/active-status Read the active status of a single product variation
ProductsV2Api productsV2ProgressByProcessId GET /v2/products/update-tasks/{processUuid} Request the results of a product data delivery
ProductsV2Api productsV2SucceededByProcessId GET /v2/products/update-tasks/{processUuid}/succeeded List succeeded products of a product data delivery
ProductsV2Api productsV2UnchangedByProcessId GET /v2/products/update-tasks/{processUuid}/unchanged List unchanged products of a product data delivery
ProductsV2Api productsV2UpdateActiveStatus POST /v2/products/active-status Update the active status of your product variations
ProductsV2Api productsV2UpdateProductVariationPrices POST /v2/products/prices Update product variation prices
QuantitiesV2Api quantitiesV2GetAvailableQuantities GET /v2/quantities Get available quantities for a specific Partner (Upto 200 per request). The partner needs to update the quantities for all his products once or limit the products being returned in the response by setting the limit value to number of products they have updated
QuantitiesV2Api quantitiesV2GetAvailableQuantityBySku GET /v2/quantities/{sku} Get available quantity for a specific Sku
QuantitiesV2Api quantitiesV2StoreAvailableQuantitiesUsingPOST POST /v2/quantities Update the available quantity for a specific SKU (up to 200 SKUs per request)
ReceiptsV2Api receiptsV2GetReceiptPdfUsingGET3 GET /v2/receipts/{receiptNumber}.pdf Get the PDF document of a specific receipt by receipt number.
ReceiptsV2Api receiptsV2GetReceiptUsingGET5 GET /v2/receipts/{receiptNumber} Get a specific receipt for the given receipt number as JSON object
ReceiptsV2Api receiptsV2GetReceiptsUsingGET5 GET /v2/receipts Get all receipts as list of JSON objects
ReturnsV2Api returnsV2GetPositionItemsForUsingGETV2 GET /v2/returns Get all the items filtered on return status
ReturnsV2Api returnsV2ReceiveAcceptedReturnsV2UsingPOSTV2 POST /v2/returns/acceptance Accept the return for a sent position item (up to 200 items per request)
ReturnsV2Api returnsV2ReceiveRejectedReturnsV2UsingPOSTV2 POST /v2/returns/rejection Reject the return for a sent position item (up to 200 items per request)
ShipmentsV1Api shipmentsV1AppendPositionItemsByCarrierAndTrackingNumberUsingPOST POST /v1/shipments/carriers/{carrier}/trackingnumbers/{trackingNumber}/positionitems Correct an existing shipment (add sent items) by carrier and tracking number.
ShipmentsV1Api shipmentsV1AppendPositionItemsUsingPOST POST /v1/shipments/{shipmentId}/positionitems Correct an existing shipment (add sent items) by shipment ID.
ShipmentsV1Api shipmentsV1CreatedAndSentShipmentUsingPOST POST /v1/shipments Create a shipment and mark the position items as sent.
ShipmentsV1Api shipmentsV1ListShipmentsUsingGET GET /v1/shipments Retrieve shipments.
ShipmentsV1Api shipmentsV1ShipmentByCarrierAndTrackingNumberUsingGET GET /v1/shipments/carriers/{carrier}/trackingnumbers/{trackingNumber} Retrieve shipment by shipment ID.
ShipmentsV1Api shipmentsV1ShipmentUsingGET GET /v1/shipments/{shipmentId} Retrieve a shipment and its position items.

Documentation For Models

Documentation For Authorization

JWT

  • Type: HTTP bearer authentication

Author

nethead.co/otto-php-client 适用场景与选型建议

nethead.co/otto-php-client 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 146 次下载、GitHub Stars 达 2, 最近一次更新时间为 2020 年 09 月 15 日, 在 PHP 生态内属于活跃度较高的组件。

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

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

围绕 nethead.co/otto-php-client 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: proprietary
  • 更新时间: 2020-09-15