> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ebrc.in/llms.txt
> Use this file to discover all available pages before exploring further.

# Validate Customer

> Validate and securely store an exporter's DGFT portal credentials for a platform customer. Required before you fetch their IRMs or generate an eBRC for them.

Validate the customer's DGFT portal credentials and store them for later filings. Run this once after [creating the customer](/api-reference/customer/create), and again whenever their DGFT password changes: re-submitting the **same** username with a new password updates the stored password. Submitting a different username is rejected.

<Note>
  Services are enabled after **24 hours** of successful validation. This endpoint is limited to **4 calls per minute**.
</Note>

### Request example

```bash theme={"dark"}
curl --location 'https://ebrcapi.eximfiles.io/api/v1/platform-customers/ee849a90-7a28-49b4-8cb2-8e31041650a2/check-dgft-credentials' \
  --header 'x-api-key: <YOUR_API_KEY>' \
  --header 'Content-Type: application/json' \
  --data-raw '{
    "dgftUsername": "<DGFT_USERNAME>",
    "dgftPassword": "<DGFT_PORTAL_PASSWORD>"
  }'
```

Credentials are encrypted at rest, never logged, and never shown back by any endpoint.

### Response example

Returns `201` with the sanitized customer in the `data` field:

```json theme={"dark"}
{
  "success": true,
  "data": {
    "id": "ee849a90-7a28-49b4-8cb2-8e31041650a2",
    "name": "Rohan Mehta",
    "email": "finance@suryatextiles.example.com",
    "type": "customer",
    "companyName": "Surya Textile Exports Pvt Ltd",
    "address": "Tiruppur, Tamil Nadu",
    "platformId": "1f0c9a52-3b41-4d78-9e26-7a8b5c4d3e2f",
    "isActive": true,
    "createdAt": "2026-07-22T10:15:04.874Z",
    "updatedAt": "2026-07-22T10:21:33.120Z"
  },
  "statusCode": 201,
  "timestamp": "2026-07-22T10:21:33.145Z"
}
```

### Errors

* `400` when the DGFT portal rejects the credentials.
* `429` if you exceed 4 calls per minute. See [rate limits](/authentication#rate-limits).
* Filings and downloads made later with a stale password return `DGFT_CREDENTIALS_INVALID`; recover by calling this endpoint again with the new password. See [DGFT credential error codes](/errors#dgft-credential-error-codes).

### Next steps

* [Fetch the customer's IRMs](/api-reference/irm/post) after services are enabled.
* [Submit IRMs for generation](/api-reference/genebrc/push-irm).
* [Download eBRC PDF](/api-reference/genebrc/download) shows credential recovery end to end.


## OpenAPI

````yaml POST /platform-customers/{id}/check-dgft-credentials
openapi: 3.1.0
info:
  title: eBRC API
  description: >-
    REST API for generating and managing electronic Bank Realization
    Certificates (eBRC) through DGFT's GenEBRC module. Onboard exporters,
    validate their DGFT credentials, pull inward remittance (IRM) data, submit
    certificate generation requests singly or in bulk, and track them to
    completion. All JSON responses are wrapped in the standard envelope {
    success, data, statusCode, timestamp }; the schemas on each endpoint
    describe the data field.
  contact:
    name: Eximfiles support
    email: amin@eximfiles.io
  version: 1.0.0
servers:
  - url: https://ebrcapi.eximfiles.io/api/v1
    description: Production
  - url: https://ebrcapi.dev.eximfiles.com/api/v1
    description: Sandbox
security:
  - x-api-key: []
paths:
  /platform-customers/{id}/check-dgft-credentials:
    post:
      summary: Validate DGFT credentials
      description: >-
        Validate the customer's DGFT portal credentials and store them for later
        filings. Re-submitting the same username with a new password updates the
        stored password. Services are enabled after 24 hours of successful
        validation.
      operationId: validateDgftCredentials
      parameters:
        - name: id
          in: path
          required: true
          description: The customer ID
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                dgftUsername:
                  type: string
                  description: DGFT portal username
                dgftPassword:
                  type: string
                  description: DGFT portal password
                  format: password
              required:
                - dgftUsername
                - dgftPassword
            examples:
              default:
                summary: Validate and store DGFT credentials
                value:
                  dgftUsername: <DGFT_USERNAME>
                  dgftPassword: <DGFT_PORTAL_PASSWORD>
      responses:
        '201':
          description: Credentials validated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Customer'
        '400':
          description: Invalid credentials or validation failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Customer:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier of the platform customer
        name:
          type: string
        email:
          type: string
          format: email
        type:
          type: string
          enum:
            - customer
          default: customer
        companyName:
          type: string
        address:
          type: string
        platformId:
          type: string
          description: Platform user ID that owns this customer
        isActive:
          type: boolean
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    Error:
      type: object
      properties:
        code:
          type: string
        message:
          type: string
  securitySchemes:
    x-api-key:
      type: apiKey
      name: x-api-key
      in: header

````