Files
MiraviaConnector/connector-miravia/classes/Services/Aliexpress/OpenApi/Merchant.php
Miravia Connector Bot 752600f337 Fix image upload structure for Miravia API compliance
🔧 Bug Fixes:
- Fixed product image structure to match Miravia API requirements
- Updated MiraviaProduct.php getData() method to wrap images in {"Image": [...]} format
- Updated MiraviaCombination.php getData() method to wrap SKU images properly
- Resolved error "[4224] The Main image of the product is required"

📋 Changes:
- Modified getData() methods to transform flat image arrays to nested structure
- Product images: images[] → Images: {"Image": [...]}
- SKU images: images[] → Images: {"Image": [...]}
- Maintains backward compatibility for empty image arrays

🎯 Impact:
- Product uploads will now pass Miravia's image validation
- Both product-level and SKU-level images properly formatted
- Complies with official Miravia API documentation structure

🤖 Generated with Claude Code (https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-21 11:34:59 +02:00

56 lines
2.0 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
/**
* Created by PhpStorm.
* User: Sweeper
* Time: 2023/4/4 15:52
*/
namespace Sweeper\PlatformMiddleware\Services\Aliexpress\OpenApi;
use Sweeper\PlatformMiddleware\Services\Aliexpress\Base;
/**
* OpenAPI AE-商家相关接口
* Created by Sweeper PhpStorm.
* Author: Sweeper <wili.lixiang@gmail.com>
* DateTime: 2024/3/19 15:20
* @Package \Sweeper\PlatformMiddleware\Services\Aliexpress\OpenApi\Merchant
*/
class Merchant extends Base
{
/**
* 商家地址列表查询
* User: Sweeper
* Time: 2023/4/4 17:16
* channel_seller_id Number 请输入全托管店铺的id。 渠道seller id 可以在这个API中查询global.seller.relation.query 请使用 business_type = ONE_STOP_SERVICE 的全托管店铺 channel_seller_id
* address_types String[] 地址类型SALESRETURN退货地址WAREHOUSE发货地址
* @doc https://open.aliexpress.com/doc/api.htm#/api?cid=20895&path=aliexpress.merchant.Address.list&methodType=GET/POST
* @param array $accountInfo
* @param array $params
* @return mixed
*/
public function merchantAddressList(array $accountInfo, array $params = [])
{
$response = static::executeRequest($accountInfo, 'aliexpress.merchant.Address.list', $params, 'param', ['channel_seller_id', 'address_types']);
return $response->aliexpress_merchant_Address_list_response->result ?? $response->result ?? $response;
}
/**
* 查询卖家资料,如刊登数量
* api: https://open.aliexpress.com/doc/api.htm#/api?cid=20895&path=aliexpress.merchant.profile.get&methodType=GET/POST
* Author: Sweeper <wili.lixiang@gmail.com>
* DateTime: 2024/3/19 16:27
* @param array $accountInfo
* @return mixed
*/
public function getMerchantProfile(array $accountInfo)
{
$rs = static::executeRequest($accountInfo, 'aliexpress.merchant.profile.get');
return $rs->aliexpress_merchant_profile_get_response->profile ?? $rs->profile ?? $rs;
}
}