curl --request POST \
--url https://api.vellaro.io/api/v1/admin/iute/attempts/{attempt_id}/close \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"reason": "<string>"
}
'import requests
url = "https://api.vellaro.io/api/v1/admin/iute/attempts/{attempt_id}/close"
payload = { "reason": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({reason: '<string>'})
};
fetch('https://api.vellaro.io/api/v1/admin/iute/attempts/{attempt_id}/close', 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/iute/attempts/{attempt_id}/close",
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([
'reason' => '<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/iute/attempts/{attempt_id}/close"
payload := strings.NewReader("{\n \"reason\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.vellaro.io/api/v1/admin/iute/attempts/{attempt_id}/close")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"reason\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vellaro.io/api/v1/admin/iute/attempts/{attempt_id}/close")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"reason\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"attempt": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"order_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"order_number": "<string>",
"order_status": "<string>",
"order_payment_status": "<string>",
"order_trashed": true,
"customer": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"email": "<string>"
},
"status": "issued",
"environment": "test",
"pilot": true,
"mode": "redirect",
"current": true,
"session": "<string>",
"session_bound": true,
"amount": "<string>",
"currency": "<string>",
"approved_amount": "<string>",
"loan_amount": "<string>",
"remote_status": "PENDING",
"remote_checked_at": "2023-11-07T05:31:56Z",
"next_check_at": "2023-11-07T05:31:56Z",
"check_failures": 123,
"check_failing_since": "2023-11-07T05:31:56Z",
"client_status": "<string>",
"paid_by": "webhook",
"close_reason": "<string>",
"decline_reason": "<string>",
"opened_at": "2023-11-07T05:31:56Z",
"submitted_at": "2023-11-07T05:31:56Z",
"decided_at": "2023-11-07T05:31:56Z",
"signed_at": "2023-11-07T05:31:56Z",
"paid_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"attention": [
"amount_mismatch"
],
"last_event": {
"source": "webhook",
"kind": "paid",
"outcome": "pending_check",
"remote_status": "PENDING",
"received_at": "2023-11-07T05:31:56Z"
},
"events": [
{
"source": "webhook",
"kind": "paid",
"outcome": "pending_check",
"remote_status": "PENDING",
"received_at": "2023-11-07T05:31:56Z",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status_before": "issued",
"status_after": "issued",
"key_environment": "test",
"amount": "<string>"
}
],
"events_total": 123
},
"reading": {
"ok": true,
"code": "ok",
"remote_status": "PENDING",
"checked_at": "2023-11-07T05:31:56Z",
"discarded": true,
"before": "issued",
"after": "issued",
"changed": true
}
},
"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": {}
}
]
}Close Attempt
«Chiudi pratica» su un tentativo corrente senza domanda (issued, opened), col motivo ({reason}, 3-500
caratteri). Prima reconcile; poi closed, merce rilasciata, nota e audit iute.attempt_close; l’ordine si
può pagare di nuovo. Risposta {attempt, reading} (reading null se era già chiuso).
403 order.payment_forbidden senza un ruolo dei pagamenti (il servizio clienti no); 422 iute.reason_required;
404 iute.attempt_not_found; 409 iute.attempt_not_closable (Iute vede una domanda) o iute.attempt_not_current,
con data.status; 409 iute.not_allowed / iute.not_configured con data.environment, prima della lettura;
503 iute.close_check_failed se la lettura di prima si interrompe per un errore nostro (nulla è chiuso, si
riprova); 429 oltre 5 al minuto per negozio. Se Iute non risponde decide lo stato scritto (la regola del 28/10).
curl --request POST \
--url https://api.vellaro.io/api/v1/admin/iute/attempts/{attempt_id}/close \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"reason": "<string>"
}
'import requests
url = "https://api.vellaro.io/api/v1/admin/iute/attempts/{attempt_id}/close"
payload = { "reason": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({reason: '<string>'})
};
fetch('https://api.vellaro.io/api/v1/admin/iute/attempts/{attempt_id}/close', 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/iute/attempts/{attempt_id}/close",
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([
'reason' => '<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/iute/attempts/{attempt_id}/close"
payload := strings.NewReader("{\n \"reason\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.vellaro.io/api/v1/admin/iute/attempts/{attempt_id}/close")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"reason\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vellaro.io/api/v1/admin/iute/attempts/{attempt_id}/close")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"reason\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"attempt": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"order_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"order_number": "<string>",
"order_status": "<string>",
"order_payment_status": "<string>",
"order_trashed": true,
"customer": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"email": "<string>"
},
"status": "issued",
"environment": "test",
"pilot": true,
"mode": "redirect",
"current": true,
"session": "<string>",
"session_bound": true,
"amount": "<string>",
"currency": "<string>",
"approved_amount": "<string>",
"loan_amount": "<string>",
"remote_status": "PENDING",
"remote_checked_at": "2023-11-07T05:31:56Z",
"next_check_at": "2023-11-07T05:31:56Z",
"check_failures": 123,
"check_failing_since": "2023-11-07T05:31:56Z",
"client_status": "<string>",
"paid_by": "webhook",
"close_reason": "<string>",
"decline_reason": "<string>",
"opened_at": "2023-11-07T05:31:56Z",
"submitted_at": "2023-11-07T05:31:56Z",
"decided_at": "2023-11-07T05:31:56Z",
"signed_at": "2023-11-07T05:31:56Z",
"paid_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"attention": [
"amount_mismatch"
],
"last_event": {
"source": "webhook",
"kind": "paid",
"outcome": "pending_check",
"remote_status": "PENDING",
"received_at": "2023-11-07T05:31:56Z"
},
"events": [
{
"source": "webhook",
"kind": "paid",
"outcome": "pending_check",
"remote_status": "PENDING",
"received_at": "2023-11-07T05:31:56Z",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status_before": "issued",
"status_after": "issued",
"key_environment": "test",
"amount": "<string>"
}
],
"events_total": 123
},
"reading": {
"ok": true,
"code": "ok",
"remote_status": "PENDING",
"checked_at": "2023-11-07T05:31:56Z",
"discarded": true,
"before": "issued",
"after": "issued",
"changed": true
}
},
"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
Risposta
Successful Response