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
- AcceptedPartnerReturnV2ReturnsV2
- AcceptedReturnMultiStatusResponseReturnsV2
- AcceptedStatusDataReturnsV2
- ActiveStatusListRequestProductsV2
- ActiveStatusListResponseProductsV2
- ActiveStatusProductsV2
- AdditionalRequirementProductsV2
- AddressOrdersV4
- AddressShipmentsV1
- AllOfLineItemReceiptsV2PriceToPay
- AllOfLineItemReceiptsV2Total
- AllOfLineItemReceiptsV2TotalDiscount
- AllOfLineItemReceiptsV2UnitPrice
- AllOfPartialRefundReceiptsV2PartialRefundAmount
- AllOfServicePositionInfoReceiptsV2Total
- AllOfServicePositionInfoReceiptsV2UnitPrice
- AllOfShippingFeeReceiptsV2Price
- AllOfTotalReceiptsV2AmountDue
- AllOfTotalReceiptsV2Gross
- AllOfTotalReceiptsV2Net
- AmountOrdersV4
- AnnouncedStatusDataReturnsV2
- ApiErrorResponseReturnsV2
- ApiErrorResponseV2QuantitiesV2
- ApiErrorReturnsV2
- ApiErrorV2QuantitiesV2
- AttributeDefinitionProductsV2
- AttributeProductsV2
- AvailableQuantityRequestDTOV2QuantitiesV2
- AvailableQuantityResponseDTOV2QuantitiesV2
- AvailableQuantityResponseV2QuantitiesV2
- AvailableQuantityResponseV2QuantitiesV2Resources
- AvailableQuantitySingleResponseDTOV2QuantitiesV2
- BadRequestAddPositionItemByShipmentIdShipmentsV1
- BadRequestAddPositionItemByTrackingNumberShipmentsV1
- BadRequestShipmentsV1
- BrandProductsV2
- CategoryGroupProductsV2
- CategoryGroupsProductsV2
- ConditionProductsV2
- ConflictAddPositionItemByShipmentIdShipmentsV1
- ConflictAddPositionItemByTrackingNumberShipmentsV1
- ConflictShipmentsV1
- ContentChangeProductsV2
- ContentChangesApiResultProductsV2
- CreateShipmentRequestShipmentsV1
- CreateShipmentResponseShipmentsV1
- CustomerReceiptsV2
- DeliveryAddressReceiptsV2
- DeliveryProductsV2
- DiscountDetailsReceiptsV2
- ErrorDescriptionShipmentsV1
- ForbiddenGetShipmentByShipmentIdShipmentsV1
- ForbiddenGetShipmentByTrackingNumberShipmentsV1
- InitialDeliveryFeeOrdersV4
- InitialDiscountOrdersV4
- InternalServerErrorAddPositionItemByShipmentIdShipmentsV1
- InternalServerErrorAddPositionItemByTrackingNumberShipmentsV1
- InternalServerErrorGetShipmentByShipmentIdShipmentsV1
- InternalServerErrorGetShipmentByTrackingNumberShipmentsV1
- InternalServerErrorGetShipmentListShipmentsV1
- InternalServerErrorShipmentsV1
- LineItemReceiptsV2
- LinkOrdersV4
- LinkProductsV2
- LinkQuantitiesV2
- LinkReceiptsV2
- LinkRelationProductsV2
- LinkReturnsV2
- LinkShipmentsV1
- LogisticsProductsV2
- MarketPlaceStatusApiResultProductsV2
- MarketPlaceStatusErrorProductsV2
- MarketPlaceStatusInformationProductsV2
- MarketPlaceStatusLinkProductsV2
- MarketPlaceStatusProductsV2
- MediaAssetProductsV2
- MisdirectedStatusDataReturnsV2
- MonetaryAmountProductsV2
- NormPriceInfoProductsV2
- NotFoundAddPositionItemByShipmentIdShipmentsV1
- NotFoundAddPositionItemByTrackingNumberShipmentsV1
- NotFoundGetShipmentByShipmentIdShipmentsV1
- NotFoundGetShipmentByTrackingNumberShipmentsV1
- OrderLifecycleInformationOrdersV4
- PackingUnitProductsV2
- PartialRefundReceiptsV2
- PartnerOrderListOrdersV4
- PartnerOrderOrdersV4
- PartnerReceiptsV2
- PayloadTooLargeApiErrorResponseV2QuantitiesV2
- PaymentOrdersV4
- PositionItemListReturnsV2
- PositionItemOrdersV4
- PositionItemReturnsV2
- PositionItemShipmentsV1
- PriceApiResultProductsV2
- PricingProductsV2
- ProductDescriptionProductsV2
- ProductLinkProductsV2
- ProductOrdersV4
- ProductProcessProgressProductsV2
- ProductProcessResultLinkProductsV2
- ProductProcessResultProductsV2
- ProductProcessTaskErrorProductsV2
- ProductProcessTaskResultProductsV2
- ProductVariationApiResultProductsV2
- ProductVariationProductsV2
- ReceiptReceiptsV2
- ReceiptsListReceiptsV2
- RejectedPartnerReturnV2ReturnsV2
- RejectedPositionItemReturnsV2
- RejectedReturnMultiStatusResponseReturnsV2
- RejectedStatusDataReturnsV2
- ReturnTrackingKeyReturnsV2
- ReturnTrackingKeyShipmentsV1
- ReturnedItemStatusDataReturnsV2
- ReturnedPositionItemReturnsV2
- SaleProductsV2
- ServicePositionInfoReceiptsV2
- ServicePositionItemInfoReceiptsV2
- ShipmentListShipmentsV1
- ShipmentShipmentsV1
- ShipmentWithMinimumDetailsShipmentsV1
- ShippingCostReceiptsV2
- ShippingFeeReceiptsV2
- SkuPricingProductsV2
- TotalReceiptsV2
- TrackingInfoOrdersV4
- TrackingKeyShipmentsV1
- UnauthenticatedShipmentsV1
- UpdateQuantityMultiStatusResponseQuantitiesV2
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 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 nethead.co/otto-php-client 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A PSR-7 compatible library for making CRUD API endpoints
Alfabank REST API integration
Zero-dependency raw PHP DNS resolver, domain-ownership verification, and intoDNS/MxToolbox-style diagnostics. Queries authoritative nameservers directly over sockets — never trusts the recursive cache for ownership checks.
A lightweight plain-PHP framework for database-backed CRUD APIs.
bughq error tracking - PHP SDK
ABsurge PHP SDK for feature flags and A/B testing
统计信息
- 总下载量: 146
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 11
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: proprietary
- 更新时间: 2020-09-15