$client = new http\Client;
$request = new http\Client\Request;
$request->setRequestUrl('https://api.monpay.mn/resource/partner/v1/sell');
$request->setRequestMethod('POST');
$body = new http\Message\Body;
$body->append('<request>
<customer system="ISDN">99XXXXXX</customer>
<amount>2</amount>
<description>Description of your choice</description>
<smsPrefix>First sentence of the message to be delivered to customer after successful transaction</smsPrefix>
<smsPrefix>Last sentence of the message to be delivered to customer after successful transaction</smsPrefix>
<product>product name</product>
<productType>food etc</productType>
</request>');
$request->setBody($body);
$request->setOptions(array());
$request->setHeaders(array(
'Content-Type' => 'application/xml',
'Authorization' => 'Bearer {Your token}'
));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
OkHttpClient client = new OkHttpClient().newBuilder().build();
MediaType mediaType = MediaType.parse("application/xml");
RequestBody body = RequestBody.create(mediaType, "<request>
<customer system="ISDN">99XXXXXX</customer>
<amount>2</amount>
<description>Description of your choice</description>
<smsPrefix>First sentence of the message to be delivered to customer after successful transaction</smsPrefix>
<smsPrefix>Last sentence of the message to be delivered to customer after successful transaction</smsPrefix>
<product>product name</product>
<productType>Gaming</productType>
</request>");
Request request = new Request.Builder()
.url("https://api.monpay.mn/resource/partner/v1/sell")
.method("POST", body)
.addHeader("Content-Type", "application/xml")
.addHeader("Authorization", "Bearer {your token}")
.build();
Response response = client.newCall(request).execute();