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.
Before making your first API call, you need:
- Sandbox credentials -- a
client_idandclient_secretpair 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.
| Environment | Base URL |
|---|---|
| Production | https://api.dinie.com.br/v3 |
| Sandbox | https://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.
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_id: "user-42",
cpf: "123.456.789-00",
email: "joao@example.com",
phone: "+5511999999999",
cnpj: "12.345.678/0001-90",
});
console.log(customer.id); // "cust_550e8400..."
console.log(customer.status); // "creating"The customer is created with status creating. When co-owner enrichment completes, the status changes to pending_kyc (via the customer.created webhook) and the list of required documents becomes available in customer.kyc. The next step is to complete the registration and wait for credit offers.
Now that you have made your first API call, follow the integration guides:
- Registration and Offers -- register customers, complete KYC, and receive credit offers
- Simulation and Loan Origination -- simulate installments, formalize loans, and track through disbursement
- Webhooks -- set up endpoints to receive real-time notifications
- Going to Production -- checklist to launch your integration