Getting Started

A guide to learn how to create and confirm Verifications from start to finish.

Devengo Account Verification API allows you to confirm access to a specified bank account by sending a micropayment with a secret code. This guide will teach you how to create and confirm Verifications from start to finish.

Please note that this is an asynchronous process and the microtransaction will be sent in a few seconds as a background task. If you need to have detailed control over the process you should create a webhook to receive our callbacks.

Create a Sandbox Account

The first step, unless you are already using other Devengo products, is to create a Sandbox Account. The Sandbox Account allows you to test the functions without using real bank accounts or transactions. To create a Sandbox Account, follow these steps:

  1. Create your account by filling out this form.
  2. You will receive a confirmation email. Once confirmed, you will have full access to the Devengo API.

Create a session token

To interact with the Devengo API, you need to generate a session token. This token authenticates your requests and provides access to the API. To create a new session token, you will have to provide the email and password used in the signup form.

curl -X POST 'https://api.sandbox.devengo.com/v1/auth/tokens' \
-H 'Content-Type: application/json' \
-d '{"email": "[email protected]", "password": "your_password"}'
{
   "token": "eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX25kIjoibWFuXzRuakRLSTNFQmJjYWtyQXEyMENCSVohLCJ1c2VyX3R5cG6iOiJNYW5hZ2VyIiwiY29xcGFueV9pZCI6bnVsbCwiZXhwIjoiMTY4NjA1MHA0MiJ9.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
   "refresh_token": "eyJhbGciOiJIvzI1NiJ9.eyJ1c2VyX2lkIjoibWFuXzRuakRLSTNFQmJjYWtyQXEyMENCSVHiLCJ1c2VyX3R5cGUiOiJNYW5hZ2VyIiwiY29tcGFueV9pZCI6bnVsbCwicmVmcmVzaF90b2tlbl9pZCI6InRva18yNUg4ajZHMEFiUUp4VkZHdDJkTWxqIiwiZXhwIjoiMTY4NzI5ODg0MiJ9.IcTS5-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}

Create the first Verification

Once you have a session token, you can start creating Verifications. In this example, Devengo will send a micropayment to the specified John Doe bank account with a secret code.

curl -X POST https://api.sandbox.devengo.com/v1/verifications \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer THE_SESSION_TOKEN' \
-d '{
   "destination": { "iban": "ES7667130002000000000223" },
   "recipient": "John Doe"
}'
{
  "verification": {
    "id": "vrf_2KX8KGkSUMr37APZsRb2l2",
    "third_party": {
      "name": "John Doe",
      "account": {
        "identifiers": [
          {
            "type": "iban",
            "iban": "ES7667130002000000000223"
          }
        ],
        "bank": {
          "name": "Prepaid Financial Services Limited, S.E",
          "bic": "PFSSESM1XXX"
        }
      }
    },
    "status": "created",
    "company_reference": null,
    "metadata": {},
    "expired_at": "2023-06-28T09:14:05Z",
    "created_at": "2023-06-21T09:14:05Z",
    "eta": "2023-06-21T09:14:15Z",
    "attempts": 0,
    "error": null
  }
}

At this point, the recipient receives the transaction in their account with a description including the secret code they should provide. This code is a 6-digit random number, for example, 950145.

Confirm a Verification

Once the recipient provides you with the received secret code, you can make a confirmation attempt.

Note: Please note that in the Sandbox Account, all Verifications can be confirmed using the code "000000" for testing purposes.

curl -X POST https://api.sandbox.devengo.com/v1/verifications/vrf_4wr2ZKhRa2E6nehBUlpgZo/confirm \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer THE_SESSION_TOKEN' \
--data '{
   "code": "000000"
}'

If the provided code is valid, the response will be a 200 OK and the Verification status will be changed to confirmed.

Next steps