Embedded credit API for Dinie partners. Enables customer registration, credit offer management, loan origination, and event delivery via webhooks.
Dinie API (2026-03-01)
OAuth2 Client Credentials authentication and API key management.
Each client_id / client_secret pair represents an access credential. Exchange the credentials for a JWT token via POST /auth/token and send the token as Bearer in all requests. The token expires in 1 hour.
You can create multiple credentials for different environments and revoke them individually.
The Customer resource (cust_) represents a credit borrower on the platform. The lifecycle follows: registration → KYC document submission → review → activation.
Two processes happen in parallel:
- Credit analysis — starts automatically upon registration
- KYC verification — the customer completes at their own pace
pending_kyc → under_review → active| Status | Description | Next Step |
|---|---|---|
pending_kyc | Registered, awaiting documents | Submit documents and biometrics |
under_review | Documents submitted, under review | Wait for customer.active webhook |
active | Approved and eligible for credit | Check credit offers |
# 1. Register the customer
customer = client.customers.create(
cpf: "123.456.789-00",
cnpj: "12.345.678/0001-90",
name: "João Silva",
email: "joao@example.com",
phone: "+5511999999999",
trading_name: "Loja do João",
external_id: "partner-ref-123"
)
# customer.id => "cust_550e8400..."
# customer.status => "pending_kyc"
# customer.kyc => list of pending documents
# 2. Submit each required document
customer.kyc.each do |item|
next unless item.status == "pending"
client.customers.upload_document(customer.id,
type: item.type,
file: File.open("docs/#{item.type}.pdf")
)
end
# 3. Start biometric capture
session = client.customers.create_biometrics_session(customer.id)
# Redirect the customer to session.session_url
# 4. Wait for customer.active webhook
# When received, the customer is ready for creditCreating a customer with the same CPF/CNPJ and external_id returns the existing customer (200 OK). This allows safely retrying the request in case of timeout or network failure. The 409 Conflict error only occurs when the external_id differs.
# By CPF
customers = client.customers.list(cpf: "123.456.789-00")
# By partner ID
customers = client.customers.list(external_id: "partner-ref-123")| Event | When it fires |
|---|---|
customer.created | Customer registered via API |
customer.under_review | Documents submitted, KYC review started |
customer.kyc_updated | KYC item status updated (approved, rejected, correction) |
customer.active | Customer approved — eligible for credit offers |
Request
Registers a new customer (borrower) for the authenticated partner. The customer is created with status pending_kyc and the response includes the kyc array with the documents and verifications required for this profile. The next step is to submit documents via POST /customers/{id}/documents.
Idempotent behavior: if the same CPF/CNPJ with the same external_id already exists, the existing customer is returned (200 OK). The 409 error occurs only when the external_id differs for the same CPF/CNPJ. See also the customer.* webhooks to track registration progress.
- Mock serverhttps://dinie.nexaedge.dev/_mock/apis/openapi/customers
- Productionhttps://api.dinie.com.br/v3/customers
- Sandboxhttps://sandbox.api.dinie.com.br/v3/customers
- curl
- Python
- Node.js
- Ruby
curl -X POST https://api.dinie.com.br/v3/customers \
-H "Authorization: Bearer $DINIE_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"cpf": "123.456.789-00",
"name": "João Silva",
"email": "joao@example.com",
"phone": "+5511999999999",
"external_id": "partner-ref-123"
}'Customer created
| Enum Value | Description |
|---|---|
| pending_kyc | Customer registered, but KYC documents/biometrics not yet submitted or under review |
| under_review | All required KYC items submitted; Dinie's compliance team is reviewing |
| active | KYC approved; customer is eligible to receive credit offers |
document for file uploads, data for data field corrections
Document type key (e.g., ccmei, selfie, identity_card_front)
| Enum Value | Description |
|---|---|
| pending | Awaiting submission by the customer |
| submitted | Document submitted, awaiting review |
| approved | Document reviewed and approved |
| pending_resubmission | Document rejected; customer must resubmit |
| pending_correction | Data field needs correction by the customer |
{ "id": "cust_550e8400e29b41d4a716446655440000", "status": "pending_kyc", "cpf": "123.456.789-00", "cnpj": "12.345.678/0001-90", "name": "João Silva", "email": "joao@example.com", "phone": "+5511999999999", "trading_name": "Loja do João", "external_id": "partner-ref-123", "kyc": [ { "kind": "document", "type": "ccmei", "description": "Certificado MEI", "status": "pending", "message": null, "uploaded_at": null }, { "kind": "document", "type": "selfie", "description": "Selfie", "status": "pending", "message": null, "uploaded_at": null } ], "created_at": "2026-03-04T10:00:00Z", "updated_at": "2026-03-04T10:00:00Z" }
Request
Lists and searches customers for the authenticated partner. Supports filters by cpf, external_id, and status to locate specific customers. Pagination uses cursor-based approach with the starting_after (last item ID) and limit (max 100) parameters.
- Mock serverhttps://dinie.nexaedge.dev/_mock/apis/openapi/customers
- Productionhttps://api.dinie.com.br/v3/customers
- Sandboxhttps://sandbox.api.dinie.com.br/v3/customers
- curl
- Python
- Node.js
- Ruby
# List customers filtered by CPF
curl "https://api.dinie.com.br/v3/customers?cpf=123.456.789-00&limit=10" \
-H "Authorization: Bearer $DINIE_API_TOKEN"List of customers
| Enum Value | Description |
|---|---|
| pending_kyc | Customer registered, but KYC documents/biometrics not yet submitted or under review |
| under_review | All required KYC items submitted; Dinie's compliance team is reviewing |
| active | KYC approved; customer is eligible to receive credit offers |
document for file uploads, data for data field corrections
Document type key (e.g., ccmei, selfie, identity_card_front)
| Enum Value | Description |
|---|---|
| pending | Awaiting submission by the customer |
| submitted | Document submitted, awaiting review |
| approved | Document reviewed and approved |
| pending_resubmission | Document rejected; customer must resubmit |
| pending_correction | Data field needs correction by the customer |
{ "data": [ { "id": "cust_550e8400e29b41d4a716446655440000", "status": "active", "cpf": "123.456.789-00", "cnpj": "12.345.678/0001-90", "name": "João Silva", "email": "joao@example.com", "phone": "+5511999999999", "trading_name": "Loja do João", "external_id": "partner-ref-123", "kyc": [], "created_at": "2026-03-04T10:00:00Z", "updated_at": "2026-03-04T12:00:00Z" }, { "id": "cust_660e8400e29b41d4a716446655440001", "status": "pending_kyc", "cpf": "987.654.321-00", "cnpj": null, "name": "Maria Santos", "email": "maria@example.com", "phone": "+5511988888888", "trading_name": null, "external_id": "partner-ref-456", "kyc": [], "created_at": "2026-03-05T08:00:00Z", "updated_at": "2026-03-05T08:00:00Z" } ], "has_more": true }
- Mock serverhttps://dinie.nexaedge.dev/_mock/apis/openapi/customers/{customer_id}
- Productionhttps://api.dinie.com.br/v3/customers/{customer_id}
- Sandboxhttps://sandbox.api.dinie.com.br/v3/customers/{customer_id}
- curl
- Python
- Node.js
- Ruby
curl https://api.dinie.com.br/v3/customers/cust_550e8400e29b41d4a716446655440000 \
-H "Authorization: Bearer $DINIE_API_TOKEN"Customer details
| Enum Value | Description |
|---|---|
| pending_kyc | Customer registered, but KYC documents/biometrics not yet submitted or under review |
| under_review | All required KYC items submitted; Dinie's compliance team is reviewing |
| active | KYC approved; customer is eligible to receive credit offers |
document for file uploads, data for data field corrections
Document type key (e.g., ccmei, selfie, identity_card_front)
| Enum Value | Description |
|---|---|
| pending | Awaiting submission by the customer |
| submitted | Document submitted, awaiting review |
| approved | Document reviewed and approved |
| pending_resubmission | Document rejected; customer must resubmit |
| pending_correction | Data field needs correction by the customer |
{ "id": "cust_550e8400e29b41d4a716446655440000", "status": "active", "cpf": "123.456.789-00", "cnpj": "12.345.678/0001-90", "name": "João Silva", "email": "joao@example.com", "phone": "+5511999999999", "trading_name": "Loja do João", "external_id": "partner-ref-123", "kyc": [ { "kind": "document", "type": "ccmei", "description": "Certificado MEI", "status": "approved", "message": null, "uploaded_at": "2026-03-04T11:00:00Z" } ], "created_at": "2026-03-04T10:00:00Z", "updated_at": "2026-03-04T14:00:00Z" }
Request
Updates customer data fields. The main use case is correcting information rejected during KYC verification (items with pending_correction status), such as email, phone, or registration data. The cpf and external_id fields cannot be updated after creation. After correction, the KYC analysis resumes automatically and you will receive customer.kyc_updated webhooks with the progress.
- Mock serverhttps://dinie.nexaedge.dev/_mock/apis/openapi/customers/{customer_id}
- Productionhttps://api.dinie.com.br/v3/customers/{customer_id}
- Sandboxhttps://sandbox.api.dinie.com.br/v3/customers/{customer_id}
- curl
- Python
- Node.js
- Ruby
curl -X PATCH https://api.dinie.com.br/v3/customers/cust_550e8400e29b41d4a716446655440000 \
-H "Authorization: Bearer $DINIE_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"email": "joao.novo@example.com",
"phone": "+5511988887777"
}'Customer updated
| Enum Value | Description |
|---|---|
| pending_kyc | Customer registered, but KYC documents/biometrics not yet submitted or under review |
| under_review | All required KYC items submitted; Dinie's compliance team is reviewing |
| active | KYC approved; customer is eligible to receive credit offers |
document for file uploads, data for data field corrections
Document type key (e.g., ccmei, selfie, identity_card_front)
| Enum Value | Description |
|---|---|
| pending | Awaiting submission by the customer |
| submitted | Document submitted, awaiting review |
| approved | Document reviewed and approved |
| pending_resubmission | Document rejected; customer must resubmit |
| pending_correction | Data field needs correction by the customer |
{ "id": "cust_550e8400e29b41d4a716446655440000", "status": "active", "cpf": "123.456.789-00", "cnpj": "12.345.678/0001-90", "name": "João Silva", "email": "joao.novo@example.com", "phone": "+5511988887777", "trading_name": "Loja do João", "external_id": "partner-ref-123", "kyc": [], "created_at": "2026-03-04T10:00:00Z", "updated_at": "2026-03-05T09:00:00Z" }
Request
Uploads a KYC document for the customer via file upload (multipart/form-data). The document type must match one of the types listed in the customer's kyc array (e.g., ccmei, selfie, cnh). After upload, the document undergoes asynchronous review. Track the result via the customer.kyc_updated webhook or by retrieving the customer with GET /customers/{customer_id}.
- Mock serverhttps://dinie.nexaedge.dev/_mock/apis/openapi/customers/{customer_id}/documents
- Productionhttps://api.dinie.com.br/v3/customers/{customer_id}/documents
- Sandboxhttps://sandbox.api.dinie.com.br/v3/customers/{customer_id}/documents
- curl
- Python
- Node.js
- Ruby
curl -X POST https://api.dinie.com.br/v3/customers/cust_550e8400e29b41d4a716446655440000/documents \
-H "Authorization: Bearer $DINIE_API_TOKEN" \
-F "type=ccmei" \
-F "file=@certificado-mei.pdf"{ "id": "doc_550e8400e29b41d4a716446655440001", "type": "ccmei", "status": "submitted", "uploaded_at": "2026-03-04T11:00:00Z", "created_at": "2026-03-04T11:00:00Z", "updated_at": "2026-03-04T11:00:00Z" }
Request
Creates a biometrics capture session for the customer and returns a temporary URL. The partner should redirect the customer to this URL or embed it in a webview within their application. Biometrics is a KYC requirement of type biometrics and its progress is tracked in the customer's kyc array. This is an action endpoint that returns 200 OK (not 201 Created). See the customer.kyc_updated webhook to track the completion of the capture.
- Mock serverhttps://dinie.nexaedge.dev/_mock/apis/openapi/customers/{customer_id}/biometrics
- Productionhttps://api.dinie.com.br/v3/customers/{customer_id}/biometrics
- Sandboxhttps://sandbox.api.dinie.com.br/v3/customers/{customer_id}/biometrics
- curl
- Python
- Node.js
- Ruby
curl -X POST https://api.dinie.com.br/v3/customers/cust_550e8400e29b41d4a716446655440000/biometrics \
-H "Authorization: Bearer $DINIE_API_TOKEN"{ "session_url": "https://biometrics.dinie.com.br/session/abc123def456", "expires_at": "2026-03-04T16:00:00Z" }
Request
Fires immediately after a new customer is registered via POST /customers. Includes the customer's full registration data with pending_kyc status. Use it to confirm registration receipt and start the KYC document collection flow.
- Mock serverhttps://dinie.nexaedge.dev/_mock/apis/openapi/customer.created
- Productionhttps://api.dinie.com.br/v3/customer.created
- Sandboxhttps://sandbox.api.dinie.com.br/v3/customer.created
Request
Fires when all required KYC documents have been submitted and the credit review is started by Dinie. Includes the customer ID and under_review status. Use it to update the status in your system and inform the customer that the review is in progress.
- Mock serverhttps://dinie.nexaedge.dev/_mock/apis/openapi/customer.under_review
- Productionhttps://api.dinie.com.br/v3/customer.under_review
- Sandboxhttps://sandbox.api.dinie.com.br/v3/customer.under_review
Request
Fires when any KYC requirement changes status (approved, rejected, or pending correction). Includes the full kyc array with the updated status of each item. Use it to identify rejected documents and request resubmission from the customer via PATCH /customers/{id} or POST /customers/{id}/documents.
Full current state of all KYC requirements
document for file uploads, data for data field corrections
Document type key (e.g., ccmei, selfie, identity_card_front)
| Enum Value | Description |
|---|---|
| pending | Awaiting submission by the customer |
| submitted | Document submitted, awaiting review |
| approved | Document reviewed and approved |
| pending_resubmission | Document rejected; customer must resubmit |
| pending_correction | Data field needs correction by the customer |
- Mock serverhttps://dinie.nexaedge.dev/_mock/apis/openapi/customer.kyc_updated
- Productionhttps://api.dinie.com.br/v3/customer.kyc_updated
- Sandboxhttps://sandbox.api.dinie.com.br/v3/customer.kyc_updated
Request
Fires when the customer is fully verified (KYC approved) and eligible to receive credit offers. Includes the customer ID and active status. This is the time to query GET /customers/{id}/credit-offers to check for available pre-approved offers.
- Mock serverhttps://dinie.nexaedge.dev/_mock/apis/openapi/customer.active
- Productionhttps://api.dinie.com.br/v3/customer.active
- Sandboxhttps://sandbox.api.dinie.com.br/v3/customer.active
Manage the endpoints that receive event notifications (we_). Dinie follows the Standard Webhooks specification.
Events for each resource are documented in the Customers, Credit Offers, and Loans sections. This section covers only endpoint management.