alanaktion/magento2-swagger-api

此包已被废弃且不再维护。未建议替代包。

v0.0.1 2020-01-21 19:39 UTC

This package is auto-updated.

Last update: 2020-02-22 16:42:16 UTC


README

Magento 2 REST API (由 Swagger Codegen 生成 https://github.com/swagger-api/swagger-codegen)

此 PHP 包由 Swagger Codegen 项目自动生成

  • API 版本:2.3
  • 构建包:io.swagger.codegen.v3.generators.php.PhpClientCodegen

生成/使用此包装器

您可以使用包含的 generate.sh 文件自行生成此包装器。如果希望直接使用,它可通过 Composer 获取

composer require alanaktion/magento2-swagger-api

限制

由于 Magento 2 处理 URL 参数的方式,此包装器可能仅适用于某些端点的参考实现。例如,搜索 API 使用复杂的动态参数,无法正确自动生成,因此在此包装器中不可用。我不计划以任何方式手动修改此包装器以提高兼容性或添加功能,但如果您想自己尝试,欢迎 fork 仓库。

由于这些限制,我可能不会更新此包,除非情况改变,否则将存档此仓库。

要求

PHP 5.5 及以上

安装 & 使用

Composer

要使用 Composer 安装绑定,请将以下内容添加到 composer.json

{
  "repositories": [
    {
      "type": "git",
      "url": "https://github.com/GIT_USER_ID/GIT_REPO_ID.git"
    }
  ],
  "require": {
    "GIT_USER_ID/GIT_REPO_ID": "*@dev"
  }
}

然后运行 composer install

手动安装

下载文件并包含 autoload.php

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

测试

要运行单元测试

composer install
./vendor/bin/phpunit

入门

请按照安装过程进行,然后运行以下命令

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

$apiInstance = new MagentoApi\Api\AmazonPaymentAddressManagementV1Api(
    // 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()
);
$amazon_order_reference_id = "amazon_order_reference_id_example"; // string |
$body = new \stdClass; // object |

try {
    $result = $apiInstance->amazonPaymentAddressManagementV1GetBillingAddressPut($amazon_order_reference_id, $body);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AmazonPaymentAddressManagementV1Api->amazonPaymentAddressManagementV1GetBillingAddressPut: ', $e->getMessage(), PHP_EOL;
}

$apiInstance = new MagentoApi\Api\AmazonPaymentAddressManagementV1Api(
    // 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()
);
$amazon_order_reference_id = "amazon_order_reference_id_example"; // string |
$body = new \stdClass; // object |

try {
    $result = $apiInstance->amazonPaymentAddressManagementV1GetShippingAddressPut($amazon_order_reference_id, $body);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AmazonPaymentAddressManagementV1Api->amazonPaymentAddressManagementV1GetShippingAddressPut: ', $e->getMessage(), PHP_EOL;
}
?>

API 端点文档

所有 URI 都是相对于 /rest/default

方法 HTTP 请求 描述
AmazonPaymentAddressManagementV1Api amazonPaymentAddressManagementV1GetBillingAddressPut PUT /V1/amazon-billing-address/{amazonOrderReferenceId}
AmazonPaymentAddressManagementV1Api amazonPaymentAddressManagementV1GetShippingAddressPut PUT /V1/amazon-shipping-address/{amazonOrderReferenceId}
AmazonPaymentOrderInformationManagementV1Api amazonPaymentOrderInformationManagementV1RemoveOrderReferenceDelete DELETE /V1/amazon/order-ref
CatalogProductRenderListV1Api catalogProductRenderListV1GetListGet GET /V1/products-render-info
CheckoutGuestPaymentInformationManagementV1Api checkoutGuestPaymentInformationManagementV1GetPaymentInformationGet GET /V1/guest-carts/{cartId}/payment-information
CheckoutGuestPaymentInformationManagementV1Api 结账客人支付信息管理V1保存支付信息并下单POST POST /V1/guest-carts/{cartId}/payment-information
CheckoutGuestPaymentInformationManagementV1Api 结账客人支付信息管理V1保存支付信息POST POST /V1/guest-carts/{cartId}/set-payment-information
结账客人发货信息管理V1Api 结账客人发货信息管理V1保存地址信息POST POST /V1/guest-carts/{cartId}/shipping-information
结账客人总计信息管理V1Api 结账客人总计信息管理V1计算POST POST /V1/guest-carts/{cartId}/totals-information
客户账户管理V1Api 客户账户管理V1创建账户POST POST /V1/customers
客户账户管理V1Api 客户账户管理V1启动密码重置PUT PUT /V1/customers/password
客户账户管理V1Api 客户账户管理V1检查电子邮件是否可用POST POST /V1/customers/isEmailAvailable
客户账户管理V1Api 客户账户管理V1重置密码POST POST /V1/customers/resetPassword
客户账户管理V1Api 客户账户管理V1验证重置密码链接令牌GET GET /V1/customers/{customerId}/password/resetLinkToken/{resetPasswordLinkToken}
目录国家信息获取者V1Api 目录国家信息获取者V1获取国家信息GET GET /V1/directory/countries
目录国家信息获取者V1Api 目录国家信息获取者V1获取国家信息GET GET /V1/directory/countries/{countryId}
目录货币信息获取者V1Api 目录货币信息获取者V1获取货币信息GET GET /V1/directory/currency
礼品信息客人购物车存储库V1Api 礼品信息客人购物车存储库V1获取GET GET /V1/guest-carts/{cartId}/gift-message
礼品信息客人购物车存储库V1Api 礼品信息客人购物车存储库V1保存POST POST /V1/guest-carts/{cartId}/gift-message
礼品信息客人项目存储库V1Api 礼品信息客人项目存储库V1获取GET GET /V1/guest-carts/{cartId}/gift-message/{itemId}
礼品信息客人项目存储库V1Api 礼品信息客人项目存储库V1保存POST POST /V1/guest-carts/{cartId}/gift-message/{itemId}
集成管理员令牌服务V1Api 集成管理员令牌服务V1创建管理员访问令牌POST POST /V1/integration/admin/token
集成客户令牌服务V1Api 集成客户令牌服务V1创建客户访问令牌POST POST /V1/integration/customer/token
报价客人账单地址管理V1Api 报价客人账单地址管理V1分配POST POST /V1/guest-carts/{cartId}/billing-address
报价客人账单地址管理V1Api 报价客人账单地址管理V1获取GET GET /V1/guest-carts/{cartId}/billing-address
报价客人购物车项存储库V1Api 报价客人购物车项存储库V1按ID删除DELETE DELETE /V1/guest-carts/{cartId}/items/{itemId}
报价客人购物车项存储库V1Api 报价客人购物车项存储库V1获取列表GET GET /V1/guest-carts/{cartId}/items
报价客人购物车项存储库V1Api 报价客人购物车项存储库V1保存POST POST /V1/guest-carts/{cartId}/items
报价客人购物车项存储库V1Api 报价客人购物车项存储库V1保存PUT PUT /V1/guest-carts/{cartId}/items/{itemId}
报价客人购物车管理V1Api 报价客人购物车管理V1创建空购物车POST POST /V1/guest-carts
报价客人购物车管理V1Api 报价客人购物车管理V1下单PUT PUT /V1/guest-carts/{cartId}/order
报价客人购物车存储库V1Api 报价客人购物车存储库V1获取GET GET /V1/guest-carts/{cartId}
报价客人购物车总计管理V1Api 报价客人购物车总计管理V1收集总计PUT PUT /V1/guest-carts/{cartId}/collect-totals
报价客人购物车总计存储库V1Api 报价客人购物车总计存储库V1获取GET GET /V1/guest-carts/{cartId}/totals
报价客人优惠券管理V1Api 报价客人优惠券管理V1获取GET GET /V1/guest-carts/{cartId}/coupons
报价客人优惠券管理V1Api 报价客人优惠券管理V1删除DELETE DELETE /V1/guest-carts/{cartId}/coupons
报价客人优惠券管理V1Api 报价客人优惠券管理V1设置PUT PUT /V1/guest-carts/{cartId}/coupons/{couponCode}
报价客人支付方式管理V1Api 报价客人支付方式管理V1获取GET GET /V1/guest-carts/{cartId}/selected-payment-method
报价客人支付方式管理V1Api 报价客人支付方式管理V1获取列表GET GET /V1/guest-carts/{cartId}/payment-methods
报价客人支付方式管理V1Api 报价客人支付方式管理V1设置PUT PUT /V1/guest-carts/{cartId}/selected-payment-method
报价客人运输估算V1Api 报价客人运输估算V1通过扩展地址估算POST POST /V1/guest-carts/{cartId}/estimate-shipping-methods
报价客人运输方式管理V1Api 报价客人运输方式管理V1获取列表GET GET /V1/guest-carts/{cartId}/shipping-methods
搜索V1Api 搜索V1搜索GET GET /V1/search
Temando运输结账客人购物车集合点管理V1Api temando运输结账客人购物车集合点管理V1删除搜索请求DELETE DELETE /V1/guest-carts/{cartId}/collection-point/search-request
Temando运输结账客人购物车集合点管理V1Api temando运输结账客人购物车集合点管理V1获取集合点GET GET /V1/guest-carts/{cartId}/collection-point/search-result
Temando运输结账客人购物车集合点管理V1Api temando运输结账客人购物车集合点管理V1保存搜索请求PUT PUT /V1/guest-carts/{cartId}/collection-point/search-request
Temando运输结账客人购物车集合点管理V1Api temandoShippingCheckoutGuestCartCollectionPointManagementV1SelectCollectionPointPost POST /V1/guest-carts/{cartId}/checkout-collection-point/select
TemandoShippingCheckoutGuestCartPickupLocationManagementV1Api temandoShippingCheckoutGuestCartPickupLocationManagementV1SelectPickupLocationPost POST /V1/guest-carts/{cartId}/checkout-pickup-location/select
TemandoShippingDeliveryGuestCartCollectionPointManagementV1Api temandoShippingDeliveryGuestCartCollectionPointManagementV1SelectCollectionPointPost POST /V1/guest-carts/{cartId}/collection-point/select
TemandoShippingDeliveryGuestCartPickupLocationManagementV1Api temandoShippingDeliveryGuestCartPickupLocationManagementV1SelectPickupLocationPost POST /V1/guest-carts/{cartId}/pickup-location/select
TemandoShippingQuoteGuestCartCheckoutFieldManagementV1Api temandoShippingQuoteGuestCartCheckoutFieldManagementV1SaveCheckoutFieldsPost POST /V1/guest-carts/{cartId}/checkout-fields
TemandoShippingQuoteGuestCartDeliveryOptionManagementV1Api temandoShippingQuoteGuestCartDeliveryOptionManagementV1SavePost POST /V1/guest-carts/{cartId}/delivery-option

模型文档

授权文档

所有端点都不需要授权。

作者