zVPS / ebay-sell-fulfillment-php-client

0 stars 0 forks source link

getOrders() not getting full details on line_items title with option/variation in orders #1

Closed sunil11475-dev closed 10 months ago

sunil11475-dev commented 2 years ago

I am trying for week and its same result -

getOrders() not getting full details on line_items - title with option/variation in orders -

[line_items] => Array
(
             ...
                     ....
                               ....
                        [lineItemId] => 10045923432614
                        [legacyItemId] => 283434697525
                        [legacyVariationId] => 584524434289
                        [sku] => BPSKU_Let_1
                        **[title]**=> Vintage Industrial Retro Style Metal Hanging Lamp
             ...
)

doesn't get which color/size option customer selected in order.

It should be [title] => Vintage Industrial Retro Style Metal Hanging Lamp [Black, 12R]

I tried you Feed order_task code as well and its getting full details but only i can only fetch unshipped orders, I want to fetch both shipped and unshipped orders.

Please help.

Caffe1neAdd1ct commented 2 years ago

@sunil11475-dev might be worth trying to dump out the response or check the returned raw JSON before it's decoded and populated into objects.

I haven't got an environment I can test with at the moment.

I'd also advise if this isn't available to check variation orders against the getOrder() to see if that returns more details.

Thanks for reporting, happy to try and help diagnose, but I might need to setup a proper sandbox account before we can get to the bottom of this..

sunil11475-dev commented 2 years ago

Thanks for your reply. I have check and checked in eBay developer tools as well now and it doesn't fetching the title with option/variation there also.

That mean this API is not complete yet, this is main thing in order without that how you going to process the the orders.

Thanks for your time.

Caffe1neAdd1ct commented 2 years ago

I had a similar issue at my previous company with missing dispatch by and deliver by dates missing, your best bet is for variation listings (only) to call the legacy Trading API.

Watch out as the legacy API has a smaller daily call limit, something like 5000.

Once this comes over to the Fulfilment API you can change over and remove the extra call for variation listings ...

sunil11475-dev commented 2 years ago

For 10 years, i am running everything on trading API. Last week i checked new API release notes and they increase fulfillment API Getorder maximum limit value to 200 and sell API call limit also very good That the reason i was thinking to move my application on new API.

But, No everything is easy in life.

Thanks again!

Caffe1neAdd1ct commented 2 years ago

No worries. Reach out if you get stuck and I'll try to help where possible.

Exactly the reason I tried to convert our WH management system over to Fulfilment API and hit issues with missing data and mixed IDs etc.

Variation listings were definitely an issue I came up against ..

Caffe1neAdd1ct commented 2 years ago

If you need support for newer Guzzle / PHP versions on the legacy APIs have a look at the zVPS ebay-legacy-api-client repo, based off David's original work and updated recently (ish)

sunil11475-dev commented 2 years ago

I will try Trading API and if i find any solution i will post here.

zVPS ebay-legacy-api-client That was my plan

But if any one planning to move to this new API ( Journey started in 2018 ) then they will know and may be eBay will pay attention on this details. In my 60 I will be implementing new API :)

Caffe1neAdd1ct commented 2 years ago

If you spot anything falling behind or need a regeneration of the API clients just get in touch :)

sunil11475-dev commented 2 years ago

If you need support for newer Guzzle / PHP versions on the legacy APIs have a look at the zVPS ebay-legacy-api-client repo, based off David's original work and updated recently (ish)

I am using all David's work in my project but now its all repository showing "This repository has been archived by the owner. It is now read-only."

Which makes me worried. recently I had battle with Amazon because they change their MWS API (Which they planning to terminate this year) to SP so finally i manage to finish that last month. It was years of nightmare.

Caffe1neAdd1ct commented 2 years ago

Totally get where you're at and what you've gone through!

I made David's generator work again with eBay changed URLs and some tweaks, then ran all the new REST open API spec files through the open API gen for PHP, then ran the results through rectorphp to make backwards compatible for PHP 5.6 (don't ask)

I've been meaning to do the buy API clients just haven't had time recently .. schedule is freeing up a bit more recently so I'll take a look at them soon.

My long term plan would be to put this all into a CI job which checks the change logs and regenerates as needed, but that'll take a bit of setting up ....

sunil11475-dev commented 2 years ago

That's perfect.

Someone already done the Buy API UAPL repository , but no idea if its works because you may have different type of permission to use Buy API.

all into a CI job - That will be perfect, No need to download separate repository. Look forward to see that work.

sunil11475-dev commented 2 years ago

@Caffe1neAdd1ct Can you please move me at right direction? How can i get only/specific variation of listing using below id/SKU

                    [lineItemId] => 10045923432614
                    [legacyItemId] => 283434697525
                    [legacyVariationId] => 584524434289
                    [sku] => BPSKU_Let_1

Or which API i have to use to get only the variation assign to xyz order. I used Browse API and none of call bringing listing variation.

Caffe1neAdd1ct commented 2 years ago

@sunil11475-dev I would imagine the Browse API will need both the legacyItemId and the legacyVariationId

https://github.com/zVPS/ebay-legacy-php-client/blob/master/src/Browse/Services/BrowseService.php

