<?xml version="1.0" encoding="utf-8"?>
<Request>
<Authentication>
<Login>mybill</Login>
<TransactionID>1</TransactionID>
<MethodName>UserRegistration</MethodName>
<Hash>f5bb0c8de146c67b88babbf4e6584cc0</Hash>
</Authentication>
<Parameters>
…
Здесь будет перечень параметров, необходимых методу.
…
</Parameters>
</Request>
<?xml version="1.0" encoding="utf-8"?>
<Return>
<Error>
<ErrorCode>ClientEMail_NotUnique</ErrorCode>
<ErrorMessage></ErrorMessage>
</Error>
<Status>1</Status>
</Return>
<?xml version="1.0" encoding="utf-8"?>
<Request>
<Authentication>
<Login>mybill</Login>
<TransactionID>3</TransactionID>
<MethodName>Account</MethodName>
<Hash>f5bb0c8de146c67b88babbf4e6584cc0</Hash>
</Authentication>
</Request>
<?xml version="1.0" encoding="utf-8"?>
<Return>
<Status>2</Status>
<Error/>
<Account>100000.00</Account>
</Return>
<?xml version="1.0" encoding="utf-8"?>
<Request>
<Authentication>
<Login>mybill</Login>
<TransactionID>3</TransactionID>
<MethodName>GetOrderStatus</MethodName>
<Hash>f5bb0c8de146c67b88babbf4e6584cc0</Hash>
</Authentication>
<Parameters>
<BasketID>100</BasketID>
</Parameters>
</Request>
<?xml version="1.0" encoding="utf-8"?>
<Return>
<Status>2</Status>
<Error/>
<OrderStatus>
<ID>4</ID>
<Status>Доставляется</Status>
<Changed>2020-11-12 22:23:24</Changed>
</OrderStatus>
</Return>
<?xml version="1.0" encoding="utf-8"?>
<Request>
<Authentication>
<Login>mybill</Login>
<TransactionID>3</TransactionID>
<MethodName>GetCategories</MethodName>
<Hash>f5bb0c8de146c67b88babbf4e6584cc0</Hash>
</Authentication>
</Request>
<?xml version="1.0" encoding="utf-8"?>
<Return>
<Status>2</Status>
<Error/>
<Categories>
<Category id="1">
<name>Телевизоры</name>
<Params>
<Param id="1">
<name>Диагональ экрана</name>
<value id="1" unit="дюйм">27</value>
<value id="2" unit="дюйм">32</value>
<value id="3" unit="дюйм">54</value>
</Param>
</Params>
</Category>
<Category id="2">
<name>Дверная фурнитура</name>
<Params>
<Param id="2">
<name>Цвет</name>
<value id="5">Белый</value>
<value id="7">Бронза</value>
<value id="8">Черный</value>
<value id="8">Серебристый</value>
</Param>
<Param id="3">
<name>Страна</name>
<value id="21">Россия</value>
<value id="22">Италия</value>
</Param>
</Params>
</Category>
</Categories>
</Return>
<?xml version="1.0" encoding="utf-8"?>
<Request>
<Authentication>
<Login>mybill</Login>
<TransactionID>3</TransactionID>
<MethodName>GetProduct</MethodName>
<Hash>f5bb0c8de146c67b88babbf4e6584cc0</Hash>
</Authentication>
<Parameters>
<Products>
<Product>136311798</Product>
<Product>27665879</Product>
</Products>
</Parameters>
</Request>
<?xml version="1.0" encoding="utf-8"?>
<Request>
<Authentication>
<Login>mybill</Login>
<TransactionID>3</TransactionID>
<MethodName>GetProduct</MethodName>
<Hash>2cfc084ba11ac55371a9a24cc34121e7</Hash>
</Authentication>
<Parameters>
<Limit offset="0" row_count="500"/>
<Categories>
<Category>83</Category>
<Category>87</Category>
</Categories>
<Params>
<Param>5305</Param>
<Param>1807</Param>
</Params>
</Parameters>
</Request>
<?xml version="1.0" encoding="utf-8"?>
<Return>
<Error>
<ErrorCode>NotFoundProducts</ErrorCode>
<ErrorMessage>Продуктов соответствующих запросу не найдено</ErrorMessage>
</Error>
<Status>1</Status>
</Return>
<?xml version="1.0" encoding="utf-8"?>
<Request>
<Authentication>
<Login>mybill</Login>
<TransactionID>3</TransactionID>
<MethodName>GetDeliveryVariants</MethodName>
<Hash>f5bb0c8de146c67b88babbf4e6584cc0</Hash>
</Authentication>
<Parameters>
<BasketID>356</BasketID>
<DeliveryAddress>
</DeliveryAddress>
<Products>
<Product>
<Id>1</Id>
<Quantity>1</Quantity>
</Product>
<Product>
<Id>2</Id>
<Quantity>5</Quantity>
</Product>
</Products>
</Parameters>
</Request>
<?xml version="1.0" encoding="utf-8"?>
<Return>
<Status>2</Status>
<Error/>
<BasketID>333</BasketID>
<Deliverys>
<Logistician>
<Id>4</Id>
<DeliveryVariants>
<DeliveryVariant>
<Id>1</Id>
<Name>Загрузка онлайн или получение в SMS</Name>
<Type>Электронным способом</Type>
<Price>0</Price>
<EstimatedDeliveryTime>1</EstimatedDeliveryTime>
</DeliveryVariant>
</DeliveryVariants>
<Products>
<ProductId>1</ProductID>
<ProductId>2</ProductID>
</Products>
</Logistician>
</Deliverys>
</Return>
<?xml version="1.0" encoding="utf-8"?>
<Request>
<Authentication>
<Login>mybill</Login>
<TransactionID>1547203965</TransactionID>
<MethodName>MakeOrder</MethodName>
<Hash>f5bb0c8de146c67b88babbf4e6584cc0</Hash>
</Authentication>
<Parameters>
<BasketID>123</BasketID>
<OrderID>100</OrderID>
<DeliveryAddress>
<Street>ул. Красивая</Street>
<Building1>1</Building1>
<Room>10</Room>
</DeliveryAddress>
<User>
<FirstName>Иван</FirstName>
<MiddleName>Иванович</MiddleName>
<LastName>Иванов</LastName>
<Email>ivanov@email.ru</Email>
<Phone>+79091231234</Phone>
</User>
<Products>
<Product>
<Id>69713</Id>
<DeliveryID>1</DeliveryID>
</Product>
<Product>
<Id>55711</Id>
<DeliveryID>3</DeliveryID>
</Product>
</Products>
</Parameters>
</Request>
<?xml version="1.0" encoding="utf-8"?>
<Return>
<Status>2</Status>
<Error/>
</Return>
<?xml version="1.0" encoding="utf-8"?>
<Request>
<Authentication>
<Login>mybill</Login>
<TransactionID>1547203965</TransactionID>
<MethodName>ConfirmOrder</MethodName>
<Hash>162e20c14cae620c27fee4c63afaa927</Hash>
</Authentication>
<Parameters>
<BasketID>333</BasketID>
</Parameters>
</Request>
<?xml version="1.0" encoding="utf-8"?>
<Return>
<Status>2</Status>
<Error/>
</Return>
<?php
$transationID = time();
$login = 'Login';
$password = 'Password';
$method = 'MakeOrder';
$url = 'http://mybill.your_utl.ru/…/' . $method;
$hash = md5($transationID . $method . $login . $password);
$request = <<<XML
<?xml version="1.0" encoding="utf-8"?>
<Request>
<Authentication>
<Login>{$login}</Login>
<TransactionID>{$transationID}</TransactionID>
<MethodName>{$method}</MethodName>
<Hash>{$hash}</Hash>
</Authentication>
<Parameters>
<OrderID>363</OrderID>
<User>
<FirstName>Иванов</FirstName>
<MiddleName>Иван</MiddleName>
<LastName>Иванович</LastName>
<Email>ivanov@email.ru</Email>
<Phone>+79091231234</Phone>
</User>
<DeliveryAddress>
<ZipCode>249034</ZipCode>
<Region>Калужская область</Region>
<City>Калуга</City>
<Address>ул. Красивая, д. 1, кв. 1</Address>
</DeliveryAddress>
<Products>
<Product>
<Id>1</Id>
<DeliveryID>1</DeliveryID>
<Quantity>2</Quantity>
</Product>
<Product>
<Id>2</Id>
<DeliveryID>1</DeliveryID>
<Quantity>1</Quantity>
</Product>
</Products>
</Parameters>
</Request>
XML;
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_HTTPHEADER, array(
'Content-Type: text/xml; charset=utf-8',
'Content-Length: ' . strlen($request))
);
curl_setopt($curl, CURLOPT_POSTFIELDS, $request);
$response = curl_exec($curl);
curl_close($curl);