Closed nsoft-dev closed 2 years ago
Hello,
I think you have forgotten a level in your data array. Please try this code instead:
$request = new UpdateOffersRequest(array($data));
No this doesnt work. Result is Bad Request.
Here is the Code. I think, this is ok, because i get the response with "import_id".
The $Offer is the original Response from API with these values.
Ok the data seems valid indeed. Then, you should use the APIs OF02, OF03 and OF04 with the import id to see if something went wrong with your import.
Ok i have try this and i get this message with the OF02 Endpoint.
Is there any call maybe to accept this import?
I see that the status is WAITING. Is is still the case if you execute the OF02 call again?
Oh really, when i do the requests again, i get this result.
But now, where is the error? Oke, now i got the error-csv-file.
This returns: The product-id field is mandatory when product-id-type is filled
It works :)
Thanky you @jreinke I forgott the EAN Number to enter as product_id.
Great! Thanks for your feedback.
Hello,
when im using the UpdateOffersRequest, the quantity is not set in the shop, price too. The result is always with the import_id, so i think the json-data is correct.
is there any solution?
This is my current code:
$url = "{$this->baseurl}/offers"; $header = array( "Authorization: {$this->apikey}", "Content-Type: application/json" ); $data = array( "update_delete" => "update", "state_code" => $Offer->state_code, "shop_sku" => $Offer->shop_sku, "quantity" => strval($Stock), "price" => $Offer->price, "product_id_type" => "EAN", "product_sku" => $Offer->product_sku ); $data = array( 'offers' => array( $data ) ); $api = new ShopApiClient($this->baseurl, $this->apikey); $request = new UpdateOffersRequest($data); $result = $api->updateOffers($request);