I'm trying to do one simple thing. I want to change the quantity of an existing fixed priced item on ebay using PHP. Is this possible? I've asked this before and got responses telling me to read this or that. I'm not able to find any actual code examples though. I'd love to see someone post one. For example, ebay item number 123456789 has a qty of 50. I want to run some PHP code to change it to qty of 20. I want to enter the item number, the new quantity, and any ebay verification data needed into the code and run it. That's all I need.
eBay Shopping API lets you ask eBay for information using just a URL, then get back data in XML, JSON, SOAP, or eBay's simple Name Value format. This Getting Started Guide focuses on the simplest way to use the Shopping API: using a URL as input, and getting XML back. However, you can also use SOAP and JSON.
eBay offers developers a wide range of RESTful and Traditional APIs. For new development, eBay strongly encourages the use of our RESTful APIs.
Inventory Item: before a product can be sold in an offer on an eBay marketplace, an inventory item record must exist for that product. An inventory item record contains such things as product details, item condition, quantity available.
Try this it works for me
$feed = <<< EOD
<?xml version="1.0" encoding="utf-8"?>
<ReviseItemRequest xmlns="urn:ebay:apis:eBLBaseComponents">
<RequesterCredentials>
<eBayAuthToken>$eBay->auth_token</eBayAuthToken>
</RequesterCredentials>
<Item ComplexType="ItemType">
<ItemID>$itemid</ItemID>
<Quantity> int </Quantity>
</Item>
<MessageID>1</MessageID>
<WarningLevel>High</WarningLevel>
<Version>$eBay->api_version</Version>
</ReviseItemRequest>
EOD;
$feed = trim($feed);
$site_id = 3;//3 For UK
$headers = array
(
'X-EBAY-API-COMPATIBILITY-LEVEL: ' . $this->api_version,
'X-EBAY-API-DEV-NAME: ' . $this->dev_id,
'X-EBAY-API-APP-NAME: ' . $this->app_id,
'X-EBAY-API-CERT-NAME: ' . $this->cert_id,
'X-EBAY-API-CALL-NAME: ' . $call_name,
'X-EBAY-API-SITEID: ' . $site_id,
);
// Send request to eBay and load response in $response
$connection = curl_init();
curl_setopt($connection, CURLOPT_URL, $this->api_endpoint);
curl_setopt($connection, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($connection, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($connection, CURLOPT_HTTPHEADER, $headers);
curl_setopt($connection, CURLOPT_POST, 1);
curl_setopt($connection, CURLOPT_POSTFIELDS, $feed);
curl_setopt($connection, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($connection);
curl_close($connection);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With