'GetItemByLegacyId' => [
            'method' => 'GET',
            'resource' => 'item/get_item_by_legacy_id',
            'responseClass' => '\DTS\eBaySDK\Browse\Types\GetItemByLegacyIdRestResponse',
            'params' => [
                'legacy_item_id' => [
                    'valid' => ['string'],
                    'required' => true
                ],
                'legacy_variation_id' => [
                    'valid' => ['string']
                ],
                'legacy_variation_sku' => [
                    'valid' => ['string']
                ]
            ]
        ],

Looks like this might return something useful..

Also try specifying the fieldGroups to PRODUCT to see extra fields returned, might be something in those.

sunil11475-dev commented 2 years ago

Thanks, I am trying install zvps/ebay-sell-php-client getting this error -

Using version dev-main for zvps/ebay-sell-php-client
Root package 'zvps/ebay-sell-php-client' cannot require itself in its composer.json
and

Combines all zvps/ebay-sell-*-php-client packages into one easy to install library.

 [InvalidArgumentException]
  Could not find package zVPS/ebay-sell-*-php-client.

  Did you mean one of these?
      zvps/ebay-sell-php-client
      zvps/ebay-sell-feed-php-client
      zvps/ebay-sell-listing-php-client
      zvps/ebay-sell-account-php-client
      zvps/ebay-sell-metadata-php-client
Caffe1neAdd1ct commented 2 years ago

For now if you add the following line to your composer.json:

"minimum-stability": "dev"

Then run:

php composer require zvps/ebay-sell-php-client @dev

This will install all the sell API client packages, i'll look at bumping them to a stable 1.0 release soon.

sunil11475-dev commented 2 years ago

@Caffe1neAdd1ct Thanks, I have install yours zVPS/ebay-legacy-php-client.

I am trying to call for GetItemByLegacyId but getting below error, I tried with David's SDK as well and same error -

Fatal error: Uncaught TypeError: Argument 2 passed to DTS\eBaySDK\Parser\JsonParser::assignProperties() must be of the type array, string given, called in libraries/ebaylegacy/vendor/zvps/ebay-legacy-php-client/src/Parser/JsonParser.php on line 99 and defined in libraries/ebaylegacy/vendor/zvps/ebay-legacy-php-client/src/Parser/JsonParser.php:16 Stack trace: #0 libraries/ebaylegacy/vendor/zvps/ebay-legacy-php-client/src/Parser/JsonParser.php(99): DTS\eBaySDK\Parser\JsonParser::assignProperties(Object(DTS\eBaySDK\Browse\Types\TaxType), 'VAT') #1 libraries/ebaylegacy/vendor/zvps/ebay-legacy-php-client/src/Parser/JsonParser.php(65): DTS\eBaySDK\Parser\JsonParser::actualValue(Object(stdClass), 'VAT') #2 libraries/ebaylegacy/vendor/zvps/ebay-legacy-php-client/src/Parser/JsonParser.php(26): DTS\eBaySDK\Parser\JsonParser::determineActual in libraries/ebaylegacy/vendor/zvps/ebay-legacy-php-client/src/Parser/JsonParser.php on line 16

This is my code -

    $service = new Services\BrowseService([
        'authorization' => $accesstoken,
        'marketplaceId' => 'EBAY-US'
    ]);
    $request = new Types\GetItemByLegacyIdRestRequest();
    $request->legacy_item_id = '2834XXX97525';
    //$request->legacy_variation_id = '584XXX4289';
    $request->legacy_variation_sku = 'BXXC6_Le_1';
    $response = $service->GetItemByLegacyId($request);
sunil11475-dev commented 2 years ago

Resolved - I have removed Array from private static function

vendor/zvps/ebay-legacy-php-client/src/Parser/JsonParser.php

16    private static function assignProperties(\DTS\eBaySDK\Types\BaseType $object, array $properties)
    {

to

16    private static function assignProperties(\DTS\eBaySDK\Types\BaseType $object, $properties)
    {

library doesn't support fieldgroups field, may be library need updating. also everything comes in same array which hard to work with so this is also not good idea for getting variation option for orders.

Caffe1neAdd1ct commented 2 years ago

Are you able to post a sample response with any sensitive data redacted?

I'll have a look at applying this as a patch and see if an update of the SDK resolves the missing fieldgroups field as soon as i can.

sunil11475-dev commented 2 years ago

@Caffe1neAdd1ct I get below response when i am using fieldgroups

Fatal error: Uncaught DTS\eBaySDK\Exceptions\UnknownPropertyException: Unknown property fieldgroups in application/libraries/ebaylegacy/vendor/zvps/ebay-legacy-php-client/src/Types/BaseType.php:464 Stack trace: #0 application/libraries/ebaylegacy/vendor/zvps/ebay-legacy-php-client/src/Types/BaseType.php(309): DTS\eBaySDK\Types\BaseType::ensurePropertyExists('DTS\\eBaySDK\\Bro...', 'fieldgroups') #1 application/libraries/ebaylegacy/vendor/zvps/ebay-legacy-php-client/src/Types/BaseType.php(87): DTS\eBaySDK\Types\BaseType->set('DTS\\eBaySDK\\Bro...', 'fieldgroups', 'additionalProdu...') #2 application/models/ebay/ebayrest.php(51): DTS\eBaySDK\Types\BaseType->__set('fieldgroups', 'additionalProdu...') #3 application/controllers/ebayfeed.php(122): in application/libraries/ebaylegacy/vendor/zvps/ebay-legacy-php-client/src/Types/BaseType.php on line 464

https://developer.ebay.com/api-docs/buy/browse/resources/item/methods/getItemByLegacyId