# Transactions external validation
This feature allows you to validate or refuse end users payments, in real-time and based on your own criteria.
Information – Treezor offers its own Transaction Rules Engine
Therefore, you no longer need to implement your criteria with the external validation.
Contact your Treezor Account Manager to find out which option works best for you.
# General process
The external validation process works as follows.
- Authorization Request – The end user makes a purchase with a Card.
- External Validation Request – Treezor sends you an HTTP Request to a predefined endpoint of your own REST API.
- External Validation Response – Your software makes a decision based on your own criteria and returns the decision in the HTTP Response.
- If you refuse, the transaction is declined.
- If you fail to answer within the allowed timeframe, the transaction is declined.
- If you accept, Treezor handles the Authorization request like it would normally (Authorized Balance verifications, MID/MCC restrictions, etc.).
- A
cardtransaction.create
webhook is sent. It includes therequestId
of the External Validation request.
Information – Your response must be provided within an allotted timeframe
The timeframe is defined on a per-client basis. In the absence of a response in the allotted time, the Authorization is automatically declined.
# Request example
A POST request is sent to your own API endpoint, as defined during the subscription to this feature.
# Response example
All requests must be answered to.
# If you approve the transaction
You can answer with the following JSON response
# If you refuse the transaction
You can answer with the following JSON response
# Responses Codes (responseCode
)
You can anwser to an External Validation request with the following codes:
Code | |
---|---|
AUTHORIZED | |
DECLINED | |
DECLINED_INSUFFICIENT_FUNDS | |
DECLINED_LOCAL_CURRENCY_INVALID | |
DECLINED_DATETIME_INVALID | |
DECLINED_CARD_UNKNOW | |
DECLINED_MCC_INVALID | |
DECLINED_MERCHANTID_INVALID | |
DECLINED_MERCHANT_CITY_INVALID | |
DECLINED_MERCHANT_COUNTRY_INVALID |
Information – Other responses may occur
Any other response will be considered as DECLINED
.
# Special case of Balances not managed by Treezor
In the use case where you manage the Balance and Authorized Balance yourself:
- No funds withholding will take place, as Treezor doesn't manage the funds
- At settlement, the funds will be debted or credited on your main Wallet (which should be provisioned accordingly).