inkpro/smartweb-api

Smartweb soap平台的API封装器

v1.0.3 2022-01-17 18:59 UTC

This package is auto-updated.

Last update: 2024-09-18 00:58:21 UTC


README

API文档可以在这里找到:https://api.hostedshop.dk/doc/
Smartweb使用soap客户端从他们的服务器池化。

启动的最简单方式

$client = new \inkpro\smartwebapi\Client(["Username"=>"myuser", "Password"=>"mypassword"]);

如果您需要指定wsdl url,可以这样做

$client = new \inkpro\smartwebapi\Client(
    ["Username"=>"myuser", "Password"=>"mypassword"],
    "https://customwsdl.url"
);

对于可用的方法,请查看/src/Client.php。可用方法的用法

检索所有产品

$products = $client->getAllProducts();

检索一个产品

$product = $client->getProduct();

更新一个产品

@param object $product Product object, should include either Id or ItemNumber prop.
$status = $client->updateProduct($product);

删除一个产品

$status = $client->deleteProduct($id);

检索所有类别

$categories = $client->getAllCategories();

检索一个类别

$category = $client->getCategory($categoryId);

检索所有用户。

$users = $client->getUsers();

检索所有新闻通讯用户。

$users = $client->getNewsletterUsers();

从新闻通讯中取消用户订阅。

$status = $client->unsubscribeNewsletterUser($user);

通过ID获取用户。

$user = $client->getUser($id);

通过电子邮件获取用户。

$user = $client->getUserByEmail($email);

创建用户

@param object $user User object, corresponding to smartweb UserCreate schema.
* @see https://api.smart-web.dk/doc/Hosted%20Solution%20API/UserCreate.html
$status = $client->createUser($user);

创建订单

@param object $order OrderData object, corresponding to smartweb Order_Create schema.
$status = $client->createOrder($order);

获取订单

$order = $client->getOrder($orderId);

检索所有订单

* @param DateTime $start The first date to get orders from.
* @param DateTime $end The last date to get orders from.
* @param array $status The status codes of the orders you want to get.
$orders = $client->getOrders($start, $end, $status);

获取由特定用户创建的所有订单。

$orders = $client->getUsersOrders($userId);

更新订单的评论。

* @param $order Order to update.
$status = $client->updateOrderComment($order, $comment);

更新订单的状态。

* @param $order Order to update.
$status = $client->updateOrderStatus($order, $status);

从订单创建发票。

* @param $order Order
* @param int $maturity_interval The amount of days from today's date to set the maturity date for the Invoice (0, 8, 14 or 30 days).
$status = $client->createInvoice($order, $maturity_interval);

获取与产品ID相关联的所有图片。

$images = $client->getProductImages($productId, $shopId);

获取特定订单的所有订单行。

$orderLines = $client->getOrderLines($orderId);

获取特定订单的所有订单行。

$orderLines = $client->getOrderLines($orderId);

更新订单行状态

* @param OrderLine $order_line Orderline to update. Must have Id property.
$status = $client->updateOrderLineStatus($orderline, $status);

检索客户

$order = $client->getCustomer($orderId);