Charges
POST/business/v0/cobros
Create a charge
Try it live ↓Creates the charge the checkout QR will show. If the checkout already has a pending charge, returns CONFLICTO_ESTADO: cancel it or let it expire. Retrying with the same Idempotency-Key returns the same charge (200 with header Idempotent-Replayed: true).
Endpoint URL#
POST https://sandbox.finanxis.net/business/v0/cobrosHeaders#
| Name | Required | Description |
|---|---|---|
| Content-Type | Yes | application/json |
| X-Finanxis-Key | Yes | Your public key (pk_live_… or pk_test_…). |
| X-Finanxis-Timestamp | Yes | Current time in Unix seconds (UTC). ±5 minute window. |
| X-Finanxis-Signature | Yes | hex(HMAC_SHA256(secret, "${timestamp}.${METHOD}.${path_with_query}.${body}")). The body is the exact one you send (empty on GET). The code samples already compute it. |
| Idempotency-Key | Yes | Unique per operation. Retrying with the same key does not duplicate.. Up to 100 characters |
Request body#
{
"caja_id": "caja_8x2k1m",
"monto": 21000.5,
"moneda": "VES",
"referencia_externa": "TICKET-55821",
"expira_en_segundos": 180
}| Name | Type | Required | Description |
|---|---|---|---|
| caja_id | string | Yes | 1–64 characters |
| monto | number | Yes | Greater than 0, up to 1000000000 |
| moneda | string | Yes | Format: ^[A-Z]{3,10}$ |
| referencia_externa | string | No | Up to 100 characters |
| descripcion | string | No | Up to 140 characters |
| expira_en_segundos | integer | No | Between 60 and 900. Default 180 |
| metadata | object | No | — |
Fields not listed above are rejected with VALIDACION.
Examples#
KEY="pk_test_..."; SECRET="sk_test_..."
RUTA="/business/v0/cobros"; TS=$(date +%s)
BODY='{"caja_id":"caja_8x2k1m","monto":21000.5,"moneda":"VES","referencia_externa":"TICKET-55821","expira_en_segundos":180}'
FIRMA=$(printf '%s' "$TS.POST.$RUTA.$BODY" | openssl dgst -sha256 -hmac "$SECRET" -hex | awk '{print $NF}')
curl -X POST "https://sandbox.finanxis.net$RUTA" \
-H "X-Finanxis-Key: $KEY" \
-H "X-Finanxis-Timestamp: $TS" \
-H "X-Finanxis-Signature: $FIRMA" \
-H "Idempotency-Key: TICKET-55821" \
-H "Content-Type: application/json" \
--data "$BODY"Response codes#
| Code | Meaning |
|---|---|
| 201 | Success |
| 500 | Error. Check `data.error.code` and `data.error.como_resolver`. |
| 4xx | Error. Check `data.error.code` and `data.error.como_resolver`. |
Every response has the shape { success, message, data }.
Response#
{
"success": true,
"message": "Cobro creado.",
"data": {
"id": "cob_7d2c9a",
"estado": "PENDIENTE",
"caja_id": "caja_8x2k1m",
"monto": 21000.5,
"moneda": "VES",
"referencia_externa": "TICKET-55821",
"descripcion": "Compra en farmacia",
"qr_url": "https://pay.finanxis.net/c/Qm9…",
"expira_en": "2026-10-10T14:23:45Z",
"pagado_en": null,
"cancelado_en": null,
"metadata": {
"pedido": "A-1029"
},
"creado_en": "2026-10-10T14:20:45Z"
}
}Errors#
Every error carries data.error.code, what happened and how to fix it.
| HTTP | code | How to fix it |
|---|---|---|
| 500 | ERROR_INTERNO | Ocurrió un error interno.Reintenta con la misma Idempotency-Key. Si persiste, contáctanos indicando el request_id. |
| 400 | VALIDACION | Hay campos inválidos.Revisa data.error.campos: cada elemento dice qué campo falló, por qué y un ejemplo válido. |
| 400 | IDEMPOTENCY_KEY_FALTANTE | Falta el header Idempotency-Key.Envía Idempotency-Key con un valor único por operación (ej. el número de ticket o un UUID). Si reintentas, usa el mismo valor y no se duplicará. |
| 409 | IDEMPOTENCY_CONFLICTO | Esa Idempotency-Key ya se usó con datos distintos.Usa una Idempotency-Key nueva para una operación nueva. Repite la misma solo para reintentar exactamente la misma petición. |
| 404 | NO_ENCONTRADO | El recurso no existe o no pertenece a tu comercio.Verifica el id. Solo puedes acceder a recursos de tu propio comercio. |
| 409 | CONFLICTO_ESTADO | La operación no es posible en el estado actual del recurso.Consulta el recurso para ver su estado actual antes de reintentar. |
| 401 | AUTH_HEADERS_FALTANTES | Faltan headers de autenticación.Envía X-Finanxis-Key, X-Finanxis-Timestamp y X-Finanxis-Signature en cada petición. |
| 401 | AUTH_FIRMA_INVALIDA | La firma no coincide.Firma HMAC-SHA256 en hex, con tu secreto, sobre: ${timestamp}.${METODO}.${ruta_con_query}.${body_exacto}. Usa el body exactamente como lo envías (mismo orden y espacios) y body vacío en GET. |
| 401 | AUTH_TIMESTAMP_INVALIDO | El timestamp no es válido o está fuera de la ventana permitida.X-Finanxis-Timestamp debe ser la hora actual en segundos Unix (UTC). Se aceptan ±5 minutos: sincroniza el reloj de tu servidor (NTP). |
| 401 | AUTH_LLAVE_REVOCADA | La llave fue revocada.Crea una llave nueva en business.finanxis.net → Llaves de API y actualiza tu integración. |