Realtime Webhooks 2.0

In this page you'll find all the information you need to set up a webhook.

Our API sends real-time notifications (webhooks) when the status of a transaction changes.

There's a table below that will help you understand the params we send to your URL.

🚧

Important:

• The webhook always waits for an HTTP 200 response to consider the communication successful.
• If the communication fails, the retry policy is as follows:
• Every 5 minutes, up to 3 attempts.
• If still unsuccessful, retries occur hourly for 24 hours.

ParamsDescription
endpointURL where the notification should be sent.
methodHTTP method used for the request (POST).
statusDefines which transaction statuses are communicated. Possible values:
PAID,
REFUND,
ERROR,
CANCEL,
EXPIRED.
encryptDetermines whether the request body should be encrypted (true/false).

Here's an endpoint example (Prestashop) below:

https://nome-da-loja.com/modules/eupagogateway/callback/callback.php

List of Callback:
https://customer.support.eupago.com/servicedesk/customer/portal/5/article/1061289985

Data Format:

For POST requests: data is sent in the JSON request body.

ParamsTypeDescription
transactionsObjectContains transaction information.
channelObjectContains information about the channel associated with the transaction.
dataStringContains encrypted information (when encrypt=true).

Note: When encrypt=true, the data field contains encrypted text, which when decrypted returns the full JSON structure of the transaction and channel.


Transaction Object Structure (transactions)

ParamsTypeDescription
entityIntegerTransaction entity.
referenceIntegerTransaction reference number.
identifierStringIdentifier assigned by the integrator when creating the transaction.
methodStringPayment method:
Multibanco
Mbway
CreditCard
Pix
GooglePay
ApplePay
amountObjectObject containing the transaction amount and currency.
feesObjectObject containing the fees amount and currency.
dateDatetimeTransaction date and time (UTC).
tridIntegerTransaction ID.
statusStringTransaction status:
Paid
Refund
Error
Cancel
Expired

Channel Object Structure (channel)

ParamsTypeDescription
nameStringName of the channel associated with the transaction.

Decryption (AES-256-CBC)

When encryption is enabled:
• The request body is encrypted using AES-256-CBC (symmetric encryption).
• To decrypt, you need:
1. Base64-encoded text in the data field.
2. Initialization Vector (IV) sent in the request headers as X-Initialization-Vector.
3. The previously generated encryption key.

Example PHP code for decryption is available in EuPago documentation.

function decrypt($encryptedData, $key, $iv) { $cipher = "aes-256-cbc"; $options = OPENSSL_RAW_DATA; $decryptedData = openssl_decrypt(base64_decode($encryptedData), $cipher, $key, $options, base64_decode($iv)); return $decryptedData; }

Authenticity and Integrity
• The request headers include X-Signature with an HMAC SHA-256 signature.
• This ensures that the data has not been tampered with during transmission.

function verifySignature($data, $signature, $key) { $generatedSignature = hash_hmac('sha256', $data, $key,true); return hash_equals($generatedSignature, base64_decode($signature)); }

Check our guide in case you need help around our backoffice.

Should you need more support on this configuration let us know by sending an email ([email protected]) or fill this support form.