How it works
Set up an HTTPS notification URL so your application receives relevant changes in the operation. The webhook should feed the internal state of the corresponding order, charge or process.
Recommended flow
A transaction or relevant event progresses in processing.
The application receives the payload at the configured HTTPS endpoint.
Store identifiers and enough content for traceability.
Order, ERP, OMS, finance and automations follow the new state.
Notification structure
Transactional events provide the transaction identifier, event type, status, operation reference, seller and notification signature.
{
"id": "8774b47d26d54a0b9138cde9d8cc421f",
"type": "transaction.succeeded",
"status": "succeeded",
"reference_id": "order_102938",
"io_seller_id": "<IO_SELLER_ID>",
"sign_confirm": "iopay::<SIGNATURE>"
}transaction.created, transaction.pending, transaction.succeeded, transaction.failed, transaction.disputed and transaction.void.succeeded.Implementation
Route::post('/webhooks/iopay', function (Request $request) {
$payload = $request->all();
// Identificador da transação
$transactionId = $payload['id'] ?? null;
// Ex.: transaction.succeeded
$eventType = $payload['type'] ?? null;
// Ex.: succeeded
$status = $payload['status'] ?? null;
// Referência enviada na criação da transação
$referenceId = $payload['reference_id'] ?? null;
// 1. valide sign_confirm conforme o contrato vigente
// 2. garanta idempotência antes de aplicar efeitos
// 3. persista o evento para rastreabilidade
// 4. processe operações pesadas de forma assíncrona
ProcessIopayWebhook::dispatch($payload);
return response()->json(['received' => true], 200);
});sign_confirm must follow the integration's current contract before the event is considered trustworthy.Idempotency and robustness
Don't process twice.
Webhooks can be resent. Make sure the same event doesn't produce duplicate effects in your application.
Quick acknowledgment.
Avoid long operations before returning HTTP 200 to the webhook.
Validate the current state.
Don't rely only on arrival order; compare the event with the known state.
Keep history.
Record receipt, processing, errors and correlation with order/transaction.
Checklist
- HTTPS URL configured and externally reachable.
- Low timeout and heavy processing in a queue.
- Validation of
sign_confirm. - Idempotency to avoid duplicate effects.
- Logs with
id,type,reference_idandio_seller_id. - Alerts for repeated processing failures.
- Reconciliation routine via API queries for exceptional cases.

