Payment
Lists the payment types the hotel accepts for online bookings and starts the payment step for the selected type. What to do for each type is described in the Payment flow guide.
/external/online/payment/typeList payment typesGET/external/payment/companyVirtual POS detailsPOST/external/online/payment/type/{paymentType}Start the payment stepList payment types#
/external/online/payment/typeAuthentication: Authorization: Bearer
Returns the payment types the hotel enabled for online sales. Fixed type IDs: 1 pay at hotel, 3 bank transfer, 9 credit card (card details sent with the booking), 10 online payment (virtual POS).
Query parameters
hotelIDintegerrequiredResponse
200 Success.
curl "https://test.hms.gen.tr/external/online/payment/type?hotelID=1000" \
-H "Authorization: Bearer $HMS_TOKEN"const res = await fetch("https://test.hms.gen.tr/external/online/payment/type?hotelID=1000", {
headers: {
"Authorization": `Bearer ${process.env.HMS_TOKEN}`
}
});
const data = await res.json();$ch = curl_init('https://test.hms.gen.tr/external/online/payment/type?hotelID=1000');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('HMS_TOKEN'),
],
]);
$data = json_decode(curl_exec($ch), true);{
"success": true,
"count": 3,
"items": [
{
"title": "Pay at Hotel",
"title_translate": "odeme.otelde_odeme",
"typeID": 1
},
{
"title": "Bank Transfer",
"title_translate": "odeme.havale",
"typeID": 3
},
{
"title": "Online Card Payment",
"title_translate": "odeme.online_odeme",
"typeID": 10
}
]
}Virtual POS details#
/external/payment/companyAuthentication: Authorization: Bearer
Returns the hotel’s virtual POS provider and merchant details. Only needed if you integrate the provider directly on your side; the standard flow uses POST …/payment/type/10. The response contains secrets; keep it server-side.
Query parameters
hotelIDintegerrequiredResponse
200 Success.
Error responses
- 200
hotel_company_info_could_not_found— no virtual POS configured for the hotel.
curl "https://test.hms.gen.tr/external/payment/company?hotelID=1000" \
-H "Authorization: Bearer $HMS_TOKEN"const res = await fetch("https://test.hms.gen.tr/external/payment/company?hotelID=1000", {
headers: {
"Authorization": `Bearer ${process.env.HMS_TOKEN}`
}
});
const data = await res.json();$ch = curl_init('https://test.hms.gen.tr/external/payment/company?hotelID=1000');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('HMS_TOKEN'),
],
]);
$data = json_decode(curl_exec($ch), true);{
"success": true,
"paymentCompany": {
"merchant_id": "4000****",
"store_key": "********",
"terminal_no": "VP00****",
"user": "demo_api",
"password": "********",
"max_installment": 6,
"company_id": 3,
"company_code": "iyzico",
"company_name": "iyzico"
}
}Start the payment step#
/external/online/payment/type/{paymentType}Authentication: Authorization: Bearer · Body: application/json
Returns what to do for the selected payment type. Types 1 and 9 need only hotelID; type 3 lists bank accounts; for type 10 the payment is started with guest and basket details and the returned code (HTML) is rendered on the guest’s page to hand over to the provider’s payment screen.
Path parameters
paymentTypeintegerrequired13910Request body
hotelIDintegerrequiredtotalPricedecimalorderIDstringreturnUrlstringname / surname / email / phonestringcity / addressstringcountryIDintegerid from the country list.baskets[]object[]id, name, piece, price.Response
200 Type 10: code contains an HTML fragment that hands over to the payment provider (an auto-submitting form, a window.location script or an embedded checkout form, depending on the provider). Render it as-is in the guest’s browser. For other types the message field says what to do.
Error responses
- 200
required_input_info_not_submitted(+errors[]) — missing field for type 10;country_info_sent_incorrectly— invalidcountryID;there_is_missing_info_in_the_shopping_cart— missing field in a basket item;bank_info_is_not_found— no bank account configured for type 3. - 404 Unknown
paymentType.
curl -X POST "https://test.hms.gen.tr/external/online/payment/type/10" \
-H "Authorization: Bearer $HMS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"hotelID": 1000,
"totalPrice": 2330,
"orderID": "4811174883",
"returnUrl": "https://booking.example.com/payment/result",
"name": "Ayşe",
"surname": "Demir",
"email": "[email protected]",
"phone": "05551112233",
"city": "Denizli",
"address": "Kumsal Cad. No: 12",
"countryID": 1,
"baskets": [
{
"id": 2,
"name": "Standard Room · Bed & Breakfast",
"piece": 1,
"price": 1930
},
{
"id": 12,
"name": "Dinner",
"piece": 1,
"price": 400
}
]
}'const res = await fetch("https://test.hms.gen.tr/external/online/payment/type/10", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.HMS_TOKEN}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"hotelID": 1000,
"totalPrice": 2330,
"orderID": "4811174883",
"returnUrl": "https://booking.example.com/payment/result",
"name": "Ayşe",
"surname": "Demir",
"email": "[email protected]",
"phone": "05551112233",
"city": "Denizli",
"address": "Kumsal Cad. No: 12",
"countryID": 1,
"baskets": [
{
"id": 2,
"name": "Standard Room · Bed & Breakfast",
"piece": 1,
"price": 1930
},
{
"id": 12,
"name": "Dinner",
"piece": 1,
"price": 400
}
]
})
});
const data = await res.json();$ch = curl_init('https://test.hms.gen.tr/external/online/payment/type/10');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('HMS_TOKEN'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'hotelID' => 1000,
'totalPrice' => 2330,
'orderID' => '4811174883',
'returnUrl' => 'https://booking.example.com/payment/result',
'name' => 'Ayşe',
'surname' => 'Demir',
'email' => '[email protected]',
'phone' => '05551112233',
'city' => 'Denizli',
'address' => 'Kumsal Cad. No: 12',
'countryID' => 1,
'baskets' => [
[
'id' => 2,
'name' => 'Standard Room · Bed & Breakfast',
'piece' => 1,
'price' => 1930,
],
[
'id' => 12,
'name' => 'Dinner',
'piece' => 1,
'price' => 400,
],
],
]),
]);
$data = json_decode(curl_exec($ch), true);{
"success": true,
"message": "payment_order_code",
"code": "<form method=\"post\" action=\"https://vpos.provider.example/3d\"><input type=\"hidden\" name=\"orderId\" value=\"4811174883\"> … </form><script>document.forms[0].submit()</script>"
}{
"success": true,
"message": "payment_by_bank_transfer",
"banks": [
{
"companyName": "Ziraat Bank",
"holder": "Demo Turizm A.Ş.",
"branchName": "Denizli",
"branchNumber": "0123",
"bankAccountNumber": "12345678-5001",
"iban": "TR00 0001 0001 2345 6789 5001 01"
}
]
}{
"success": true,
"message": "credit_card_info_should_be_requested"
}