Webhook

POST structure for digital payments.

You can create webhook subscriptions to receive events whenever a new log is created. We send the event by making a POST request to your endpoint URL. The event sent to the endpoint URL has the structure shown below.

Note: It is necessary to inform your Webhook URL so that the API can notify your system about important events, such as the confirmation of a transaction or the update of an order status.

- The Webhook URL must be a valid and active URL that can receive HTTP POST requests.

By informing your Webhook URL to the support team, you will enable the receipt of important notifications directly into your system, allowing you to monitor and respond to events more efficiently. It is important to be aware of the mentioned points to ensure that your Webhook URL is valid, secure, and configured correctly.

Array
(
    [installment_capture] => 03
    [holder_name] => Joh Due
    [payment_date] => 11/05/2023 11:44:16pm
    [status] => succeeded
    [invoice_status] => succeeded
    [event_id] => 2536
    [invoice_type] => multi_option
    [currency] => BRL
    [enter_amount] => 210250
    [secret_token] => ......508d951a......0a3ea5......
    [link_token] => 95ad6c996bfd44466f1059fd9a1825d5
    [option_capture] => credit_card
    [url_return] => 'https://google.com'
    [metadata] => COD:30459074314d8ba
    [client_ip] => 177.52.30.117
    [pix_uuid] => 74dc323e972343109082f9a03975fc05
)

Main Parameters

The STATUS parameter is applied to payments made through Pix or Credit Card services. It is important to note that the OPTION_CAPTURE parameter is responsible for identifying which service method was chosen by the user.

When integrating financial services, it is essential to understand the importance of these parameters and how they can impact transaction processing. Furthermore, it is crucial to emphasize that proper understanding and application of the returns from the OPTION_CAPTURE parameter ensure efficient and secure financial management.

These pieces of information can be used to monitor and analyze customer behavior and payment preferences.

status

Returns the behavior of the payment link.

option_capture

pix_payment = the user chose to pay via Pix.

credit_card = the user chose to pay via credit card.

currency

Currency processed.

metadata

parameter customized by you, sometimes an identifier

that you assign for internal identification.

installment_capture

number of installments chosen by your customer.

pix_uuid

generated pix id

Example

You should create security handling by confirming your SECRET TOKEN, which only you should know.

Below we have created an example using the PHP language:

<?php 

$data = $_POST;
$token_key  =   $data['token_key']; 

if($token_key == 'b9526feaf.....ff7eec86'){
   // Implement the logic in this body.
} else {
    file_put_contents('webhook_log.txt', 'ERROR!');
}