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

# Save Payin EDD

> Submits enhanced due diligence information when EDD is triggered during a payin quotation.

<Prompt description="Save Payin EDD" actions={["cursor"]}>
  Integrate the DollarPe Save Payin EDD endpoint to handle enhanced due diligence in my on-ramp flow.

  Endpoint: POST /ren/api/v1/payin/edd/save
  Base URL: [https://api.dollarpe.in](https://api.dollarpe.in) (production) | [https://sandbox.dollarpe.in](https://sandbox.dollarpe.in) (sandbox)

  Auth headers required on every request:

  * X-API-KEY: your API key
  * X-TIMESTAMP: current Unix time in seconds
  * X-SIGNATURE: Base64(HMAC-SHA256(X-API-KEY + X-TIMESTAMP + sortedJSONBody, apiSecret))

  When EDD is triggered: POST /payin/quotation returns 400 "EDD required". Collect EDD info from the customer and submit it before retrying the quotation.

  Task: Write a typed function that:

  1. Accepts customer\_id and EDD payload
  2. Builds the signed auth headers
  3. POSTs to /ren/api/v1/payin/edd/save
  4. Returns EDD submission status
  5. After approval, retry the blocked payin quotation
  6. Handles 400 (unverified customer, EDD not required) and 500 errors

  Language: TypeScript
</Prompt>

<Note>
  Payin EDD results apply to both payins and payouts. This means that doing Payin EDD is enough to suffice for both payin and payout EDD requirements.
</Note>

## Error Codes and Messages

| API Status Code | Response               | Reason                                                       |
| --------------- | ---------------------- | ------------------------------------------------------------ |
| 400             | Customer is unverified | Customer is added but KYC is unverified                      |
| 400             | Customer is unverified | Customer does not belong to Organization                     |
| 400             | Customer is unverified | Customer is not KYC verified                                 |
| 400             | EDD not required       | EDD for the customer is not currently required or applicable |
| 500             | Internal Server Error  | Internal Server Error                                        |


## OpenAPI

````yaml POST /ren/api/v1/payin/edd/save
openapi: 3.1.0
info:
  title: DollarPe API
  description: API for DollarPe - Customer, Payout, and Webhook services
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://sandbox.dollarpe.xyz/pos/api/v1
    description: Payout API Base URL
    variables:
      base_url:
        default: https://sandbox.dollarpe.xyz
  - url: https://sandbox.dollarpe.xyz/cms/api/v1
    description: Customer API Base URL
    variables:
      base_url:
        default: https://sandbox.dollarpe.xyz
security:
  - ApiKeyAuth: []
    TimestampAuth: []
    SignatureAuth: []
tags:
  - name: Customer
    description: Customer related operations
    x-displayName: Customer
    x-traitTag: true
  - name: Payout
    description: Payout related operations
  - name: Webhooks
    description: Webhook related operations
  - name: Widget
    description: Hosted buy/sell widget session initialization
paths:
  /ren/api/v1/payin/edd/save:
    post:
      tags:
        - Payin
      description: Create a payin EDD log
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - customer_id
                - source_of_income
                - bank_statement_url
                - bank_statement_passwords
                - itr_report_url
                - itr_report_passwords
                - purpose
                - account_operator
                - account_operator_name
                - p2p_trading_status
              properties:
                customer_id:
                  type: string
                  format: uuid
                  description: The unique identifier of the quotation
                  example: 2e104290-07c8-49f1-a5ca-0d27f0078f8a
                source_of_income:
                  type: string
                  enum:
                    - SALARY
                    - BUSINESS_INCOME
                    - OTHERS
                  example: SALARY
                bank_statement_url:
                  type: array
                  description: array of urls for bank statements in case of multiple.
                  example:
                    - https://storage.example.com/uploads/bank1.pdf
                    - https://storage.example.com/uploads/bank2.pdf
                bank_statement_passwords:
                  type: array
                  description: >-
                    Passwords corresponding to the bank statement PDFs. In case
                    of no password, use empty strings
                  example:
                    - pass1
                    - ''
                itr_report_url:
                  type: array
                  description: array of urls for itr reports in case of multiple.
                  example:
                    - https://storage.example.com/uploads/itr1.pdf
                    - https://storage.example.com/uploads/itr2.pdf
                itr_report_passwords:
                  type: array
                  description: >-
                    Passwords corresponding to the itr report PDFs. In case of
                    no password, use empty strings
                  example:
                    - pass1
                    - ''
                purpose:
                  type: string
                  enum:
                    - Investment
                    - Trading
                    - Payments
                    - Lending / Repayments
                    - Gifting
                    - Donations / Charity
                    - Remittance
                    - Legal Settlements
                  description: Purpose of requesting increased limits / transaction volume
                  example: Investment
                supporting_purpose_doc_url:
                  type: array
                  description: array of urls for documents supporting purpose
                  example:
                    - https://storage.example.com/uploads/example1.pdf
                    - https://storage.example.com/uploads/example2.pdf
                account_operator:
                  type: string
                  enum:
                    - SELF
                    - FAMILY
                    - THIRD PARTY
                  example: FAMILY
                account_operator_name:
                  type: string
                  example: John Doe
                relation_with_account_operator:
                  type: string
                  example: brother
                p2p_trading_status:
                  type: boolean
                  description: Is customer involved in P2P trading?
                  example: false
      responses:
        '200':
          description: Payin EDD submitted successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: Success
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
                        example: 550e8400-e29b-41d4-a716-446655440000
                      status:
                        type: string
                        example: PROCESSING
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: Bad Request
                  err_code:
                    type: string
                    example: REQ_FIELD_MISSING
                  errors:
                    type: object
                    properties:
                      customer_id:
                        type: array
                        items:
                          type: string
                        customer_id:
                          - This field is required
                  data:
                    type: 'null'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: Internal Server Error
                  err_code:
                    type: string
                    example: SYS_INTERNAL_ERROR
                  errors:
                    type: string
                    example: Unexpected error occurred. Please try again later.
                  data:
                    type: 'null'
      servers:
        - url: https://sandbox.dollarpe.xyz
          description: Payin EDD API Base URL
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY
      description: API Key for authentication
    TimestampAuth:
      type: apiKey
      in: header
      name: X-TIMESTAMP
      description: Current timestamp in seconds since epoch
    SignatureAuth:
      type: apiKey
      in: header
      name: X-SIGNATURE
      description: HMAC SHA256 signature of the request encoded in Base64

````