davidtsadler / ebay-sdk-examples

Several examples of using the eBay SDK for PHP
http://devbay.net
Apache License 2.0
184 stars 100 forks source link

request for SetShipmentTrackingInfo example #5

Closed cornernote closed 9 years ago

cornernote commented 9 years ago

Would you please be able to provide an example of this call: http://developer.ebay.com/devzone/merchant-data/CallRef/SetShipmentTrackingInfo.html

I cannot find a SetShipmentTrackingInfoRequestType class.

davidtsadler commented 9 years ago

I started working on the Merchant Data API yesterday so I will look at adding this example once I have finished.

cornernote commented 9 years ago

Hey @davidtsadler,

Just wondering if you can update the post once the code is finished. If there is a SetShipmentTrackingInfoRequestType class then I can probably figure the rest out as your API is quite easy to use once you know the basics.

davidtsadler commented 9 years ago

The Merchant Data SDK is still a work in progress but you can see what has been done on the develop branch of its repository. You can find the SetShipmentTrackingInfoRequestType classes in this SDK.

The project is not quite finished but it's nearly there. I'll update this post once it's done.

coresmart commented 9 years ago

Hi @davidtsadler,

I just wanted to follow up on this post. First off great job with the SDK integration.

Have you had a chance to complete the SetShipmentTracking functionality and if so do you have an example?

Thanks!

davidtsadler commented 9 years ago

At the moment the merchant data SDK is scheduled for an April release. If you give me a few days though I may be able to create an alpha-release as a Phar or Zip that you may be able to use until the official release.

coresmart commented 9 years ago

David,

No worries. I just looked more and realized I needed the trading complete sale/shipment tracking functionality instead.

Great work.

Thanks!

Paul

Sent from my iPhone

On Feb 21, 2015, at 12:23 PM, David Terence Sadler notifications@github.com wrote:

At the moment the merchant data SDK is scheduled for an April release. If you give me a few days though I may be able to create an alpha-release as a Phar or Zip that you may be able to use until the official release.

— Reply to this email directly or view it on GitHub.

cornernote commented 9 years ago

Hi David,

Would you be able to make a pre-release as a branch? That way I can pull it with composer.

I'd be happy to use whatever you have for the moment, even if not fully ready. I'm only running this in development at the moment so can't break anything.

davidtsadler commented 9 years ago

There should have been a release at the start of April but I've been busy with a few other things. I'll can look at getting a release done for next week.

coresmart commented 9 years ago

Derek

I'm all set... Sorry thought I emailed you before. Ended using trading complete sale.

Thanks!

Paul

Sent from my iPhone

On Apr 27, 2015, at 2:24 PM, David Terence Sadler notifications@github.com wrote:

There should have been a release at the start of April but I've been busy with a few other things. I'll can look at getting a release done for next week.

— Reply to this email directly or view it on GitHub.

davidtsadler commented 9 years ago

No problem. I still plan to release this SDK as it's been on my TODO list for a while :)

coresmart commented 9 years ago

Ok great... Good luck!

Sent from my iPhone

On Apr 27, 2015, at 2:29 PM, David Terence Sadler notifications@github.com wrote:

No problem. I still plan to release this SDK as it's been on my TODO list for a while :)

— Reply to this email directly or view it on GitHub.

cornernote commented 9 years ago

There should have been a release at the start of April but I've been busy with a few other things. I'll can look at getting a release done for next week.

Awesome, thanks!

cornernote commented 9 years ago

Hey @davidtsadler,

Are you able to put the changes into a branch that I can play with before the release is done?

cornernote commented 9 years ago

Hi David,

Thanks for the example. I would prefer to use it without sending it as a batch. Is that possible?

Eg:

        $request = new MerchantData\Types\SetShipmentTrackingInfoRequestType();
        $request->OrderID = '123457890';
        $request->IsPaid = true;
        $request->IsShipped = true;
        $request->Shipment = new MerchantData\Types\ShipmentType();
        $request->Shipment->ShipmentLineItem = new MerchantData\Types\ShipmentLineItemType();
        $request->Shipment->ShipmentLineItem->LineItem[] = new MerchantData\Types\LineItemType(array(
            'ItemID' => '123457890',
            'Quantity' => 1
        ));
        $response = $ebayUserManager->merchantDataService->setShipmentTrackingInfo($request);

When I try, it throws this:

xml_parse() expects parameter 2 to be string, object given in /vendor/dts/ebay-sdk/src/DTS/eBaySDK/Parser/XmlParser.php(67)
davidtsadler commented 9 years ago

I would prefer to use it without sending it as a batch.

I'm not sure what you mean by that. Can you elaborate? With regards to the error,

xml_parse() expects parameter 2 to be string, object given in /vendor/dts/ebay-sdk/src/DTS/eBaySDK/Parser/XmlParser.php(67)

I think it is been caused by this line

response = $ebayUserManager->merchantDataService->setShipmentTrackingInfo($request);

The method setShipmentTrackingInfo does not send the request to eBay. The LMS is different to other API's provided by eBay. There is no Merchant Data Service, unlike say the Trading service. Operations done via the LMS are performed by uploading a file to eBay and then waiting for them to process it. Since this processing can take some time the LMS provides a way for users to poll it to determine when it is completed. At this point you have to download another file to get the actual response. This response is provided as a zip archive that contains a single XML file. The Merchant Data SDK is designed to take this XML response and parse it into useful PHP objects. This is done by the setShipmentTrackingInfo method.

cornernote commented 9 years ago

Hi David,

What I mean is can I setShipmentTrackingInfo and send the request to eBay without sending a file and waiting for eBay to process it? Can I call it the same way as I call getOrders, where I give some data, and it gives a response?

davidtsadler commented 9 years ago

I'm afraid not. SetShipmentTrackingInfo only exists in the LMS and that API works by uploading files. The reason for this is that LMS is designed for sellers with many thousands of inventory items and processing the data can take anything from several minutes to a few hours. For example LMS can be used to launch items to eBay. It would be unreasonable to upload a AddItem request for 10,000 items and expect an instant response that contained the success or failure of every item in the request.

davidtsadler commented 9 years ago

According to the docs for SetShipmentTackingInfo you may be able to use CompleteSale from the Trading API instead. This would depend on what you project requires though.

robyerevan commented 9 years ago

hi David

Were you able to update tracking number using LMS SetShipmentTackingInfo ? In my case ebay returns success response and marks item as shipped however tracking number is missing. here is response sample

Uploading set shipment tracking info requests...Done Request processing of set shipment tracking info...Done Status is Scheduled Status is Scheduled Status is InProcess Status is InProcess Status is InProcess Status is InProcess Status is InProcess Status is InProcess Status is InProcess Status is InProcess Status is InProcess Status is InProcess Status is InProcess Status is Completed Downloading set shipment tracking info responses...Done Unzipping /tmp/attachmenteURPIt.zip...Done OrderLineItemID xxxxxxxxxxxx-yyyyyyyyyyyyy

waza123x commented 8 years ago

same shit, tracking number not added on ebay

davidtsadler commented 8 years ago

The LMS Set Shipment Tracking Info was recently updated to match the documentation correction announced by eBay , so hopefully the tracking number can now be set.

amirvenus commented 5 years ago

I am trying to reuse a job id but I am getting this error:

Error: The file has already been uploaded

Please advise