Your Payment In 60 Seconds

All you need to know to get rolling fast & easily with Devengo's payments API.

In this guide you will find everything you need to get started with the Devengo payment API, and get a precise idea of how you can integrate our API into your system. To do this, we'll will create an account in the Sandbox environment and make a payment.

Create a Sandbox Account

If you aren't already using Devengo, the first step is to create a Sandbox Account. Since it comes with a couple of bank accounts (one in EUR and one in GBP) with non-real money in them, it will allow you to test the functions without using real bank accounts, transactions or money, as these accounts are included.

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.

Authentication

Now that you have a Sandbox account, you're ready to make your first payment. Keep in mind that 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": "anadevengo"}'
{
  "token": "eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoibWFuXyIsInVzZXJfdHlwZSI6Ik1hbmFnZXIiLCJjb21wYW55X2lkIjpudWxsLCJleHAiOjE3MTMzNTQzMzZ9.STk1HvOZHGke3b5hCmsOxCJc_StH-hBm3O-NmfFqI34",
  "refresh_token": "eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoibWFuXyIsInVzZXJfdHlwZSI6Ik1hbmFnZXIiLCJjb21wYW55X2lkIjpudWxsLCJyZWZyZXNoX3Rva2VuX2lkIjoidG9rXzJGYnhLUmZ3d1dWWGdPMGhONnBCTkoiLCJleHAiOiIxNzE0NTYyMTM2In0.QfdKtN6vvnZM5wxtN7lj2zvjQuEwuqxw3p4suAsZXLs"
}

Create the payment

Now you're ready to make your first payment with Devengo. In addition to the amount, the name of the beneficiary and a description, to make your payment you need to obtain a few pieces of data:

  • The ID of the Devengo bank account from which you want to make the payment.
  • The IBAN of the destination account

As you may have seen, your Sandbox account comes with two bank accounts created by default with -false- money in them. Let’s retrieve their details through the API:

curl -X GET https://api.sandbox.devengo.com/v1/accounts \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer THE_SESSION_TOKEN'
{
    "meta": {
        "pagination": {
            "total_items": 2
        }
    },
    "links": {
        "self": "https://api.sandbox.devengo.com/v1/accounts?page=1&page_size=2",
        "first": "https://api.sandbox.devengo.com/v1/accounts?page=1&page_size=2",
        "last": "https://api.sandbox.devengo.com/v1/accounts?page=1&page_size=2"
    },
    "accounts": [
        {
            "id": "acc_6DIeCPQYXjVTKya3zPBjjP",
            "status": "active",
            "created_at": "2023-08-08T06:34:32Z",
            "name": "Devengo GBP Sandbox Account",
            "bank": {
                "name": "MODULR FS LIMITED",
                "bic": "MODRIE22XXX"
            },
            "identifiers": [
                {
                    "type": "iban",
                    "iban": "GB68MODR04039200010251"
                },
                {
                    "type": "ukscan",
                    "sort_code": "040392",
                    "account_number": "00010251"
                }
            ],
            "currency": "GBP",
            "balance": {
                "total": {
                    "cents": 15000000,
                    "currency": "GBP"
                },
                "available": {
                    "cents": 15000000,
                    "currency": "GBP"
                }
            },
            "metadata": {},
            "closed_at": null
        },
        {
            "id": "acc_1p39Zb0i8ece8lzzKNe3p0",
            "status": "active",
            "created_at": "2023-08-08T06:34:32Z",
            "name": "Devengo EUR Sandbox Account",
            "bank": {
                "name": "Prepaid Financial Services Limited, S.E",
                "bic": "PFSSESM1XXX"
            },
            "identifiers": [
                {
                    "type": "iban",
                    "iban": "ES2767130002000000738402"
                }
            ],
            "currency": "EUR",
            "balance": {
                "total": {
                    "cents": 15000000,
                    "currency": "EUR"
                },
                "available": {
                    "cents": 15000000,
                    "currency": "EUR"
                }
            },
            "metadata": {},
            "closed_at": null
        }
    ]
}

