curl --request PATCH \
--url https://api.vellaro.io/api/v1/admin/orders/{order_id}/payment \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"payment_status": "<string>",
"reason": "<string>",
"notify_customer": false,
"delivered_now": false,
"iute_amount_verified": false
}
'import requests
url = "https://api.vellaro.io/api/v1/admin/orders/{order_id}/payment"
payload = {
"payment_status": "<string>",
"reason": "<string>",
"notify_customer": False,
"delivered_now": False,
"iute_amount_verified": False
}
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({
payment_status: '<string>',
reason: '<string>',
notify_customer: false,
delivered_now: false,
iute_amount_verified: false
})
};
fetch('https://api.vellaro.io/api/v1/admin/orders/{order_id}/payment', 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}/payment",
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([
'payment_status' => '<string>',
'reason' => '<string>',
'notify_customer' => false,
'delivered_now' => false,
'iute_amount_verified' => false
]),
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}/payment"
payload := strings.NewReader("{\n \"payment_status\": \"<string>\",\n \"reason\": \"<string>\",\n \"notify_customer\": false,\n \"delivered_now\": false,\n \"iute_amount_verified\": false\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}/payment")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"payment_status\": \"<string>\",\n \"reason\": \"<string>\",\n \"notify_customer\": false,\n \"delivered_now\": false,\n \"iute_amount_verified\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vellaro.io/api/v1/admin/orders/{order_id}/payment")
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 \"payment_status\": \"<string>\",\n \"reason\": \"<string>\",\n \"notify_customer\": false,\n \"delivered_now\": false,\n \"iute_amount_verified\": false\n}"
response = http.request(request)
puts response.read_body{
"data": {
"payment_status": "<string>",
"payment_method": "<string>",
"currency": "<string>",
"total": "<string>",
"amount_paid": "<string>",
"amount_refunded": "<string>",
"net": "<string>",
"refundable": "<string>",
"gateway_refs": {},
"voucher_held": "0",
"transactions": []
},
"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 Payment Status
Admin: manually set payment_status (paid / failed / pending).
Marking an offline order (COD / bank transfer) as paid runs the canonical
paid side-effects (commit stock, accrue commission, grant downloads,
order.paid webhook) — mirroring the gateway confirm paths — so COD orders
no longer sit at pending forever. Refunds go through POST /refunds, not
here.
VEN-24: only the roles of staff_permissions.PAYMENT_ROLES (not the help
desk) → 403 order.payment_forbidden.
ORD-6 (§11.7): «paid» on an order in the trash restores it first (the bank
transfer that arrives late), with the reason mandatory → 422
order.restore_reason_required; then, like a gateway payment on an
order in the trash, it goes to Processing (D29), and the stock is taken
for an order that can still be shipped or refunded. Any other payment
status on an order in the trash → 409 order.trashed. Restoring is a
person’s act (§10.2): an API token, even with the accountant’s role, gets
403 auth.api_token_forbidden on «paid» for an order in the trash.
An order that WAS in the trash and that the staff restored first (it is
Cancelled, with a restored row) goes to Processing too when it is
marked paid: from Cancelled it could only become Refunded, and the
stock taken here would sit on an order that can never be shipped.
ORD-32: «paid» is lifecycle.mark_order_paid. On a MANUAL order
(source='admin') with Nextera on, fiscal (now · at_register
· later) is mandatory → 422 order.fiscal_choice_required (AZA’s
till shares the Nextera key: §9.2); now with Nextera not usable → 409
order.fiscal_now_unavailable, nothing written (never downgraded in
silence to no receipt). A storefront order ignores it and
keeps today’s automatic fiscalization. delivered_now on a manual
order also makes it Delivered («Consegnato subito»: paid and picked up
at the counter), 409 order.invalid_transition if it cannot get there;
a storefront order ignores it too.
curl --request PATCH \
--url https://api.vellaro.io/api/v1/admin/orders/{order_id}/payment \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"payment_status": "<string>",
"reason": "<string>",
"notify_customer": false,
"delivered_now": false,
"iute_amount_verified": false
}
'import requests
url = "https://api.vellaro.io/api/v1/admin/orders/{order_id}/payment"
payload = {
"payment_status": "<string>",
"reason": "<string>",
"notify_customer": False,
"delivered_now": False,
"iute_amount_verified": False
}
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({
payment_status: '<string>',
reason: '<string>',
notify_customer: false,
delivered_now: false,
iute_amount_verified: false
})
};
fetch('https://api.vellaro.io/api/v1/admin/orders/{order_id}/payment', 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}/payment",
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([
'payment_status' => '<string>',
'reason' => '<string>',
'notify_customer' => false,
'delivered_now' => false,
'iute_amount_verified' => false
]),
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}/payment"
payload := strings.NewReader("{\n \"payment_status\": \"<string>\",\n \"reason\": \"<string>\",\n \"notify_customer\": false,\n \"delivered_now\": false,\n \"iute_amount_verified\": false\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}/payment")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"payment_status\": \"<string>\",\n \"reason\": \"<string>\",\n \"notify_customer\": false,\n \"delivered_now\": false,\n \"iute_amount_verified\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vellaro.io/api/v1/admin/orders/{order_id}/payment")
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 \"payment_status\": \"<string>\",\n \"reason\": \"<string>\",\n \"notify_customer\": false,\n \"delivered_now\": false,\n \"iute_amount_verified\": false\n}"
response = http.request(request)
puts response.read_body{
"data": {
"payment_status": "<string>",
"payment_method": "<string>",
"currency": "<string>",
"total": "<string>",
"amount_paid": "<string>",
"amount_refunded": "<string>",
"net": "<string>",
"refundable": "<string>",
"gateway_refs": {},
"voucher_held": "0",
"transactions": []
},
"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": {}
}
]
}Autorizzazioni
Corpo
Admin: manually transition payment_status (paid / failed / pending).