Tabelas auxiliares
Listas fixas para opções de formulário: países, moedas e idiomas. Raramente mudam e podem ficar em cache por um dia.
Países#
POST
/external/countiesAutenticação: Authorization: Bearer
Retorna todos os países. Não requer corpo. O id é usado como countryID na etapa de pagamento.
Resposta
200 Sucesso.
curl -X POST "https://test.hms.gen.tr/external/counties" \
-H "Authorization: Bearer $HMS_TOKEN"const res = await fetch("https://test.hms.gen.tr/external/counties", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.HMS_TOKEN}`
}
});
const data = await res.json();$ch = curl_init('https://test.hms.gen.tr/external/counties');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('HMS_TOKEN'),
],
]);
$data = json_decode(curl_exec($ch), true);{
"success": true,
"count": 249,
"items": [
{
"id": 1,
"name": "Türkiye",
"nameIng": "Turkey",
"code": "TR",
"plate": "TR"
},
{
"id": 2,
"name": "Almanya",
"nameIng": "Germany",
"code": "DE",
"plate": "D"
}
]
}Moedas#
GET
/external/currenciesAutenticação: Authorization: Bearer
Parâmetros de consulta
limitintegerpadrão: 20Registros por página.
pageintegerpadrão: 1Número da página.
orderstringid ou -id.Resposta
200 Sucesso.
curl "https://test.hms.gen.tr/external/currencies?limit=10&page=1" \
-H "Authorization: Bearer $HMS_TOKEN"const res = await fetch("https://test.hms.gen.tr/external/currencies?limit=10&page=1", {
headers: {
"Authorization": `Bearer ${process.env.HMS_TOKEN}`
}
});
const data = await res.json();$ch = curl_init('https://test.hms.gen.tr/external/currencies?limit=10&page=1');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('HMS_TOKEN'),
],
]);
$data = json_decode(curl_exec($ch), true);{
"success": true,
"count": 4,
"items": [
{
"id": 1,
"titleCode": "TRY",
"symbol": "₺",
"price": 1
},
{
"id": 2,
"titleCode": "EUR",
"symbol": "€",
"price": 47.85000000000000142108547152020037174224853515625
},
{
"id": 3,
"titleCode": "USD",
"symbol": "$",
"price": 41.2000000000000028421709430404007434844970703125
}
]
}Idiomas#
GET
/external/languagesAutenticação: Authorization: Bearer
Parâmetros de consulta
limitintegerpadrão: 20Registros por página.
pageintegerpadrão: 1Número da página.
orderstringid ou -id.Resposta
200 Sucesso.
curl "https://test.hms.gen.tr/external/languages?limit=10&page=1" \
-H "Authorization: Bearer $HMS_TOKEN"const res = await fetch("https://test.hms.gen.tr/external/languages?limit=10&page=1", {
headers: {
"Authorization": `Bearer ${process.env.HMS_TOKEN}`
}
});
const data = await res.json();$ch = curl_init('https://test.hms.gen.tr/external/languages?limit=10&page=1');
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": [
{
"id": 1,
"title": "Türkçe",
"code": "tr",
"image": "https://test.hms.gen.tr/images/1000/dil/t-tr.png"
},
{
"id": 2,
"title": "English",
"code": "en",
"image": "https://test.hms.gen.tr/images/1000/dil/t-en.png"
},
{
"id": 3,
"title": "Deutsch",
"code": "de",
"image": "https://test.hms.gen.tr/images/1000/dil/t-de.png"
}
]
}