Documentation Index Fetch the complete documentation index at: https://docs.revize.app/llms.txt
Use this file to discover all available pages before exploring further.
L’API pubblica di cancellazione ti permette di aggiungere la cancellazione self-service degli ordini ovunque — email post-acquisto, pagine di supporto, chatbot o moduli personalizzati. Nessun embed dell’app richiesto.
Perché usare l’API di cancellazione
Cancellazione ovunque Aggiungi pulsanti di annullamento alle email, pagine FAQ, flussi di chatbot o qualsiasi interfaccia personalizzata al di fuori del tuo store.
Nessun embed dell'app necessario Funziona indipendentemente dal portale clienti Revize. Basta chiamare l’endpoint API.
Si applicano le tue regole L’API rispetta automaticamente le tue finestre temporali di cancellazione e le regole di idoneità.
Integrazione semplice Un endpoint, formato di richiesta semplice. Facile da integrare con qualsiasi sistema o piattaforma.
Endpoint API
POST https://revize.untechnickle.com/api/public/v1/{shop-domain-slug}/cancel_order
Parametri:
shop-domain-slug — Il dominio del tuo store Shopify senza .myshopify.com (es. my-store da my-store.myshopify.com)
{
"order_number" : "#2667" ,
"email" : "customer@example.com"
}
Campo Tipo Obbligatorio Descrizione order_numberstring Sì Il numero dell’ordine incluso il simbolo # emailstring Sì L’indirizzo email del cliente utilizzato per l’ordine
Codici di risposta
L’API restituisce un campo status che indica il risultato:
Status Descrizione SUCCESSOrdine annullato con successo ORDER_NOT_FOUNDL’ordine non esiste o l’email non corrisponde NOT_CANCELLABLEL’ordine non può essere annullato (restrizioni di policy) ORDER_FULFILLEDOrdine già evaso, impossibile annullare NOT_EDITABLEL’ordine è bloccato per la modifica CANCEL_DISABLEDFunzionalità di cancellazione non abilitata per questo store APP_INACTIVEL’app Revize non è attiva SHOP_NOT_FOUNDNegozio non trovato nel sistema DOMAIN_MISSINGSlug del dominio del negozio mancante nella richiesta FAILEDErrore generale dell’operazione
Esempio di integrazione
Ecco un esempio JavaScript per chiamare l’API:
async function cancelOrder ( orderNumber , email ) {
const shopDomain = 'your-store' ; // Without .myshopify.com
const apiUrl = 'https://revize.untechnickle.com' ;
try {
const response = await fetch (
` ${ apiUrl } /api/public/v1/ ${ shopDomain } /cancel_order` ,
{
method: 'POST' ,
headers: {
'Content-Type' : 'application/json' ,
'Accept' : 'application/json'
},
body: JSON . stringify ({
order_number: orderNumber ,
email: email
})
}
);
const result = await response . json ();
if ( result . success === true || result . status === 'SUCCESS' ) {
console . log ( 'Order cancelled successfully' );
return { success: true };
} else {
console . log ( 'Cancellation failed:' , result . status );
return { success: false , status: result . status };
}
} catch ( error ) {
console . error ( 'Error:' , error );
return { success: false , status: 'FAILED' };
}
}
Sezione tema Shopify
Aggiungi un modulo di cancellazione a qualsiasi pagina del tuo tema Shopify. Questa sezione pronta all’uso gestisce tutte le chiamate API e mostra i messaggi appropriati.
Codice completo della sezione Shopify
order-cancellation-form.liquid
< div class = "order-cancel-section" >
< div class = "order-cancel-container" >
< div class = "order-cancel-form" >
{% if section . settings . show_heading %}
< h2 >{{ section . settings . heading }}</ h2 >
{% endif %}
{% if section . settings . show_description %}
< p class = "form-description" >{{ section . settings . description }}</ p >
{% endif %}
< form id = "cancelOrderForm" >
< div class = "form-group" >
< label for = "orderNumber" >{{ section . settings . order_label }}</ label >
< input
type = "text"
id = "orderNumber"
name = "orderNumber"
required
placeholder = " {{ section . settings . order_placeholder }} "
>
< small >{{ section . settings . order_help_text }}</ small >
</ div >
< div class = "form-group" >
< label for = "email" >{{ section . settings . email_label }}</ label >
< input
type = "email"
id = "email"
name = "email"
required
placeholder = " {{ section . settings . email_placeholder }} "
>
</ div >
< button type = "submit" id = "submitBtn" >{{ section . settings . button_text }}</ button >
< div id = "message" ></ div >
</ form >
</ div >
</ div >
</ div >
< script >
document . getElementById ( 'cancelOrderForm' ). addEventListener ( 'submit' , async ( e ) => {
e . preventDefault ();
const submitBtn = document . getElementById ( 'submitBtn' );
const messageDiv = document . getElementById ( 'message' );
submitBtn . disabled = true ;
submitBtn . textContent = 'Processing...' ;
messageDiv . textContent = '' ;
messageDiv . className = '' ;
const orderNumber = document . getElementById ( 'orderNumber' ). value . trim ();
const email = document . getElementById ( 'email' ). value . trim ();
const shopDomain = {{ shop . permanent_domain | json }} ;
const domainSlug = shopDomain . replace ( '.myshopify.com' , '' );
const apiUrl = {{ section . settings . api_url | json }} ;
const statusMessages = {
'SUCCESS' : {{ section . settings . msg_success | json }} ,
'ORDER_NOT_FOUND' : {{ section . settings . msg_order_not_found | json }} ,
'NOT_CANCELLABLE' : {{ section . settings . msg_not_cancellable | json }} ,
'ORDER_FULFILLED' : {{ section . settings . msg_order_fulfilled | json }} ,
'NOT_EDITABLE' : {{ section . settings . msg_not_editable | json }} ,
'CANCEL_DISABLED' : {{ section . settings . msg_cancel_disabled | json }} ,
'APP_INACTIVE' : {{ section . settings . msg_app_inactive | json }} ,
'FAILED' : {{ section . settings . msg_failed | json }}
};
const buttonText = {{ section . settings . button_text | json }} ;
try {
const response = await fetch ( ` ${ apiUrl } /api/public/v1/ ${ domainSlug } /cancel_order` , {
method: 'POST' ,
headers: {
'Content-Type' : 'application/json' ,
'Accept' : 'application/json'
},
body: JSON . stringify ({
order_number: orderNumber ,
email: email
})
});
const result = await response . json ();
if ( result . success === true || result . status === 'SUCCESS' ) {
messageDiv . className = 'success' ;
messageDiv . textContent = statusMessages [ 'SUCCESS' ];
document . getElementById ( 'cancelOrderForm' ). reset ();
} else {
messageDiv . className = 'error' ;
messageDiv . textContent = statusMessages [ result . status ] || statusMessages [ 'FAILED' ];
}
} catch ( error ) {
console . error ( 'Error:' , error );
messageDiv . className = 'error' ;
messageDiv . textContent = statusMessages [ 'FAILED' ];
} finally {
submitBtn . disabled = false ;
submitBtn . textContent = buttonText ;
}
});
</ script >
< style >
.order-cancel-section {
padding : {{ section . settings . section_padding_top }} px 0 {{ section . settings . section_padding_bottom }} px;
background : {{ section . settings . background_color }} ;
}
.order-cancel-container {
max-width : 1200 px ;
margin : 0 auto ;
padding : 0 20 px ;
}
.order-cancel-form {
max-width : {{ section . settings . form_width }} px;
margin : 0 auto ;
padding : {{ section . settings . form_padding }} px;
border : 1 px solid {{ section . settings . border_color }} ;
border-radius : {{ section . settings . border_radius }} px;
background : {{ section . settings . form_background }} ;
}
.order-cancel-form h2 {
margin-bottom : 10 px ;
font-size : {{ section . settings . heading_size }} px;
color : {{ section . settings . heading_color }} ;
text-align : {{ section . settings . text_align }} ;
}
.order-cancel-form .form-description {
margin-bottom : 24 px ;
color : {{ section . settings . description_color }} ;
text-align : {{ section . settings . text_align }} ;
}
.form-group {
margin-bottom : 20 px ;
text-align : left ;
}
.form-group label {
display : block ;
margin-bottom : 8 px ;
font-weight : 600 ;
font-size : 14 px ;
}
.form-group input {
width : 100 % ;
padding : 12 px ;
border : 1 px solid {{ section . settings . input_border_color }} ;
border-radius : 4 px ;
font-size : 14 px ;
box-sizing : border-box ;
}
.form-group small {
display : block ;
margin-top : 4 px ;
color : #666 ;
font-size : 12 px ;
}
button {
width : 100 % ;
padding : 14 px ;
background : {{ section . settings . button_background }} ;
color : {{ section . settings . button_text_color }} ;
border : none ;
border-radius : 4 px ;
font-size : 16 px ;
font-weight : 600 ;
cursor : pointer ;
}
button :disabled {
opacity : 0.5 ;
cursor : not-allowed ;
}
#message {
margin-top : 20 px ;
padding : 12 px ;
border-radius : 4 px ;
text-align : center ;
}
#message.success {
background : #d4edda ;
color : #155724 ;
}
#message.error {
background : #f8d7da ;
color : #721c24 ;
}
</ style >
{% schema %}
{
"name" : "Order Cancellation Form" ,
"settings" : [
{
"type" : "text" ,
"id" : "api_url" ,
"label" : "API URL" ,
"default" : "https://revize.untechnickle.com"
},
{
"type" : "text" ,
"id" : "heading" ,
"label" : "Heading" ,
"default" : "Cancel Your Order"
},
{
"type" : "textarea" ,
"id" : "description" ,
"label" : "Description" ,
"default" : "Enter your order number and email to cancel your order"
},
{
"type" : "text" ,
"id" : "button_text" ,
"label" : "Button Text" ,
"default" : "Cancel Order"
},
{
"type" : "textarea" ,
"id" : "msg_success" ,
"label" : "Success Message" ,
"default" : "Your order has been cancelled successfully!"
},
{
"type" : "textarea" ,
"id" : "msg_order_not_found" ,
"label" : "Order Not Found" ,
"default" : "We couldn't find an order with that number and email."
},
{
"type" : "textarea" ,
"id" : "msg_not_cancellable" ,
"label" : "Not Cancellable" ,
"default" : "This order cannot be cancelled due to our cancellation policy."
},
{
"type" : "textarea" ,
"id" : "msg_order_fulfilled" ,
"label" : "Order Fulfilled" ,
"default" : "This order has already been fulfilled and cannot be cancelled."
},
{
"type" : "textarea" ,
"id" : "msg_failed" ,
"label" : "General Error" ,
"default" : "Unable to process your request. Please try again."
}
],
"presets" : [{ "name" : "Order Cancellation Form" }]
}
{% endschema %}
Casi d’uso comuni
Pagine di supporto
Email post-acquisto
Chatbot
Cancellazione self-service su pagine FAQ/Aiuto Aggiungi il modulo di cancellazione alle tue pagine di supporto o FAQ in modo che i clienti possano annullare gli ordini senza contattare il supporto.
Riduce i ticket di supporto
Disponibilità 24/7
Elaborazione immediata
Pulsante di annullamento nelle email di conferma ordine Aggiungi un link “Annulla ordine” nelle tue email transazionali che apre una pagina di cancellazione sul tuo store.
Comodo per i clienti
Cattura tempestivamente le richieste impulsive di annullamento
Riduce le richieste “come faccio ad annullare?”
Cancellazione automatizzata via chat Integra l’API con i chatbot (Gorgias, Zendesk, ecc.) per gestire automaticamente le richieste di cancellazione.
Risposta immediata
Nessun coinvolgimento dell’agente necessario
Funziona 24/7
Requisiti di configurazione
L’API pubblica di cancellazione è una funzionalità avanzata che richiede l’attivazione da parte del nostro team.
Configura le impostazioni di rimborso
Imposta il tuo metodo di rimborso in Payments & Refunds — metodo di pagamento originale o credito negozio.
Ottieni i tuoi dettagli di integrazione
Ti forniremo lo slug del dominio del tuo negozio e qualsiasi configurazione personalizzata necessaria per il tuo caso d’uso.
Testa con ordini bozza
Crea ordini di prova per verificare che l’API funzioni correttamente prima di andare live.
Questa funzionalità è disponibile sui piani Pro. Contattaci per i prezzi e l’assistenza alla configurazione.
Domande frequenti
L'API rispetta le mie regole di cancellazione?
Sì. L’API applica automaticamente le tue impostazioni della finestra di modifica, le restrizioni dell’ordine e le politiche di rimborso. Gli ordini al di fuori della finestra di modifica o con tag di blocco non possono essere annullati tramite API.
Come vengono elaborati i rimborsi?
I rimborsi vengono elaborati in base alle tue impostazioni di pagamento Revize — sul metodo di pagamento originale o come credito negozio, esattamente come le cancellazioni tramite il portale clienti.
Posso usarla per integrazioni di terze parti?
Assolutamente sì. L’API è progettata per integrazioni esterne — chatbot, fornitori di servizi email, app personalizzate o qualsiasi sistema in grado di effettuare richieste HTTP.
È richiesta l'autenticazione?
L’API utilizza la verifica tramite numero ordine + email per la sicurezza. Nessuna chiave API richiesta, rendendo l’integrazione semplice e garantendo al tempo stesso che solo i proprietari dell’ordine possano annullare.
L’API pubblica di cancellazione estende la cancellazione self-service oltre il portale Revize. Usala per incontrare i clienti ovunque si trovino — email, pagine di supporto o chatbot.
Funzionalità correlate