{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-@l10n/en-US/guides/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["code-group"]},"type":"markdown"},"seo":{"title":"Registration and Offers","description":"Documentação oficial da API da plataforma de crédito embarcado Dinie. Integre produtos de crédito diretamente na sua aplicação.","siteUrl":"https://docs.dinie.com","lang":"pt-BR","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"registration-and-offers","__idx":0},"children":["Registration and Offers"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Register customers, upload documentation, complete biometrics, and receive credit offers."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"flow-overview","__idx":1},"children":["Flow Overview"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Two processes happen in parallel: the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["credit analysis"]}," (starts automatically upon registration) and ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["KYC verification"]}," (the customer completes at their own pace)."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/customer-lifecycle.378b9e84279ac68d804612f1e785932f874d95bdbc1de2f378588f748b3d6b2c.047687d6.svg","alt":"Customer lifecycle"},"children":[]}]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Status"},"children":["Status"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["creating"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Registration received, co-owner enrichment in progress"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["pending_kyc"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Ready to submit documentation and biometrics"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["under_review"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Documents submitted, analysis in progress"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["active"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Verified and eligible for credit offers"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["denied"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Permanently blocked"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"create-a-customer","__idx":2},"children":["Create a Customer"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Register the business with Dinie. The ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["external_id"]}," field is the internal reference from your system that you will use to identify the customer."]},{"$$mdtype":"Tag","name":"CodeGroup","attributes":{"mode":"tabs"},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"typescript","data-title":"Node.js","header":{"title":"Node.js","controls":{"copy":{}}},"source":"const customer = await client.customers.create({\n  externalId: \"partner-ref-123\",      // Your internal ID\n  cpf: \"123.456.789-00\",              // Business owner's CPF\n  email: \"joao@example.com\",\n  phone: \"+5511999999999\",\n  cnpj: \"12.345.678/0001-90\",\n});\n\nconsole.log(customer.status); // \"creating\"\nconsole.log(customer.kyc);    // Pending verification items\n","lang":"typescript"},"children":[]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"ruby","data-title":"Ruby","header":{"title":"Ruby","controls":{"copy":{}}},"source":"customer = client.customers.create(\n  external_id: \"partner-ref-123\",      # Your internal ID\n  cpf: \"123.456.789-00\",              # Business owner's CPF\n  email: \"joao@example.com\",\n  phone: \"+5511999999999\",\n  cnpj: \"12.345.678/0001-90\",\n)\n\nputs customer.status  # \"creating\"\nputs customer.kyc     # Pending verification items\n","lang":"ruby"},"children":[]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"python","data-title":"Python","header":{"title":"Python","controls":{"copy":{}}},"source":"customer = client.customers.create(\n    external_id=\"partner-ref-123\",      # Your internal ID\n    cpf=\"123.456.789-00\",              # Business owner's CPF\n    email=\"joao@example.com\",\n    phone=\"+5511999999999\",\n    cnpj=\"12.345.678/0001-90\",\n)\n\nprint(customer.status)  # \"creating\"\nprint(customer.kyc)     # Pending verification items\n","lang":"python"},"children":[]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","data-title":"cURL","header":{"title":"cURL","controls":{"copy":{}}},"source":"curl -X POST https://sandbox.api.dinie.com.br/v3/customers \\\n  -H \"Authorization: Bearer dinie_at_...\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"external_id\": \"partner-ref-123\",\n    \"cpf\": \"123.456.789-00\",\n    \"email\": \"joao@example.com\",\n    \"phone\": \"+5511999999999\",\n    \"cnpj\": \"12.345.678/0001-90\",\n  }'\n","lang":"bash"},"children":[]}]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Info:"]}," If you create a customer with the same CPF/CNPJ and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["external_id"]},", the API returns the existing customer (idempotent). A ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["409"]}," error only occurs when the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["external_id"]}," differs for the same CPF/CNPJ."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"upload-documents","__idx":3},"children":["Upload Documents"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Upload the documents listed in the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["customer.kyc"]}," array right after registration to speed up the analysis:"]},{"$$mdtype":"Tag","name":"CodeGroup","attributes":{"mode":"tabs"},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"typescript","data-title":"Node.js","header":{"title":"Node.js","controls":{"copy":{}}},"source":"import fs from \"fs\";\n\nawait client.customers.uploadKycAttachment(customer.id, {\n  requirementId: \"company_document\",\n  evidenceType: \"ccmei\",\n  attachmentType: \"file\",\n  file: fs.createReadStream(\"/path/to/ccmei.pdf\"),\n});\n\nawait client.customers.uploadKycAttachment(customer.id, {\n  requirementId: \"identity_12345678900\",\n  evidenceType: \"cnh\",\n  attachmentType: \"front\",\n  file: fs.createReadStream(\"/path/to/cnh-front.jpg\"),\n});\n","lang":"typescript"},"children":[]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"ruby","data-title":"Ruby","header":{"title":"Ruby","controls":{"copy":{}}},"source":"client.customers.upload_kyc_attachment(\n  customer.id,\n  requirement_id: \"company_document\",\n  evidence_type: \"ccmei\",\n  attachment_type: \"file\",\n  file: File.open(\"/path/to/ccmei.pdf\")\n)\n\nclient.customers.upload_kyc_attachment(\n  customer.id,\n  requirement_id: \"identity_12345678900\",\n  evidence_type: \"cnh\",\n  attachment_type: \"front\",\n  file: File.open(\"/path/to/cnh-front.jpg\")\n)\n","lang":"ruby"},"children":[]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"python","data-title":"Python","header":{"title":"Python","controls":{"copy":{}}},"source":"client.customers.upload_kyc_attachment(\n    customer.id,\n    requirement_id=\"company_document\",\n    evidence_type=\"ccmei\",\n    attachment_type=\"file\",\n    file=open(\"/path/to/ccmei.pdf\", \"rb\"),\n)\n\nclient.customers.upload_kyc_attachment(\n    customer.id,\n    requirement_id=\"identity_12345678900\",\n    evidence_type=\"cnh\",\n    attachment_type=\"front\",\n    file=open(\"/path/to/cnh-front.jpg\", \"rb\"),\n)\n","lang":"python"},"children":[]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","data-title":"cURL","header":{"title":"cURL","controls":{"copy":{}}},"source":"curl -X POST \"https://sandbox.api.dinie.com.br/v3/customers/${CUSTOMER_ID}/kyc-attachments\" \\\n  -H \"Authorization: Bearer dinie_at_...\" \\\n  -F \"requirement_id=company_document\" \\\n  -F \"evidence_type=ccmei\" \\\n  -F \"attachment_type=file\" \\\n  -F \"file=@/path/to/ccmei.pdf\"\n\ncurl -X POST \"https://sandbox.api.dinie.com.br/v3/customers/${CUSTOMER_ID}/kyc-attachments\" \\\n  -H \"Authorization: Bearer dinie_at_...\" \\\n  -F \"requirement_id=identity_12345678900\" \\\n  -F \"evidence_type=cnh\" \\\n  -F \"attachment_type=front\" \\\n  -F \"file=@/path/to/cnh-front.jpg\"\n","lang":"bash"},"children":[]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Supported formats: ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["PDF"]},", ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["JPEG"]},", ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["PNG"]},". Only upload the types listed in the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["kyc"]}," array -- unrecognized types return a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["422"]}," error."]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Info:"]}," Selfies cannot be uploaded via the API. They are captured by the customer during the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/en-us/guides/kyc-requirements#biometrics-session"},"children":["biometrics session"]},". See the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/en-us/guides/kyc-requirements"},"children":["KYC Requirements"]}," guide for details on the full flow."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"receive-the-credit-offer","__idx":4},"children":["Receive the Credit Offer"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The credit analysis starts automatically upon registration. When Dinie generates an offer, you receive the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["credit_offer.available"]}," webhook:"]},{"$$mdtype":"Tag","name":"CodeGroup","attributes":{"mode":"tabs"},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"typescript","data-title":"Node.js","header":{"title":"Node.js","controls":{"copy":{}}},"source":"app.post(\"/webhooks/dinie\", express.raw({ type: \"application/json\" }), (req, res) => {\n  const event = client.webhooks.unwrap(req.body.toString(), req.headers);\n\n  if (event.type === \"credit_offer.available\") {\n    const externalId = event.data.external_id;\n    const amount = event.data.approved_amount;\n    notifyCustomer(externalId, `Credit offer of R$ ${amount} available`);\n  }\n\n  res.sendStatus(200);\n});\n","lang":"typescript"},"children":[]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"ruby","data-title":"Ruby","header":{"title":"Ruby","controls":{"copy":{}}},"source":"post \"/webhooks/dinie\" do\n  event = client.webhooks.unwrap(request.body.read, request.env)\n\n  if event[\"type\"] == \"credit_offer.available\"\n    external_id = event.dig(\"data\", \"external_id\")\n    amount = event.dig(\"data\", \"approved_amount\")\n    notify_customer(external_id, \"Credit offer of R$ #{amount} available\")\n  end\n\n  status 200\nend\n","lang":"ruby"},"children":[]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"python","data-title":"Python","header":{"title":"Python","controls":{"copy":{}}},"source":"@app.post(\"/webhooks/dinie\")\nasync def handle_webhook(request: Request):\n    event = client.webhooks.unwrap(await request.body(), request.headers)\n\n    if event[\"type\"] == \"credit_offer.available\":\n        external_id = event[\"data\"][\"external_id\"]\n        amount = event[\"data\"][\"approved_amount\"]\n        notify_customer(external_id, f\"Credit offer of R$ {amount} available\")\n\n    return Response(status_code=200)\n","lang":"python"},"children":[]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","data-title":"cURL","header":{"title":"cURL","controls":{"copy":{}}},"source":"# Webhooks are received via POST at your configured endpoint.\n# Example credit_offer.available payload:\n# {\n#   \"type\": \"credit_offer.available\",\n#   \"data\": {\n#     \"id\": \"co_550e8400...\",\n#     \"customer_id\": \"cust_550e8400...\",\n#     \"external_id\": \"partner-ref-123\",\n#     \"approved_amount\": 50000.00,\n#     \"interest_rate\": 3.5\n#   }\n# }\n","lang":"bash"},"children":[]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"next-step","__idx":5},"children":["Next Step"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["When the customer has ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["active"]}," status and an available offer, they are ready to proceed. Continue to the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/en-us/guides/credit-workflow"},"children":["Simulation and Loan Origination"]}," guide."]}]},"headings":[{"value":"Registration and Offers","id":"registration-and-offers","depth":1},{"value":"Flow Overview","id":"flow-overview","depth":2},{"value":"Create a Customer","id":"create-a-customer","depth":2},{"value":"Upload Documents","id":"upload-documents","depth":2},{"value":"Receive the Credit Offer","id":"receive-the-credit-offer","depth":2},{"value":"Next Step","id":"next-step","depth":2}],"frontmatter":{"seo":{"title":"Registration and Offers"}},"lastModified":"2026-03-19T21:33:16.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/en-us/guides/customer-registration","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}