Skip to main content
GET
/
api
/
credits
curl --request GET \
  --url 'https://api.ambiotec.com/api/credits?status=pending&limit=50&offset=0' \
  --header 'Authorization: Bearer YOUR_TOKEN'
{
  "success": true,
  "data": [
    {
      "id": 123,
      "customerId": 456,
      "customerName": "Juan Pérez",
      "businessName": "Comercial Pérez S.A.",
      "nit": "12345678-9",
      "fiscalAddress": "5a Avenida 10-20 Zona 1, Guatemala",
      "businessAddress": "Centro Comercial Plaza, Local 15",
      "officePhone": "+502 2345-6789",
      "legalRepresentative": "Juan Pérez García",
      "dpi": "2345678901234",
      "status": "pending",
      "authorizedAmount": null,
      "authorizedTermDays": null,
      "rejectionReason": null,
      "commercialReferences": [
        {
          "name": "Proveedor ABC",
          "phone": "+502 2222-3333",
          "contact": "María López"
        }
      ],
      "bankReferences": [
        {
          "bank": "Banco Industrial",
          "accountType": "Corriente",
          "accountNumber": "****1234"
        }
      ],
      "financialStatementUrl": "https://s3.amazonaws.com/ambiotec-credits/financial-statements/123-statement.pdf",
      "bankStatementUrl": "https://s3.amazonaws.com/ambiotec-credits/bank-statements/123-bank.pdf",
      "utilityBillsUrl": "https://s3.amazonaws.com/ambiotec-credits/utility-bills/123-utilities.pdf",
      "createdAt": "2026-03-01T10:30:00Z",
      "updatedAt": "2026-03-01T10:30:00Z"
    }
  ],
  "count": 1
}
Fetches credit applications from the system with support for status filtering and pagination.

Query Parameters

status
string
Filter by application statusPossible values:
  • pending: Applications awaiting review
  • approved: Approved applications
  • rejected: Rejected applications
limit
integer
default:"100"
Maximum number of records to return (max: 100)
offset
integer
default:"0"
Number of records to skip for pagination

Response

success
boolean
Indicates if the request was successful
data
array
Array of credit application objects
count
integer
Number of applications returned in this response
curl --request GET \
  --url 'https://api.ambiotec.com/api/credits?status=pending&limit=50&offset=0' \
  --header 'Authorization: Bearer YOUR_TOKEN'
{
  "success": true,
  "data": [
    {
      "id": 123,
      "customerId": 456,
      "customerName": "Juan Pérez",
      "businessName": "Comercial Pérez S.A.",
      "nit": "12345678-9",
      "fiscalAddress": "5a Avenida 10-20 Zona 1, Guatemala",
      "businessAddress": "Centro Comercial Plaza, Local 15",
      "officePhone": "+502 2345-6789",
      "legalRepresentative": "Juan Pérez García",
      "dpi": "2345678901234",
      "status": "pending",
      "authorizedAmount": null,
      "authorizedTermDays": null,
      "rejectionReason": null,
      "commercialReferences": [
        {
          "name": "Proveedor ABC",
          "phone": "+502 2222-3333",
          "contact": "María López"
        }
      ],
      "bankReferences": [
        {
          "bank": "Banco Industrial",
          "accountType": "Corriente",
          "accountNumber": "****1234"
        }
      ],
      "financialStatementUrl": "https://s3.amazonaws.com/ambiotec-credits/financial-statements/123-statement.pdf",
      "bankStatementUrl": "https://s3.amazonaws.com/ambiotec-credits/bank-statements/123-bank.pdf",
      "utilityBillsUrl": "https://s3.amazonaws.com/ambiotec-credits/utility-bills/123-utilities.pdf",
      "createdAt": "2026-03-01T10:30:00Z",
      "updatedAt": "2026-03-01T10:30:00Z"
    }
  ],
  "count": 1
}

Business Logic

Credit Application Workflow

Credit applications follow this lifecycle:
  1. Pending: Initial state when application is submitted
    • All required documents uploaded
    • References provided
    • Awaiting credit committee review
  2. Approved: Credit committee approves the application
    • authorizedAmount set (may differ from requested amount)
    • authorizedTermDays defines payment terms
    • Customer can now make purchases on credit
  3. Rejected: Application denied
    • rejectionReason explains why
    • Customer must address issues before reapplying

Pagination

For large datasets:
  • Use limit to control page size
  • Use offset to skip to specific pages
  • Example: Page 2 with 50 items per page = limit=50&offset=50

Document Storage

All uploaded documents are stored in S3:
  • Financial Statements: credits/financial-statements/
  • Bank Statements: credits/bank-statements/
  • Utility Bills: credits/utility-bills/
  • URLs are presigned for secure access
  • Documents must be PDF, JPEG, or PNG (max 10MB)

Build docs developers (and LLMs) love