Solicitar devolucion
curl --request POST \
--url https://api.preprod.alignet.io/refund \
--header 'ALG-API-VERSION: <alg-api-version>' \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"merchant_code": "41bb301e-3c37-4332-accb-ed5ec19081e4",
"operations": [
{
"type": "TOTAL",
"merchant_operation_number": "239766",
"transaction_id": null,
"refund_amount": "1050",
"additional_fields": {
"canal": "WEB",
"reason": "cliente no reconocio el consumo",
"description": "solicitud por desconocimiento"
}
}
]
}
'import requests
url = "https://api.preprod.alignet.io/refund"
payload = {
"merchant_code": "41bb301e-3c37-4332-accb-ed5ec19081e4",
"operations": [
{
"type": "TOTAL",
"merchant_operation_number": "239766",
"transaction_id": None,
"refund_amount": "1050",
"additional_fields": {
"canal": "WEB",
"reason": "cliente no reconocio el consumo",
"description": "solicitud por desconocimiento"
}
}
]
}
headers = {
"Authorization": "<authorization>",
"ALG-API-VERSION": "<alg-api-version>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: '<authorization>',
'ALG-API-VERSION': '<alg-api-version>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
merchant_code: '41bb301e-3c37-4332-accb-ed5ec19081e4',
operations: [
{
type: 'TOTAL',
merchant_operation_number: '239766',
transaction_id: null,
refund_amount: '1050',
additional_fields: {
canal: 'WEB',
reason: 'cliente no reconocio el consumo',
description: 'solicitud por desconocimiento'
}
}
]
})
};
fetch('https://api.preprod.alignet.io/refund', 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.preprod.alignet.io/refund",
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([
'merchant_code' => '41bb301e-3c37-4332-accb-ed5ec19081e4',
'operations' => [
[
'type' => 'TOTAL',
'merchant_operation_number' => '239766',
'transaction_id' => null,
'refund_amount' => '1050',
'additional_fields' => [
'canal' => 'WEB',
'reason' => 'cliente no reconocio el consumo',
'description' => 'solicitud por desconocimiento'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"ALG-API-VERSION: <alg-api-version>",
"Authorization: <authorization>",
"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.preprod.alignet.io/refund"
payload := strings.NewReader("{\n \"merchant_code\": \"41bb301e-3c37-4332-accb-ed5ec19081e4\",\n \"operations\": [\n {\n \"type\": \"TOTAL\",\n \"merchant_operation_number\": \"239766\",\n \"transaction_id\": null,\n \"refund_amount\": \"1050\",\n \"additional_fields\": {\n \"canal\": \"WEB\",\n \"reason\": \"cliente no reconocio el consumo\",\n \"description\": \"solicitud por desconocimiento\"\n }\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("ALG-API-VERSION", "<alg-api-version>")
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.preprod.alignet.io/refund")
.header("Authorization", "<authorization>")
.header("ALG-API-VERSION", "<alg-api-version>")
.header("Content-Type", "application/json")
.body("{\n \"merchant_code\": \"41bb301e-3c37-4332-accb-ed5ec19081e4\",\n \"operations\": [\n {\n \"type\": \"TOTAL\",\n \"merchant_operation_number\": \"239766\",\n \"transaction_id\": null,\n \"refund_amount\": \"1050\",\n \"additional_fields\": {\n \"canal\": \"WEB\",\n \"reason\": \"cliente no reconocio el consumo\",\n \"description\": \"solicitud por desconocimiento\"\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.preprod.alignet.io/refund")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["ALG-API-VERSION"] = '<alg-api-version>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"merchant_code\": \"41bb301e-3c37-4332-accb-ed5ec19081e4\",\n \"operations\": [\n {\n \"type\": \"TOTAL\",\n \"merchant_operation_number\": \"239766\",\n \"transaction_id\": null,\n \"refund_amount\": \"1050\",\n \"additional_fields\": {\n \"canal\": \"WEB\",\n \"reason\": \"cliente no reconocio el consumo\",\n \"description\": \"solicitud por desconocimiento\"\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": "true",
"action": "refund",
"merchant_code": "41bb301e-3c37-4332-accb-ed5ec19081e4",
"operations": [
{
"refund_id": "922178aa-ce4c-4c5f-8190-82fa7e009425",
"state": "REGISTERED",
"refund_reason": "Solicitud recibida y validada",
"type": "TOTAL",
"merchant_operation_number": "239766",
"transaction_id": "bko66gpi8czns4tcde93q96vd",
"refund_amount": "1050",
"transaction_amount": "1050",
"currency": "604",
"payment_method": {
"name": "CARD",
"brand": "VISA",
"masked_pan": "447411******2240"
},
"additional_fields": {
"canal": "WEB",
"reason": "cliente no reconocio el consumo",
"description": "solicitud por desconocimiento"
},
"lifecycle": [
{
"state": "REGISTERED",
"date": {
"utc_time": "2025-05-26T06:06:45",
"unix_time": 1748239605
}
}
]
}
],
"meta": {
"status": {
"code": "00",
"message_ilgn": [
{
"locale": "es_PE",
"value": "Se proceso correctamente la peticion"
}
]
}
}
}Refunds
Solicitar devolucion
El API de Devoluciones permite enviar una o mas transacciones en estado LIQUIDADO a devolver. Solo esta disponible para los metodos CARD, YAPE y CUOTEALO. La devolucion se aplica despues de la autorizacion, cuando la transaccion ya fue liquidada.
POST
/
refund
Solicitar devolucion
curl --request POST \
--url https://api.preprod.alignet.io/refund \
--header 'ALG-API-VERSION: <alg-api-version>' \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"merchant_code": "41bb301e-3c37-4332-accb-ed5ec19081e4",
"operations": [
{
"type": "TOTAL",
"merchant_operation_number": "239766",
"transaction_id": null,
"refund_amount": "1050",
"additional_fields": {
"canal": "WEB",
"reason": "cliente no reconocio el consumo",
"description": "solicitud por desconocimiento"
}
}
]
}
'import requests
url = "https://api.preprod.alignet.io/refund"
payload = {
"merchant_code": "41bb301e-3c37-4332-accb-ed5ec19081e4",
"operations": [
{
"type": "TOTAL",
"merchant_operation_number": "239766",
"transaction_id": None,
"refund_amount": "1050",
"additional_fields": {
"canal": "WEB",
"reason": "cliente no reconocio el consumo",
"description": "solicitud por desconocimiento"
}
}
]
}
headers = {
"Authorization": "<authorization>",
"ALG-API-VERSION": "<alg-api-version>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: '<authorization>',
'ALG-API-VERSION': '<alg-api-version>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
merchant_code: '41bb301e-3c37-4332-accb-ed5ec19081e4',
operations: [
{
type: 'TOTAL',
merchant_operation_number: '239766',
transaction_id: null,
refund_amount: '1050',
additional_fields: {
canal: 'WEB',
reason: 'cliente no reconocio el consumo',
description: 'solicitud por desconocimiento'
}
}
]
})
};
fetch('https://api.preprod.alignet.io/refund', 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.preprod.alignet.io/refund",
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([
'merchant_code' => '41bb301e-3c37-4332-accb-ed5ec19081e4',
'operations' => [
[
'type' => 'TOTAL',
'merchant_operation_number' => '239766',
'transaction_id' => null,
'refund_amount' => '1050',
'additional_fields' => [
'canal' => 'WEB',
'reason' => 'cliente no reconocio el consumo',
'description' => 'solicitud por desconocimiento'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"ALG-API-VERSION: <alg-api-version>",
"Authorization: <authorization>",
"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.preprod.alignet.io/refund"
payload := strings.NewReader("{\n \"merchant_code\": \"41bb301e-3c37-4332-accb-ed5ec19081e4\",\n \"operations\": [\n {\n \"type\": \"TOTAL\",\n \"merchant_operation_number\": \"239766\",\n \"transaction_id\": null,\n \"refund_amount\": \"1050\",\n \"additional_fields\": {\n \"canal\": \"WEB\",\n \"reason\": \"cliente no reconocio el consumo\",\n \"description\": \"solicitud por desconocimiento\"\n }\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("ALG-API-VERSION", "<alg-api-version>")
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.preprod.alignet.io/refund")
.header("Authorization", "<authorization>")
.header("ALG-API-VERSION", "<alg-api-version>")
.header("Content-Type", "application/json")
.body("{\n \"merchant_code\": \"41bb301e-3c37-4332-accb-ed5ec19081e4\",\n \"operations\": [\n {\n \"type\": \"TOTAL\",\n \"merchant_operation_number\": \"239766\",\n \"transaction_id\": null,\n \"refund_amount\": \"1050\",\n \"additional_fields\": {\n \"canal\": \"WEB\",\n \"reason\": \"cliente no reconocio el consumo\",\n \"description\": \"solicitud por desconocimiento\"\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.preprod.alignet.io/refund")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["ALG-API-VERSION"] = '<alg-api-version>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"merchant_code\": \"41bb301e-3c37-4332-accb-ed5ec19081e4\",\n \"operations\": [\n {\n \"type\": \"TOTAL\",\n \"merchant_operation_number\": \"239766\",\n \"transaction_id\": null,\n \"refund_amount\": \"1050\",\n \"additional_fields\": {\n \"canal\": \"WEB\",\n \"reason\": \"cliente no reconocio el consumo\",\n \"description\": \"solicitud por desconocimiento\"\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": "true",
"action": "refund",
"merchant_code": "41bb301e-3c37-4332-accb-ed5ec19081e4",
"operations": [
{
"refund_id": "922178aa-ce4c-4c5f-8190-82fa7e009425",
"state": "REGISTERED",
"refund_reason": "Solicitud recibida y validada",
"type": "TOTAL",
"merchant_operation_number": "239766",
"transaction_id": "bko66gpi8czns4tcde93q96vd",
"refund_amount": "1050",
"transaction_amount": "1050",
"currency": "604",
"payment_method": {
"name": "CARD",
"brand": "VISA",
"masked_pan": "447411******2240"
},
"additional_fields": {
"canal": "WEB",
"reason": "cliente no reconocio el consumo",
"description": "solicitud por desconocimiento"
},
"lifecycle": [
{
"state": "REGISTERED",
"date": {
"utc_time": "2025-05-26T06:06:45",
"unix_time": 1748239605
}
}
]
}
],
"meta": {
"status": {
"code": "00",
"message_ilgn": [
{
"locale": "es_PE",
"value": "Se proceso correctamente la peticion"
}
]
}
}
}Headers
Token Bearer obtenido desde autenticacion.
Version del API a usar.
Identificador del Facilitador de Pago.
Body
application/json
Response
Solicitud de devolucion registrada correctamente.
⌘I

