hocza / shoprenter-api
PHP client for ShopRenter API
Installs: 25
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 1
pkg:composer/hocza/shoprenter-api
Requires
- php: >=5.6
- ext-curl: *
- ext-json: *
This package is not auto-updated.
Last update: 2025-09-28 02:22:39 UTC
README
Usage
<?php require_once 'vendor/autoload.php'; use ShopRenter\ApiCall; $settings = [ 'username' => '[USERNAME]', 'api_key' => '[APIKEY]', 'url' => '[SHOPNAME].api.shoprenter.hu', ]; $apiCall = new ApiCall($settings['username'], $settings['api_key']); $apiCall->setFormat('json'); try { $response = $apiCall->execute('GET', $settings['url'] . '/products'); echo '<pre>'; print_r($response->getParsedResponseBody()); echo '</pre>'; } catch (Exception $exception) { echo 'Something bad happened...'; }
POST request:
$apiCall->execute('POST', $url, ['sku' => 'something', 'price' => 1000]);
DELETE request:
$apiCall->execute('DELETE', $url);
Available HTTP methods
- GET
- POST
- PUT
- DELETE