Skip to content
Last updated

Quick Start

What is the Dinie API?

The Dinie API allows partners to integrate credit products directly into their platforms. Through a single REST API, you can register customers, present credit offers, originate loans, and track payments -- all without needing to build credit infrastructure from scratch.

The API follows a resource-oriented design with predictable URLs, JSON request and response bodies, and standard HTTP methods and status codes.

Prerequisites

Before making your first API call, you need:

  • Sandbox credentials -- a client_id and client_secret pair provided by your Dinie account manager
  • An HTTP client (cURL, Postman, or any programming language with HTTP support)
  • Optionally, one of Dinie's official SDKs (Node.js, Python, or Ruby)

Info: Contact your Dinie account manager to request sandbox credentials. Sandbox and production credentials are separate and not interchangeable.

Base URLs

EnvironmentBase URL
Productionhttps://api.dinie.com.br/v3
Sandboxhttps://sandbox.api.dinie.com.br/v3

All examples in this guide use the sandbox URL. Replace it with the production URL when you are ready to go live.

Your First API Call

The example below initializes the client with your credentials and registers a business -- the most common operation to start an integration. The SDKs exchange the credentials for an access token automatically.

import Dinie from "dinie";

const dinie = new Dinie({
  clientId: process.env.DINIE_CLIENT_ID,
  clientSecret: process.env.DINIE_CLIENT_SECRET,
  environment: "sandbox",
});

const customer = await dinie.customers.create({
  external_partner_id: "user-42",
  cpf: "123.456.789-00",
  name: "Joao Silva",
  email: "joao@example.com",
  phone: "+5511999999999",
  cnpj: "12.345.678/0001-90",
  trading_name: "Loja do Joao",
});

console.log(customer.id);     // "cust_550e8400..."
console.log(customer.status); // "pending_kyc"

The customer is created with status pending_kyc and a list of required documents in customer.kyc. The next step is to complete the registration and wait for credit offers.

Next Steps

Now that you have made your first API call, follow the integration guides:

  1. Registration and Offers -- register customers, complete KYC, and receive credit offers
  2. Simulation and Loan Origination -- simulate installments, formalize loans, and track through disbursement
  3. Webhooks -- set up endpoints to receive real-time notifications
  4. Going to Production -- checklist to launch your integration