curl --request GET \
--url https://api.vellaro.io/api/v1/admin/orders \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.vellaro.io/api/v1/admin/orders"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.vellaro.io/api/v1/admin/orders', 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://api.vellaro.io/api/v1/admin/orders",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://api.vellaro.io/api/v1/admin/orders"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.vellaro.io/api/v1/admin/orders")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vellaro.io/api/v1/admin/orders")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "<string>",
"payment_status": "<string>",
"total": "<string>",
"currency": "<string>",
"customer_email": "<string>",
"item_count": 123,
"created_at": "2023-11-07T05:31:56Z",
"payment_method": "",
"customer_name": "<string>",
"invoice_number": 123,
"payment_attempt": {
"method": "iute",
"state": "awaiting"
},
"source": "<string>",
"channel": "<string>",
"created_by_name": "<string>",
"delivery_mode": "<string>",
"deleted_at": "2023-11-07T05:31:56Z",
"deleted_by_name": "<string>",
"delete_reason": "<string>",
"delete_reason_code": "<string>",
"purge_after": "2023-11-07T05:31:56Z"
}
],
"meta": {
"page": 123,
"page_size": 123,
"total": 123,
"total_pages": 123
},
"error": "<string>",
"error_code": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Admin List Orders
Admin: paginated list of the store’s orders.
ORD-20: the filters «Canale», «Inserito dallo staff», «Inseriti da me oggi»
and «Ritiro» (orders/list_filters.py); an unknown value → 422
order.invalid_filter.
ORD-3: the rows are StaffOrderListOut (origin, channel, who entered it,
pickup, trash); OrderListOut stays the customer’s list.
ORD-6 (§11.7, §11.12): view=trash lists the orders in the trash, most
recent first, with a paid one (it should not exist, §11.9) on top. Open to
who trashes (admin, manager) and, read-only, to who records payments
(sales_manager, accountant: late bank transfers) → 403
order.delete_forbidden for the others.
ORD-53: in both views q also matches the last 8 digits of the order’s
phone (index ix_orders_phone8), from 6 digits typed.
curl --request GET \
--url https://api.vellaro.io/api/v1/admin/orders \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.vellaro.io/api/v1/admin/orders"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.vellaro.io/api/v1/admin/orders', 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://api.vellaro.io/api/v1/admin/orders",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://api.vellaro.io/api/v1/admin/orders"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.vellaro.io/api/v1/admin/orders")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vellaro.io/api/v1/admin/orders")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "<string>",
"payment_status": "<string>",
"total": "<string>",
"currency": "<string>",
"customer_email": "<string>",
"item_count": 123,
"created_at": "2023-11-07T05:31:56Z",
"payment_method": "",
"customer_name": "<string>",
"invoice_number": 123,
"payment_attempt": {
"method": "iute",
"state": "awaiting"
},
"source": "<string>",
"channel": "<string>",
"created_by_name": "<string>",
"delivery_mode": "<string>",
"deleted_at": "2023-11-07T05:31:56Z",
"deleted_by_name": "<string>",
"delete_reason": "<string>",
"delete_reason_code": "<string>",
"purge_after": "2023-11-07T05:31:56Z"
}
],
"meta": {
"page": 123,
"page_size": 123,
"total": 123,
"total_pages": 123
},
"error": "<string>",
"error_code": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}