Get Order Variables
curl --request GET \
--url https://www.xn--dkkango-n2a.com/api/integrations/orders/variables \
--header 'Access-Token: <api-key>'import requests
url = "https://www.xn--dkkango-n2a.com/api/integrations/orders/variables"
headers = {"Access-Token": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'Access-Token': '<api-key>'}};
fetch('https://www.xn--dkkango-n2a.com/api/integrations/orders/variables', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://www.xn--dkkango-n2a.com/api/integrations/orders/variables",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Access-Token: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://www.xn--dkkango-n2a.com/api/integrations/orders/variables"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Access-Token", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://www.xn--dkkango-n2a.com/api/integrations/orders/variables")
.header("Access-Token", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.xn--dkkango-n2a.com/api/integrations/orders/variables")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Access-Token"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"status": true,
"data": {
"paymentMethod": [
{
"key": "<string>",
"name": "<string>"
}
],
"shippingMethod": [
{
"key": "<string>",
"name": "<string>"
}
]
}
}Orders
Get Order Variables
Retrieve payment and shipping method lists
GET
/
orders
/
variables
Get Order Variables
curl --request GET \
--url https://www.xn--dkkango-n2a.com/api/integrations/orders/variables \
--header 'Access-Token: <api-key>'import requests
url = "https://www.xn--dkkango-n2a.com/api/integrations/orders/variables"
headers = {"Access-Token": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'Access-Token': '<api-key>'}};
fetch('https://www.xn--dkkango-n2a.com/api/integrations/orders/variables', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://www.xn--dkkango-n2a.com/api/integrations/orders/variables",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Access-Token: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://www.xn--dkkango-n2a.com/api/integrations/orders/variables"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Access-Token", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://www.xn--dkkango-n2a.com/api/integrations/orders/variables")
.header("Access-Token", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.xn--dkkango-n2a.com/api/integrations/orders/variables")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Access-Token"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"status": true,
"data": {
"paymentMethod": [
{
"key": "<string>",
"name": "<string>"
}
],
"shippingMethod": [
{
"key": "<string>",
"name": "<string>"
}
]
}
}Overview
Returns the available payment methods and shipping methods used in the system.Headers
string
required
Your API access token
Response
boolean
true if successfulobject
Object containing payment and shipping method arrays
Show Response Structure
Show Response Structure
array
Examples
curl -X GET https://www.xn--dkkango-n2a.com/api/integrations/orders/variables \
-H 'Access-Token: your-access-token'
const response = await fetch(
'https://www.xn--dkkango-n2a.com/api/integrations/orders/variables',
{
headers: {
'Access-Token': 'your-access-token'
}
}
);
const data = await response.json();
console.log('Payment methods:', data.data.paymentMethod);
console.log('Shipping methods:', data.data.shippingMethod);
import requests
response = requests.get(
'https://www.xn--dkkango-n2a.com/api/integrations/orders/variables',
headers={'Access-Token': 'your-access-token'}
)
data = response.json()
print('Payment methods:', data['data']['paymentMethod'])
print('Shipping methods:', data['data']['shippingMethod'])
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://www.xn--dkkango-n2a.com/api/integrations/orders/variables');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Access-Token: your-access-token'
));
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
print_r($data['data']);
?>
Success Response (200)
{
"status": true,
"data": {
"paymentMethod": [
{
"key": "CASH",
"name": "Nakit"
},
{
"key": "CREDIT_CARD",
"name": "Kredi Kartı"
},
{
"key": "DEBIT_CARD",
"name": "Banka Kartı"
}
],
"shippingMethod": [
{
"key": "delivery",
"name": "Teslimat"
},
{
"key": "pickup",
"name": "Gel Al"
}
]
}
}
Error Response (401)
{
"status": false,
"error": "yetkisiz erişim"
}
Use Cases
Initialize POS
Initialize POS
Fetch and cache variables when POS starts.
async function initializePOS() {
const variables = await getOrderVariables();
// Store in local cache
localStorage.setItem('paymentMethods',
JSON.stringify(variables.paymentMethod));
localStorage.setItem('shippingMethods',
JSON.stringify(variables.shippingMethod));
console.log('POS initialized with order variables');
}
Display Order Details
Display Order Details
Map payment/shipping keys to display names.
function formatOrderDetails(order) {
const paymentMethods = getPaymentMethods();
const shippingMethods = getShippingMethods();
const paymentName = paymentMethods.find(
p => p.key === order.payment_type
)?.name || order.payment_type;
const shippingName = shippingMethods.find(
s => s.key === order.shipping_method
)?.name || order.shipping_method;
return {
...order,
paymentMethodName: paymentName,
shippingMethodName: shippingName
};
}
Build Filters
Build Filters
Create dropdown filters in POS interface.
async function buildOrderFilters() {
const variables = await getOrderVariables();
// Payment filter
const paymentFilter = variables.paymentMethod.map(pm => ({
value: pm.key,
label: pm.name
}));
// Shipping filter
const shippingFilter = variables.shippingMethod.map(sm => ({
value: sm.key,
label: sm.name
}));
renderFilters(paymentFilter, shippingFilter);
}
Validation
Validation
Validate incoming order data.
function validateOrderVariables(order) {
const variables = getCachedVariables();
const validPayment = variables.paymentMethod.some(
p => p.key === order.payment_type
);
const validShipping = variables.shippingMethod.some(
s => s.key === order.shipping_method
);
if (!validPayment || !validShipping) {
throw new Error('Invalid payment or shipping method');
}
}
Caching Strategy
These values rarely change. Cache them locally to avoid unnecessary API calls.
class VariablesCache {
constructor() {
this.cache = null;
this.lastFetch = null;
this.cacheDuration = 24 * 60 * 60 * 1000; // 24 hours
}
async getVariables() {
const now = Date.now();
// Return cached if recent
if (this.cache && (now - this.lastFetch) < this.cacheDuration) {
return this.cache;
}
// Fetch fresh
const response = await fetch('/orders/variables');
this.cache = await response.json();
this.lastFetch = now;
return this.cache;
}
invalidate() {
this.cache = null;
this.lastFetch = null;
}
}
Payment Methods
| Key | Name | Description |
|---|---|---|
| CASH | Nakit | Cash payment on delivery |
| CREDIT_CARD | Kredi Kartı | Credit card (pre-paid) |
| DEBIT_CARD | Banka Kartı | Debit card (pre-paid) |
Shipping Methods
| Key | Name | Description |
|---|---|---|
| delivery | Teslimat | Home/office delivery |
| pickup | Gel Al | Customer pickup from restaurant |
Related Endpoints
Get Current Orders
Orders use these payment/shipping methods
Get Cancel Reasons
Another variables endpoint
⌘I