B2B Import ERP exposes a single inbound webhook endpoint to receive payment lifecycle events from the Wompi payment gateway. When Wompi processes a transaction it fires an HTTP notification to this URL; the handler validates the payload, delegates processing toDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/ency07/B2B-import/llms.txt
Use this file to discover all available pages before exploring further.
processWompiWebhook(), and returns a structured acknowledgement. The endpoint is stateless and idempotent — re-delivering the same event will attempt to update the same transaction record.
Configure this URL in the Wompi merchant dashboard → Configuración → Webhooks. The full URL is
https://<your-domain>/api/webhooks/wompi.Endpoint Overview
POST /api/webhooks/wompi
Receives payment event notifications from Wompi. Processes the event and updates the corresponding invoice and transaction records.
GET /api/webhooks/wompi
Verification probe used by Wompi to confirm the endpoint is reachable. Returns a simple status object.
GET — Verification Probe
Wompi may issue aGET request to verify that the endpoint is live before registering it in the dashboard.
Response 200 OK:
POST — Payment Event
Request Format
Wompi sends a JSON body with the following structure. Theevent field identifies the event type and data contains the transaction details directly.
| Field | Type | Description |
|---|---|---|
event | string | Event type. Currently transaction.updated is the primary event. |
data | object | Event payload container. |
data.id | string | Wompi’s unique transaction identifier. |
data.reference_id | string | The reference string set when creating the checkout — matches payment_transactions.reference_id. Falls back to data.id if absent. |
data.status | string | APPROVED, DECLINED, VOIDED, or ERROR. |
data.amount_in_cents | number | Amount in centavos COP (divide by 100 for COP). |
data.currency | string | Always "COP" for Colombian Peso. |
data.customer_email | string | Payer email (optional). |
data.payment_method_type | string | Payment method, e.g. "CARD" or "PSE" (optional). |
Validation
The handler performs a structural check before any processing:event or data is absent, the request is rejected immediately with HTTP 400.
Processing Flow
Response Codes
| Status | Body | Meaning |
|---|---|---|
200 | { "received": true, "success": true, "status": "APPROVED" } | Event processed successfully. |
400 | { "error": "Payload inválido: falta 'event' o 'data'" } | Request body missing required fields. |
500 | { "error": "<message>" } | Unexpected server-side error during processing. |
Handler Source
The handler is located atsrc/app/api/webhooks/wompi/route.ts:
Error Handling
Any uncaught exception insideprocessWompiWebhook propagates to the catch block, which extracts the message and returns HTTP 500. This prevents Wompi from receiving an unstructured error response, which would cause it to retry the delivery.