In this topic we will describe how to check cases where the order appears as paid in the gateway, but was canceled in VTEX. To analyze what happened in each specific case, you need to check the transaction logs for the order in question. To do so, simply go to the “Transactions” page and click on the desired transaction.
Note that the transaction number for a specific order is the same as the order’s sequential number, i.e., the number right next to the order number:
By checking the transaction logs, you can find the Transaction Authorization Rules,
“Authorization Rules”:
They define:
- the number of attempts to authorize the transaction in the
MaxEnqueuesfield; - the time until the first attempt in the
FirstReTryAttemptInSecondsfield; - the minimum time between attempts in the
MinimumScaleInMinutesfield; - the maximum time between attempts in the
MaximumScaleInMinutesfield.
Therefore, after all the attempts defined in the MaxEnqueues field have been made, the order cancellation flow is triggered:
It is worth noting that the number of attempts is calculated based on the value sent by the payment gateway in the delayToCancel field in the transaction request response, as described in the Create Payment documentation. This means this field cannot be changed by the merchant or directly on the VTEX platform — it must be adjusted by the payment connector if needed.
The value sent in the field is divided by 86,400 (seconds in a day). If the result is greater than 0, it means the delayToCancel is longer than one day. In that case, the number of retries will be 6 attempts per day.
If the result of the division equals 0, it means the delayToCancel is set to a time less than or equal to 1 day, so in this case, 1 retry will be made per hour.
In other words, if the delayToCancel field is greater than 24 hours (86,400 seconds), 6 attempts will be made per day. If it is less, one attempt will be made per hour.
If this field is sent as null, 336 attempts will be made to approve that type of payment.
Timeout cases:
In addition to cancellation due to payment not being approved within the stipulated number of attempts, in some cases orders with boleto (bank slip) as the payment method may have the cancellation flow triggered after a timeout. This error occurs when the connector does not respond to the transaction authorization request within 20 seconds, as specified in our Payment Provider Protocol. In these cases, the following error will appear in the transaction logs: Message = Timeout by cancellation token:
Recommendations:
Unfortunately, in these scenarios it is not possible to “uncancel” these orders. Here are some recommendations:
- Check with the partner what may have happened, since VTEX is 100% passive when it comes to the payment flow — we only receive the notification from the partner and update the transaction status accordingly.
- To avoid further losses, one alternative is to generate a gift card for the end customer in the amount of the order and ask them to place the order again. There are ways to make this process simpler and less friction-heavy for the end customer, by using the shareable cart feature. Here is a link to our documentation on that solution: Shareable Cart
Possible questions:
Is it possible to change the status of a canceled order to resume the transaction?
A.: Unfortunately not — once the cancellation flow for a transaction has been triggered, there is no way to “uncancel” it.
Is it possible to change the number of approval attempts for an order?
A.: Connectors can do this via the delayToCancel field, which must be sent in the transaction request response, as described in the following documentation: Create Payment
Karina Mota
Field Software Engineer | VTEX





