$apiUrl = "https://api.shiptor.ru/public/v1";
$apiKey = "YOUR_KEY";
$client = new \JsonRPC\Client($apiUrl);
// Set headers
$client->getHttpClient()->withBeforeRequestCallback(function(HttpClient $client, $payload) {
$client->withHeaders([
"Content-Type: application/json",
"x-authorization-token: {$apiKey}"
]);
});
// Fetch something
$method = "calculateShipping";
$params = ['paramName'=>"paramValue"];
$result = $client->execute($method, $params);