Introduction
E-megrendelés elkészült megrendeléséhez API hozzáférés JSON adatformátummal.
Ennek a dokumentációnak az a célja, hogy minden olyan információt megadjon, amelyre szüksége van az API-nkkal való együttműködéshez.
Base URL
http://localhost
Authenticating requests
To authenticate requests, include an Authorization header with the value "Bearer {YOUR_AUTH_KEY}".
All authenticated endpoints are marked with a requires authentication badge in the documentation below.
You can retrieve your token by service provider.
General Interfaces
Display a server Status.
Example request:
curl --request GET \
--get "http://localhost/api/v1/status" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/v1/status"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$response = $client->get(
'http://localhost/api/v1/status',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200, Server status):
{
"status": 200,
"success": true,
"apiVersion": "1",
"processedTime": "2020.01.01. 12:00:12.401670",
"data": {
"APIStatus": "up"
}
}
Received response:
Request failed with error:
Response
Response Fields
status integer
request HTTP status
success boolean
process successes
apiVersion integer
current API version
processedTime string
DateTime process Timestamp
data.APIStatus string
API status state (up and down).
Order management
Display a listing of the unprocessed orders.
requires authentication
Example request:
curl --request GET \
--get "http://localhost/api/v1/order/unprocessed" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/v1/order/unprocessed"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$response = $client->get(
'http://localhost/api/v1/order/unprocessed',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200, Has unprocessed orders):
{
"status": 200,
"success": true,
"apiVersion": "1",
"processedTime": "2020.01.01. 12:00:12.401670",
"data": [
{
"id": 1001,
"supplier_id": 11,
"profit_center_id": 99,
"humanId": "ROZMAR/BAL/22/1103",
"deliveryDate": "2020-01-30",
"confirmed": "2022-01-15 09:19:09",
"APICallBackId": "987f3001-6364-4d7c-8b0c-daf29dbd38ec",
"supplierHooreycaId": "S1084",
"supplierName": "Beszállító Kft.",
"profitCenterHooreycaId": "BAL",
"profitCenterName": "Profitcenter Neve - Eurest konyha",
"items": [
{
"id": 1111,
"hooreycaId": "H201",
"name": "Tőkehal filé (Alaszkai) 180/200 g",
"productUnit": "g",
"sellerUnit": "csom",
"unitMultiplier": 1,
"amountUnit": "kg",
"quantity": 15,
"price": 1234
},
{
"id": 2222,
"hooreycaId": "H300",
"name": "Garnélafarok Black tiger 16/20 tisztított, ",
"productUnit": "kg",
"sellerUnit": "csom",
"unitMultiplier": 1,
"amountUnit": "kg",
"quantity": 3,
"price": 5678
}
]
}
],
"pagination": {
"count": 1,
"total": 21,
"perPage": 1,
"currentPage": 2,
"totalPages": 21,
"links": {
"previous": "http://{base_path}/api/v1/order/unprocessed?page=1",
"next": "http://{base_path}/api/v1/order/unprocessed?page=3"
}
}
}
Example response (401, Request unauthenticated):
{
"status": 401,
"success": false,
"error": {
"code": "unauthenticated",
"message": "You are not authenticated for this request."
}
}
Received response:
Request failed with error:
Response
Response Fields
status integer
request HTTP status
success boolean
process successes
apiVersion integer
current API version
processedTime string
DateTime process Timestamp
data object
collection of Orders.
data.APICallBackId string
Neet to set order update status in setProcessed interface.
Set processed orders.
requires authentication
Example request:
curl --request PUT \
"http://localhost/api/v1/order/setProcessed" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"APICallBackId\": [
\"in\"
]
}"
const url = new URL(
"http://localhost/api/v1/order/setProcessed"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"APICallBackId": [
"in"
]
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$response = $client->put(
'http://localhost/api/v1/order/setProcessed',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'APICallBackId' => [
'in',
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200, Has unprocessed orders):
{
"status": 200,
"success": true,
"apiVersion": "1",
"processedTime": "2020.01.01. 12:00:12.401670",
"data": {
"987f3001-6364-4d7c-8b0c-daf29dbd38ec": "updated",
"987ee197-5293-48de-a488-3c9a05229bb6": "invalid Id"
}
}
Example response (500, Request invalid Request Body data):
{
"status": 500,
"success": false,
"apiVersion": "1",
"processedTime": "2020.01.01. 12:00:12.401670",
"error": {
"code": "invalid data",
"message": '{"room_id":["sff","sdf"]}'
}
}
Example response (401, Request unauthenticated):
{
"status": 401,
"success": false,
"error": {
"code": "unauthenticated",
"message": "You are not authenticated for this request."
}
}
Received response:
Request failed with error:
Response
Response Fields
status integer
request HTTP status
success boolean
process successes
apiVersion integer
current API version
processedTime string
DateTime process Timestamp
data object
collection of updated Order status.
data.APICallBackId string
Order update status ("updated" is ok).