Create an order
curl --request POST \
--url https://localhost:8080/api/receptionist/order \
--header 'Content-Type: application/json' \
--data '
{
"date": "2023-12-25",
"session": {
"id": 123,
"startTime": {
"hour": 123,
"minute": 123,
"second": 123,
"nano": 123
},
"endTime": {
"hour": 123,
"minute": 123,
"second": 123,
"nano": 123
}
},
"location": "<string>",
"latitude": 123,
"longitude": 123,
"cropType": {
"id": 123,
"name": "<string>"
},
"area": 2,
"farmer": {
"id": 123,
"email": "<string>",
"fullName": "<string>",
"phoneNumber": "<string>",
"street": "<string>",
"city": "<string>",
"province": "<string>",
"postalCode": "<string>",
"active": true
},
"receptionist": {
"id": 123,
"email": "<string>",
"fullName": "<string>",
"phoneNumber": "<string>",
"street": "<string>",
"city": "<string>",
"province": "<string>",
"postalCode": "<string>",
"active": true
},
"completionDate": "2023-12-25"
}
'import requests
url = "https://localhost:8080/api/receptionist/order"
payload = {
"date": "2023-12-25",
"session": {
"id": 123,
"startTime": {
"hour": 123,
"minute": 123,
"second": 123,
"nano": 123
},
"endTime": {
"hour": 123,
"minute": 123,
"second": 123,
"nano": 123
}
},
"location": "<string>",
"latitude": 123,
"longitude": 123,
"cropType": {
"id": 123,
"name": "<string>"
},
"area": 2,
"farmer": {
"id": 123,
"email": "<string>",
"fullName": "<string>",
"phoneNumber": "<string>",
"street": "<string>",
"city": "<string>",
"province": "<string>",
"postalCode": "<string>",
"active": True
},
"receptionist": {
"id": 123,
"email": "<string>",
"fullName": "<string>",
"phoneNumber": "<string>",
"street": "<string>",
"city": "<string>",
"province": "<string>",
"postalCode": "<string>",
"active": True
},
"completionDate": "2023-12-25"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
date: '2023-12-25',
session: {
id: 123,
startTime: {hour: 123, minute: 123, second: 123, nano: 123},
endTime: {hour: 123, minute: 123, second: 123, nano: 123}
},
location: '<string>',
latitude: 123,
longitude: 123,
cropType: {id: 123, name: '<string>'},
area: 2,
farmer: {
id: 123,
email: '<string>',
fullName: '<string>',
phoneNumber: '<string>',
street: '<string>',
city: '<string>',
province: '<string>',
postalCode: '<string>',
active: true
},
receptionist: {
id: 123,
email: '<string>',
fullName: '<string>',
phoneNumber: '<string>',
street: '<string>',
city: '<string>',
province: '<string>',
postalCode: '<string>',
active: true
},
completionDate: '2023-12-25'
})
};
fetch('https://localhost:8080/api/receptionist/order', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8080",
CURLOPT_URL => "https://localhost:8080/api/receptionist/order",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'date' => '2023-12-25',
'session' => [
'id' => 123,
'startTime' => [
'hour' => 123,
'minute' => 123,
'second' => 123,
'nano' => 123
],
'endTime' => [
'hour' => 123,
'minute' => 123,
'second' => 123,
'nano' => 123
]
],
'location' => '<string>',
'latitude' => 123,
'longitude' => 123,
'cropType' => [
'id' => 123,
'name' => '<string>'
],
'area' => 2,
'farmer' => [
'id' => 123,
'email' => '<string>',
'fullName' => '<string>',
'phoneNumber' => '<string>',
'street' => '<string>',
'city' => '<string>',
'province' => '<string>',
'postalCode' => '<string>',
'active' => true
],
'receptionist' => [
'id' => 123,
'email' => '<string>',
'fullName' => '<string>',
'phoneNumber' => '<string>',
'street' => '<string>',
'city' => '<string>',
'province' => '<string>',
'postalCode' => '<string>',
'active' => true
],
'completionDate' => '2023-12-25'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://localhost:8080/api/receptionist/order"
payload := strings.NewReader("{\n \"date\": \"2023-12-25\",\n \"session\": {\n \"id\": 123,\n \"startTime\": {\n \"hour\": 123,\n \"minute\": 123,\n \"second\": 123,\n \"nano\": 123\n },\n \"endTime\": {\n \"hour\": 123,\n \"minute\": 123,\n \"second\": 123,\n \"nano\": 123\n }\n },\n \"location\": \"<string>\",\n \"latitude\": 123,\n \"longitude\": 123,\n \"cropType\": {\n \"id\": 123,\n \"name\": \"<string>\"\n },\n \"area\": 2,\n \"farmer\": {\n \"id\": 123,\n \"email\": \"<string>\",\n \"fullName\": \"<string>\",\n \"phoneNumber\": \"<string>\",\n \"street\": \"<string>\",\n \"city\": \"<string>\",\n \"province\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"active\": true\n },\n \"receptionist\": {\n \"id\": 123,\n \"email\": \"<string>\",\n \"fullName\": \"<string>\",\n \"phoneNumber\": \"<string>\",\n \"street\": \"<string>\",\n \"city\": \"<string>\",\n \"province\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"active\": true\n },\n \"completionDate\": \"2023-12-25\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://localhost:8080/api/receptionist/order")
.header("Content-Type", "application/json")
.body("{\n \"date\": \"2023-12-25\",\n \"session\": {\n \"id\": 123,\n \"startTime\": {\n \"hour\": 123,\n \"minute\": 123,\n \"second\": 123,\n \"nano\": 123\n },\n \"endTime\": {\n \"hour\": 123,\n \"minute\": 123,\n \"second\": 123,\n \"nano\": 123\n }\n },\n \"location\": \"<string>\",\n \"latitude\": 123,\n \"longitude\": 123,\n \"cropType\": {\n \"id\": 123,\n \"name\": \"<string>\"\n },\n \"area\": 2,\n \"farmer\": {\n \"id\": 123,\n \"email\": \"<string>\",\n \"fullName\": \"<string>\",\n \"phoneNumber\": \"<string>\",\n \"street\": \"<string>\",\n \"city\": \"<string>\",\n \"province\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"active\": true\n },\n \"receptionist\": {\n \"id\": 123,\n \"email\": \"<string>\",\n \"fullName\": \"<string>\",\n \"phoneNumber\": \"<string>\",\n \"street\": \"<string>\",\n \"city\": \"<string>\",\n \"province\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"active\": true\n },\n \"completionDate\": \"2023-12-25\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://localhost:8080/api/receptionist/order")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"date\": \"2023-12-25\",\n \"session\": {\n \"id\": 123,\n \"startTime\": {\n \"hour\": 123,\n \"minute\": 123,\n \"second\": 123,\n \"nano\": 123\n },\n \"endTime\": {\n \"hour\": 123,\n \"minute\": 123,\n \"second\": 123,\n \"nano\": 123\n }\n },\n \"location\": \"<string>\",\n \"latitude\": 123,\n \"longitude\": 123,\n \"cropType\": {\n \"id\": 123,\n \"name\": \"<string>\"\n },\n \"area\": 2,\n \"farmer\": {\n \"id\": 123,\n \"email\": \"<string>\",\n \"fullName\": \"<string>\",\n \"phoneNumber\": \"<string>\",\n \"street\": \"<string>\",\n \"city\": \"<string>\",\n \"province\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"active\": true\n },\n \"receptionist\": {\n \"id\": 123,\n \"email\": \"<string>\",\n \"fullName\": \"<string>\",\n \"phoneNumber\": \"<string>\",\n \"street\": \"<string>\",\n \"city\": \"<string>\",\n \"province\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"active\": true\n },\n \"completionDate\": \"2023-12-25\"\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"farmer": {
"id": 123,
"email": "<string>",
"fullName": "<string>",
"phoneNumber": "<string>",
"street": "<string>",
"city": "<string>",
"province": "<string>",
"postalCode": "<string>",
"active": true
},
"receptionist": {
"id": 123,
"email": "<string>",
"fullName": "<string>",
"phoneNumber": "<string>",
"street": "<string>",
"city": "<string>",
"province": "<string>",
"postalCode": "<string>",
"active": true
},
"date": "2023-12-25",
"session": {
"id": 123,
"startTime": {
"hour": 123,
"minute": 123,
"second": 123,
"nano": 123
},
"endTime": {
"hour": 123,
"minute": 123,
"second": 123,
"nano": 123
}
},
"location": "<string>",
"latitude": 123,
"longitude": 123,
"cropType": {
"id": 123,
"name": "<string>"
},
"area": 123,
"cost": 123,
"completionDate": "2023-12-25",
"confirmed": true,
"creationDate": "2023-12-25"
}Order
Create an order
POST
/
api
/
receptionist
/
order
Create an order
curl --request POST \
--url https://localhost:8080/api/receptionist/order \
--header 'Content-Type: application/json' \
--data '
{
"date": "2023-12-25",
"session": {
"id": 123,
"startTime": {
"hour": 123,
"minute": 123,
"second": 123,
"nano": 123
},
"endTime": {
"hour": 123,
"minute": 123,
"second": 123,
"nano": 123
}
},
"location": "<string>",
"latitude": 123,
"longitude": 123,
"cropType": {
"id": 123,
"name": "<string>"
},
"area": 2,
"farmer": {
"id": 123,
"email": "<string>",
"fullName": "<string>",
"phoneNumber": "<string>",
"street": "<string>",
"city": "<string>",
"province": "<string>",
"postalCode": "<string>",
"active": true
},
"receptionist": {
"id": 123,
"email": "<string>",
"fullName": "<string>",
"phoneNumber": "<string>",
"street": "<string>",
"city": "<string>",
"province": "<string>",
"postalCode": "<string>",
"active": true
},
"completionDate": "2023-12-25"
}
'import requests
url = "https://localhost:8080/api/receptionist/order"
payload = {
"date": "2023-12-25",
"session": {
"id": 123,
"startTime": {
"hour": 123,
"minute": 123,
"second": 123,
"nano": 123
},
"endTime": {
"hour": 123,
"minute": 123,
"second": 123,
"nano": 123
}
},
"location": "<string>",
"latitude": 123,
"longitude": 123,
"cropType": {
"id": 123,
"name": "<string>"
},
"area": 2,
"farmer": {
"id": 123,
"email": "<string>",
"fullName": "<string>",
"phoneNumber": "<string>",
"street": "<string>",
"city": "<string>",
"province": "<string>",
"postalCode": "<string>",
"active": True
},
"receptionist": {
"id": 123,
"email": "<string>",
"fullName": "<string>",
"phoneNumber": "<string>",
"street": "<string>",
"city": "<string>",
"province": "<string>",
"postalCode": "<string>",
"active": True
},
"completionDate": "2023-12-25"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
date: '2023-12-25',
session: {
id: 123,
startTime: {hour: 123, minute: 123, second: 123, nano: 123},
endTime: {hour: 123, minute: 123, second: 123, nano: 123}
},
location: '<string>',
latitude: 123,
longitude: 123,
cropType: {id: 123, name: '<string>'},
area: 2,
farmer: {
id: 123,
email: '<string>',
fullName: '<string>',
phoneNumber: '<string>',
street: '<string>',
city: '<string>',
province: '<string>',
postalCode: '<string>',
active: true
},
receptionist: {
id: 123,
email: '<string>',
fullName: '<string>',
phoneNumber: '<string>',
street: '<string>',
city: '<string>',
province: '<string>',
postalCode: '<string>',
active: true
},
completionDate: '2023-12-25'
})
};
fetch('https://localhost:8080/api/receptionist/order', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8080",
CURLOPT_URL => "https://localhost:8080/api/receptionist/order",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'date' => '2023-12-25',
'session' => [
'id' => 123,
'startTime' => [
'hour' => 123,
'minute' => 123,
'second' => 123,
'nano' => 123
],
'endTime' => [
'hour' => 123,
'minute' => 123,
'second' => 123,
'nano' => 123
]
],
'location' => '<string>',
'latitude' => 123,
'longitude' => 123,
'cropType' => [
'id' => 123,
'name' => '<string>'
],
'area' => 2,
'farmer' => [
'id' => 123,
'email' => '<string>',
'fullName' => '<string>',
'phoneNumber' => '<string>',
'street' => '<string>',
'city' => '<string>',
'province' => '<string>',
'postalCode' => '<string>',
'active' => true
],
'receptionist' => [
'id' => 123,
'email' => '<string>',
'fullName' => '<string>',
'phoneNumber' => '<string>',
'street' => '<string>',
'city' => '<string>',
'province' => '<string>',
'postalCode' => '<string>',
'active' => true
],
'completionDate' => '2023-12-25'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://localhost:8080/api/receptionist/order"
payload := strings.NewReader("{\n \"date\": \"2023-12-25\",\n \"session\": {\n \"id\": 123,\n \"startTime\": {\n \"hour\": 123,\n \"minute\": 123,\n \"second\": 123,\n \"nano\": 123\n },\n \"endTime\": {\n \"hour\": 123,\n \"minute\": 123,\n \"second\": 123,\n \"nano\": 123\n }\n },\n \"location\": \"<string>\",\n \"latitude\": 123,\n \"longitude\": 123,\n \"cropType\": {\n \"id\": 123,\n \"name\": \"<string>\"\n },\n \"area\": 2,\n \"farmer\": {\n \"id\": 123,\n \"email\": \"<string>\",\n \"fullName\": \"<string>\",\n \"phoneNumber\": \"<string>\",\n \"street\": \"<string>\",\n \"city\": \"<string>\",\n \"province\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"active\": true\n },\n \"receptionist\": {\n \"id\": 123,\n \"email\": \"<string>\",\n \"fullName\": \"<string>\",\n \"phoneNumber\": \"<string>\",\n \"street\": \"<string>\",\n \"city\": \"<string>\",\n \"province\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"active\": true\n },\n \"completionDate\": \"2023-12-25\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://localhost:8080/api/receptionist/order")
.header("Content-Type", "application/json")
.body("{\n \"date\": \"2023-12-25\",\n \"session\": {\n \"id\": 123,\n \"startTime\": {\n \"hour\": 123,\n \"minute\": 123,\n \"second\": 123,\n \"nano\": 123\n },\n \"endTime\": {\n \"hour\": 123,\n \"minute\": 123,\n \"second\": 123,\n \"nano\": 123\n }\n },\n \"location\": \"<string>\",\n \"latitude\": 123,\n \"longitude\": 123,\n \"cropType\": {\n \"id\": 123,\n \"name\": \"<string>\"\n },\n \"area\": 2,\n \"farmer\": {\n \"id\": 123,\n \"email\": \"<string>\",\n \"fullName\": \"<string>\",\n \"phoneNumber\": \"<string>\",\n \"street\": \"<string>\",\n \"city\": \"<string>\",\n \"province\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"active\": true\n },\n \"receptionist\": {\n \"id\": 123,\n \"email\": \"<string>\",\n \"fullName\": \"<string>\",\n \"phoneNumber\": \"<string>\",\n \"street\": \"<string>\",\n \"city\": \"<string>\",\n \"province\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"active\": true\n },\n \"completionDate\": \"2023-12-25\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://localhost:8080/api/receptionist/order")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"date\": \"2023-12-25\",\n \"session\": {\n \"id\": 123,\n \"startTime\": {\n \"hour\": 123,\n \"minute\": 123,\n \"second\": 123,\n \"nano\": 123\n },\n \"endTime\": {\n \"hour\": 123,\n \"minute\": 123,\n \"second\": 123,\n \"nano\": 123\n }\n },\n \"location\": \"<string>\",\n \"latitude\": 123,\n \"longitude\": 123,\n \"cropType\": {\n \"id\": 123,\n \"name\": \"<string>\"\n },\n \"area\": 2,\n \"farmer\": {\n \"id\": 123,\n \"email\": \"<string>\",\n \"fullName\": \"<string>\",\n \"phoneNumber\": \"<string>\",\n \"street\": \"<string>\",\n \"city\": \"<string>\",\n \"province\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"active\": true\n },\n \"receptionist\": {\n \"id\": 123,\n \"email\": \"<string>\",\n \"fullName\": \"<string>\",\n \"phoneNumber\": \"<string>\",\n \"street\": \"<string>\",\n \"city\": \"<string>\",\n \"province\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"active\": true\n },\n \"completionDate\": \"2023-12-25\"\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"farmer": {
"id": 123,
"email": "<string>",
"fullName": "<string>",
"phoneNumber": "<string>",
"street": "<string>",
"city": "<string>",
"province": "<string>",
"postalCode": "<string>",
"active": true
},
"receptionist": {
"id": 123,
"email": "<string>",
"fullName": "<string>",
"phoneNumber": "<string>",
"street": "<string>",
"city": "<string>",
"province": "<string>",
"postalCode": "<string>",
"active": true
},
"date": "2023-12-25",
"session": {
"id": 123,
"startTime": {
"hour": 123,
"minute": 123,
"second": 123,
"nano": 123
},
"endTime": {
"hour": 123,
"minute": 123,
"second": 123,
"nano": 123
}
},
"location": "<string>",
"latitude": 123,
"longitude": 123,
"cropType": {
"id": 123,
"name": "<string>"
},
"area": 123,
"cost": 123,
"completionDate": "2023-12-25",
"confirmed": true,
"creationDate": "2023-12-25"
}Body
application/json
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Required range:
x >= 1Available options:
pending, cancelled, confirmed, assigned, in_progress, completed Available options:
cash, visa, mastercard Show child attributes
Show child attributes
Show child attributes
Show child attributes
Available options:
pending, paid, failed Response
200 - */*
OK
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Available options:
pending, cancelled, confirmed, assigned, in_progress, completed Available options:
pending, paid, failed Available options:
cash, visa, mastercard ⌘I