For this example we are going to use the Euro account, so the ID you need is the one for that account (in the example above acc_1p39Zb0i8ece8lzzKNe3p0).

As far as the destination account is concerned, it should be noted that by default, all payments created in sandbox will be confirmed as if the money transfer has been successful. So let’s use the IBAN ES3930350000020000000001 (or any IBAN you want, as long as it is not one of the IBANs we have defined to generate specific errors).

And now we are ready to make our first payment. Here we go!

curl -X POST https://api.sandbox.devengo.com/v1/payments \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer THE_SESSION_TOKEN' \
--data '{
   "account_id": "acc_1p39Zb0i8ece8lzzKNe3p0",
    "company_reference": "My first payment",
    "amount": {
        "cents": 100,
        "currency": "EUR"
    },
    "destination": {
        "iban": "ES3930350000020000000001"
    },
    "recipient": "John Doe",
    "description": "This is a test"
}'
{
    "payment": {
        "id": "pyo_75FwjQtd8jEBMvLq8ETbLf",
        "status": "created",
        "recipient": "John Doe",
        "company_reference": "My first payment",
        "description": "This is a test",
        "amount": {
            "cents": 100,
            "currency": "EUR"
        },
        "destination": {
            "iban": "IE62MODR99035502395193"
        },
        "account_id": "acc_1p39Zb0i8ece8lzzKNe3p0",
        "instant": true,
        "eta": "2023-08-08T07:00:34Z",
        "created_at": "2023-08-08T07:00:24Z",
        "processor": {
            "network": "SEPA",
            "scheme": "SCT-INST"
        },
        "error": null,
        "links": null,
        "third_party": {
            "name": "John Doe",
            "account": {
                "identifiers": [
                    {
                        "type": "iban",
                        "iban": "IE62MODR99035502395193"
                    }
                ],
                "bank": {
                    "name": "Modulr Finance BV",
                    "bic": "MODRIE22XXX"
                }
            }
        },
        "metadata": {},
        "internal": false
    }
}

The API has synchronously returned a 200 OK message and the payment has gone to created status. Please note that this does not mean that the order has actually been executed and the recipient has received the money, but that our system has received the payment order correctly and is ready to execute it. If you want to learn more about the lifecycle of a payment check out this other guide.
You can check the current status of the payment using its ID.

curl -X GET https://api.sandbox.devengo.com/v1/payments/pyo_75FwjQtd8jEBMvLq8ETbLf \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer THE_SESSION_TOKEN'
{
    "payment": {
        "id": "pyo_75FwjQtd8jEBMvLq8ETbLf",
        "status": "confirmed",
        "recipient": "John Doe",
        "company_reference": "My first payment",
        "description": "This is a test",
        "amount": {
            "cents": 100,
            "currency": "EUR"
        },
        "destination": {
            "iban": "IE62MODR99035502395193"
        },
        "account_id": "acc_1p39Zb0i8ece8lzzKNe3p0",
        "instant": true,
        "eta": "2023-08-08T07:00:34Z",
        "created_at": "2023-08-08T07:00:24Z",
        "processor": {
            "network": "SEPA",
            "scheme": "SCT-INST"
        },
        "error": null,
        "links": {
            "receipt": "https://api.sandbox.devengo.com/v1/payments/pyo_75FwjQtd8jEBMvLq8ETbLf/receipt"
        },
        "third_party": {
            "name": "John Doe",
            "account": {
                "identifiers": [
                    {
                        "type": "iban",
                        "iban": "IE62MODR99035502395193"
                    }
                ],
                "bank": {
                    "name": "Modulr Finance BV",
                    "bic": "MODRIE22XXX"
                }
            }
        },
        "metadata": {},
        "internal": false
    }
}

And you can see that the payment is now indeed confirmed.

Easy, huh?? This is all you need in order to integrate your system with the Devengo payment API. Go for it!

Next steps