DRUO
Get started
Get started

Quickstart

Authenticate, create a customer, connect a bank account and charge it.

  1. 1Sign in to the DRUO portal and copy your client_id and client_secret.
  2. 2Exchange them for an access token.
  3. 3Create an End User that represents your customer.
  4. 4Send them a Connect Link so they can connect their bank account.
  5. 5Create a payment using the connected account as the funding source.

1. Get an access token

bash
curl -X POST https://auth.druo.com/oauth/token \
  -H "Content-Type: application/json" \
  -d '{
    "client_id": "YOUR_CLIENT_ID",
    "client_secret": "YOUR_CLIENT_SECRET",
    "audience": "https://druo-merchant-api.com",
    "grant_type": "client_credentials"
  }'

Tokens last 24 hours. Cache the token on your server and reuse it until it expires instead of requesting a new one for every call.

2. Create an End User

bash
curl -X POST https://api.druo.com/end-users/create \
  -H "Authorization: Bearer $DRUO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "INDIVIDUAL",
    "email": "j.smith@example.com",
    "first_name": "John",
    "last_name": "Smith"
  }'

3. Create a Connect Link

bash
curl -X POST https://api.druo.com/connect/link/create \
  -H "Authorization: Bearer $DRUO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "intro_text": "NOVO uses DRUO to connect to your bank account.",
    "existing_end_user_id": "eur_422f0f81-5001-4cce-a229-242d9ab9960a",
    "redirect_url": "https://example.com/connected"
  }'

Send the returned url to your customer. When they finish, DRUO redirects them to your redirect_url and fires an Account.connected webhook.

4. Charge the account

bash
curl -X POST https://api.druo.com/payments/create \
  -H "Authorization: Bearer $DRUO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 10000,
    "currency": "USD",
    "description": "Insurance policy renewal - INV12324",
    "funding_source_id": "acc_7985e8a4-8f38-4eab-8b27-a5d1c6dbf340",
    "statement_descriptor": "NOVO BILLING",
    "auto_send_receipt": false
  }'
Amounts are integers in the smallest currency unit. For USD, 10000 means $100.00.