Skip to main content

Validate card in wallet

Introduction

This article explains how to validate card in wallet through the REST API.

How to use?

Make a POST request to the /wallet/transactions/pre-approved endpoint.

With a valid access token, make a request to the (POST/wallet/transactions/pre-approved) endpoint, sending the following parameters:

{
"identity": {
"key": "cpf",
"value": "HOLDERS_CPF"
},
"company": "COMPANY_ID",
"redirectUrl": "URL",
"card": {
"binDigits": "FIRST_6_OR_8_DIGITS_CARD",
"lastDigits": "LAST_4_DIGITS_CARD",
"expirationDate": "EXPIRATION_DATE_CARD",
"name": "HOLDERS_NAME"
}
}
NOTE

The identity.value field must belong to the credit card owner. The company é field is provided by Unico. The redirectUrl field is used to redirect the person to the desired url address. The redirection is done at the end of the flow (webview). This field is optional. The expirationDate field is also optional.

The other fields are mandatory.

If everything is right in the request, the response is a JSON with the transaction ID, transaction status and the capture link, as follows:

{
"id": "6ab1771e-dfab-4e47-8316-2452268e5481",
"status": "waiting",
"link": "https://aces.so/teste"
}

If the pre-approval decides that it is not necessary to capture the biometrics, the response will have a different status and a link for the capture will not be generated, as follows:

{
"id": "6ab1771e-dfab-4e47-8316-2452268e5481",
"status": "fast-inconclusive"
}

If an error occurs, the response is a JSON with the error and the error code:

{
"error": {
"code": "40004",
"description": "transaction id is invalid"
}
}

The following is a list of possible errors returned by the service:

HTTP CodeCodeDescriptionReason
40040001error decoding jsonThe data sent does not match the service contract
40040002error validating jsonSome of the information is badly formatted or not filled in
40040024invalid nameThe name is filled with invalid characters or is not a valid name
40340301not allowedThe user does not have permission to perform such an action.
40440404company not foundThe company does not exist
42940001too many requestsRatelimit reached
50050001internal errorInternal service failure

Any concerns?

Missing something or still need help? If you are already a customer or partner, you can contact us through the Help Center.