using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Text.Json;
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue("Bearer", "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...");
client.DefaultRequestHeaders.Add("api-key", "550e8400-e29b-41d4-a716-446655440000");
var body = new StringContent(
JsonSerializer.Serialize(new { invoice_id = "2025407608" }),
Encoding.UTF8, "application/json"
);
var response = await client.PostAsync(
"https://TU-DOMINIO/corresponsales/api/factura/consulta/", body
);
var json = await response.Content.ReadAsStringAsync();
var body = new StringContent(
JsonSerializer.Serialize(new { request_id = "f7002954-8ec2-4248-9c8e-6625a2588117" }),
Encoding.UTF8, "application/json"
);
var response = await client.PostAsync(
"https://TU-DOMINIO/corresponsales/api/factura/pago/", body
);
var json = await response.Content.ReadAsStringAsync();
El request_id devuelto por la consulta de factura previa. Debe corresponder al mismo usuario autenticado.
El sistema valida internamente que: (1) el request_id corresponde a una transacción exitosa del mismo usuario API, (2) la factura tiene Usable: true. Si alguna condición falla, retorna 400.
var body = new StringContent(
JsonSerializer.Serialize(new { /* parámetros definidos por el SP configurado */ }),
Encoding.UTF8, "application/json"
);
var response = await client.PostAsync(
"https://TU-DOMINIO/corresponsales/api/factura/pago/reversar/", body
);
var json = await response.Content.ReadAsStringAsync();
El body de este endpoint no tiene un esquema fijo en la capa API. Los campos requeridos los determina el stored procedure configurado para tu empresa. Consulta a tu equipo de operaciones.
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Text.Json;
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue("Bearer", "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...");
client.DefaultRequestHeaders.Add("api-key", "550e8400-e29b-41d4-a716-446655440000");
var body = new StringContent(
JsonSerializer.Serialize(new { invoice_id = "2025407608" }),
Encoding.UTF8, "application/json"
);
var response = await client.PostAsync(
"https://YOUR-DOMAIN/corresponsales/api/factura/consulta/", body
);
var json = await response.Content.ReadAsStringAsync();
var body = new StringContent(
JsonSerializer.Serialize(new { request_id = "f7002954-8ec2-4248-9c8e-6625a2588117" }),
Encoding.UTF8, "application/json"
);
var response = await client.PostAsync(
"https://YOUR-DOMAIN/corresponsales/api/factura/pago/", body
);
var json = await response.Content.ReadAsStringAsync();
The request_id returned by the prior invoice query. Must belong to the same authenticated user.
The system internally validates that: (1) the request_id matches a successful transaction from the same API user, (2) the invoice has Usable: true. If either condition fails, returns 400.
Settlement data returned by the configured SP. Exact fields depend on implementation.
llave_recibo
TLOG key of the generated cash receipt. Save it for potential reversals.
3. Payment reversal
Cancels a previously notified payment. The body parameters are defined by the stored procedure configured for this endpoint.
Property
Value
Method
POST
Path
/corresponsales/api/factura/pago/reversar/
Authentication
JWT Bearer + api-key
Request
POST /corresponsales/api/factura/pago/reversar/
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
api-key: 550e8400-e29b-41d4-a716-446655440000
Content-Type: application/json
{
... // parameters defined by the configured SP
}
var body = new StringContent(
JsonSerializer.Serialize(new { /* parameters defined by the configured SP */ }),
Encoding.UTF8, "application/json"
);
var response = await client.PostAsync(
"https://YOUR-DOMAIN/corresponsales/api/factura/pago/reversar/", body
);
var json = await response.Content.ReadAsStringAsync();
This endpoint has no fixed body schema at the API layer. Required fields are determined by the stored procedure configured for your company. Contact your operations team.