curl --request PATCH \
--url https://api.vellaro.io/api/v1/admin/orders/{order_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"status": "<string>",
"comment": "<string>",
"comment_public": false,
"notify_customer": false,
"tracking_number": "<string>",
"shipping_carrier": "<string>"
}
'import requests
url = "https://api.vellaro.io/api/v1/admin/orders/{order_id}"
payload = {
"status": "<string>",
"comment": "<string>",
"comment_public": False,
"notify_customer": False,
"tracking_number": "<string>",
"shipping_carrier": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
status: '<string>',
comment: '<string>',
comment_public: false,
notify_customer: false,
tracking_number: '<string>',
shipping_carrier: '<string>'
})
};
fetch('https://api.vellaro.io/api/v1/admin/orders/{order_id}', 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/{order_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'status' => '<string>',
'comment' => '<string>',
'comment_public' => false,
'notify_customer' => false,
'tracking_number' => '<string>',
'shipping_carrier' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://api.vellaro.io/api/v1/admin/orders/{order_id}"
payload := strings.NewReader("{\n \"status\": \"<string>\",\n \"comment\": \"<string>\",\n \"comment_public\": false,\n \"notify_customer\": false,\n \"tracking_number\": \"<string>\",\n \"shipping_carrier\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.patch("https://api.vellaro.io/api/v1/admin/orders/{order_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"status\": \"<string>\",\n \"comment\": \"<string>\",\n \"comment_public\": false,\n \"notify_customer\": false,\n \"tracking_number\": \"<string>\",\n \"shipping_carrier\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vellaro.io/api/v1/admin/orders/{order_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"status\": \"<string>\",\n \"comment\": \"<string>\",\n \"comment_public\": false,\n \"notify_customer\": false,\n \"tracking_number\": \"<string>\",\n \"shipping_carrier\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "<string>",
"payment_status": "<string>",
"payment_method": "<string>",
"stripe_payment_intent_id": "<string>",
"subtotal": "<string>",
"shipping_cost": "<string>",
"tax": "<string>",
"discount_amount": "<string>",
"total": "<string>",
"currency": "<string>",
"coupon_code": "<string>",
"customer_email": "<string>",
"customer_phone": "<string>",
"shipping_address": {},
"billing_address": {},
"tracking_number": "<string>",
"shipping_carrier": "<string>",
"invoice_number": 123,
"notes": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"tax_rate": "<string>",
"prices_include_tax": false,
"amount_refunded": "0",
"invoice_issued_at": "2023-11-07T05:31:56Z",
"customer_vat_id": "<string>",
"customer_tax_code": "<string>",
"items": [],
"history": [],
"payment_attempt": {
"method": "iute",
"state": "awaiting"
},
"source": "<string>",
"channel": "<string>",
"created_by_name": "<string>",
"email_customer": true,
"delivery_mode": "<string>",
"manual_discount": "<string>",
"fiscal_external": true,
"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",
"imported": false,
"deletion": {
"deletable": true,
"blockers": []
}
},
"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 Update Order Status
Admin: update order status, optionally add tracking info and a history comment.
VEN-6: refunded on an order whose money is still held (payment
paid / partially_refunded) runs the real refund of the remaining
amount first (same path as POST /refunds: gateway or manual record). It used
to change the label only and email “refunded” with the whole total while
nothing went back. The “refunded” email carries the amount actually
refunded and is never sent when nothing was refunded.
VEN-6 (follow-up): refunded on an order never collected (payment
pending/failed) is a 409 order.refund_not_collected: nothing can
go back, and «Cancelled» is the status of an order that was never paid.
VEN-13: the timeline row of the new status is visible to the customer, who
reads the status in the language of the shop; the operator’s comment goes
with it only with comment_public (default: a staff-only note).
VEN-28: notify_customer is recorded only when an email was queued, and
the response carries the timeline with the new rows.
ORD-3: an order in the trash → 409 order.trashed; the answer is
StaffOrderOut.
ORD-4: cancelled runs lifecycle.apply_cancel_effects (the trash’s
too): the gateway attempt of every unpaid online order is voided, the
units that were really taken go back (stock_taken), and the
order.cancelled webhook fires.
curl --request PATCH \
--url https://api.vellaro.io/api/v1/admin/orders/{order_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"status": "<string>",
"comment": "<string>",
"comment_public": false,
"notify_customer": false,
"tracking_number": "<string>",
"shipping_carrier": "<string>"
}
'import requests
url = "https://api.vellaro.io/api/v1/admin/orders/{order_id}"
payload = {
"status": "<string>",
"comment": "<string>",
"comment_public": False,
"notify_customer": False,
"tracking_number": "<string>",
"shipping_carrier": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
status: '<string>',
comment: '<string>',
comment_public: false,
notify_customer: false,
tracking_number: '<string>',
shipping_carrier: '<string>'
})
};
fetch('https://api.vellaro.io/api/v1/admin/orders/{order_id}', 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/{order_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'status' => '<string>',
'comment' => '<string>',
'comment_public' => false,
'notify_customer' => false,
'tracking_number' => '<string>',
'shipping_carrier' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://api.vellaro.io/api/v1/admin/orders/{order_id}"
payload := strings.NewReader("{\n \"status\": \"<string>\",\n \"comment\": \"<string>\",\n \"comment_public\": false,\n \"notify_customer\": false,\n \"tracking_number\": \"<string>\",\n \"shipping_carrier\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.patch("https://api.vellaro.io/api/v1/admin/orders/{order_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"status\": \"<string>\",\n \"comment\": \"<string>\",\n \"comment_public\": false,\n \"notify_customer\": false,\n \"tracking_number\": \"<string>\",\n \"shipping_carrier\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vellaro.io/api/v1/admin/orders/{order_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"status\": \"<string>\",\n \"comment\": \"<string>\",\n \"comment_public\": false,\n \"notify_customer\": false,\n \"tracking_number\": \"<string>\",\n \"shipping_carrier\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "<string>",
"payment_status": "<string>",
"payment_method": "<string>",
"stripe_payment_intent_id": "<string>",
"subtotal": "<string>",
"shipping_cost": "<string>",
"tax": "<string>",
"discount_amount": "<string>",
"total": "<string>",
"currency": "<string>",
"coupon_code": "<string>",
"customer_email": "<string>",
"customer_phone": "<string>",
"shipping_address": {},
"billing_address": {},
"tracking_number": "<string>",
"shipping_carrier": "<string>",
"invoice_number": 123,
"notes": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"tax_rate": "<string>",
"prices_include_tax": false,
"amount_refunded": "0",
"invoice_issued_at": "2023-11-07T05:31:56Z",
"customer_vat_id": "<string>",
"customer_tax_code": "<string>",
"items": [],
"history": [],
"payment_attempt": {
"method": "iute",
"state": "awaiting"
},
"source": "<string>",
"channel": "<string>",
"created_by_name": "<string>",
"email_customer": true,
"delivery_mode": "<string>",
"manual_discount": "<string>",
"fiscal_external": true,
"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",
"imported": false,
"deletion": {
"deletable": true,
"blockers": []
}
},
"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": {}
}
]
}