> ## 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.

# Mock Bank Verification

> Sandbox only. Sets a bank account to VERIFIED, FAILED or MANUAL_REVIEW for testing.

<Prompt description="Mock Bank Verification" actions={["cursor"]}>
  Integrate the Zapyd Mock Bank Verification endpoint into my sandbox test suite.

  Endpoint: POST /bank/mock-bank-verification
  Base URL: [https://sandbox.zapyd.com/cms/api/v1](https://sandbox.zapyd.com/cms/api/v1) (sandbox only; not available in production)
  Full URL (sandbox): POST [https://sandbox.zapyd.com/cms/api/v1/bank/mock-bank-verification](https://sandbox.zapyd.com/cms/api/v1/bank/mock-bank-verification)

  Auth headers required on every request:

  * X-API-KEY: your API key
  * X-TIMESTAMP: current Unix time in seconds
  * X-SIGNATURE: Base64(HMAC-SHA256(key=apiSecret, data=X-API-KEY + "|" + X-TIMESTAMP + "|" + canonicalBody))
    canonicalBody = request JSON with keys sorted at every nesting level, no whitespace (separators "," and ":"), non-ASCII escaped as lowercase \uXXXX. Send the exact canonicalBody string as the request body. Timestamp must be within 300s of server time.

  Task: Write a typed test helper that:

  1. Accepts customer\_id, bank\_id, bank\_status (VERIFIED, FAILED or MANUAL\_REVIEW) and an optional failure\_reason
  2. Requires failure\_reason when bank\_status is FAILED
  3. Builds the signed auth headers and calls POST /bank/mock-bank-verification
  4. Returns the updated bank account object
  5. Handles 400 (not found, missing failure\_reason, called outside sandbox) and 500 errors

  Language: TypeScript
</Prompt>

<Note>
  This endpoint doesn't send a `BANK` webhook. Read the account with [Get Bank Account](/api-reference-exchange/endpoint/bank/\{customer_id}-\{bank_id}) to see the new status.
</Note>

## Error Codes and Messages

| API Status Code | Response | Reason |
| - | - | - |
| 400 | Customer not found or access denied | Customer not found, or not in your organization |
| 400 | Bank account not found or access denied | Bank account not found, or not linked to this customer |
| 400 | Failure reason is required when bank status is FAILED | `bank_status` is `FAILED` without `failure_reason` |
| 400 | Mock bank verification is only allowed in non-production environment. | Called in production |
| 500 | Internal Server Error | Internal Server Error |


## OpenAPI

````yaml POST /bank/mock-bank-verification
openapi: 3.1.0
info:
  title: Zapyd API
  description: API for Zapyd - Customer, Payout, and Webhook services
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://sandbox.zapyd.com/pos/api/v1
    description: Payout API Base URL
    variables:
      base_url:
        default: https://sandbox.zapyd.com
  - url: https://sandbox.zapyd.com/cms/api/v1
    description: Customer API Base URL
    variables:
      base_url:
        default: https://sandbox.zapyd.com
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:
  /bank/mock-bank-verification:
    post:
      tags:
        - Bank
      description: >-
        Sandbox only. Sets the verification result of a customer's bank account,
        so you can test both outcomes. It doesn't send a BANK webhook; read the
        account with Get Bank Account to see the new status.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - customer_id
                - bank_id
                - bank_status
              properties:
                customer_id:
                  type: string
                  format: uuid
                  description: Zapyd customer ID (UUID) returned by Create Customer.
                  example: c2cf861b-342b-4318-a90e-85cd0312e82f
                bank_id:
                  type: string
                  format: uuid
                  description: Bank account ID returned by Add Bank Account.
                  example: cab47575-bbcb-4294-81a3-30774104f3b6
                bank_status:
                  type: string
                  enum:
                    - VERIFIED
                    - FAILED
                    - MANUAL_REVIEW
                  description: Result to set
                  example: VERIFIED
                failure_reason:
                  type: string
                  description: >-
                    Required when bank_status is FAILED. Use a real reason so
                    your error handling gets tested.
                  enum:
                    - INVALID_IFSC
                    - INVALID_ACCOUNT_NUMBER
                    - ACCOUNT_TYPE_NRE
                    - PENNY_DROP_FAILED
                    - NAME_MISMATCH
                    - BANK_RISK_CHECK_FAILED
                  example: NAME_MISMATCH
            examples:
              verified:
                summary: Verify the account
                value:
                  customer_id: c2cf861b-342b-4318-a90e-85cd0312e82f
                  bank_id: cab47575-bbcb-4294-81a3-30774104f3b6
                  bank_status: VERIFIED
              failed:
                summary: Fail with a reason
                value:
                  customer_id: c2cf861b-342b-4318-a90e-85cd0312e82f
                  bank_id: cab47575-bbcb-4294-81a3-30774104f3b6
                  bank_status: FAILED
                  failure_reason: NAME_MISMATCH
      responses:
        '200':
          description: Bank account status updated
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: Success
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                        description: Bank account ID
                        example: 4e6f1b20-a73c-11ec-b909-0242ac120002
                        format: uuid
                      customer_id:
                        type: string
                        description: Customer ID
                        example: 550e8400-e29b-41d4-a716-446655440000
                        format: uuid
                      country:
                        type: string
                        description: Customer country (alpha-3)
                        example: IND
                      bank_account_type:
                        type: string
                        description: Payment rail
                        example: ACCOUNT_DETAILS
                        enum:
                          - ACCOUNT_DETAILS
                          - UPI
                      identifiers:
                        type: object
                        description: >-
                          Rail-specific identifiers. The same keys are also
                          flattened onto the top level of this object.
                        example:
                          account_number: '7627389201'
                          ifsc: SBIN0001829
                      account_number:
                        type: string
                        description: Flattened from identifiers (ACCOUNT_DETAILS)
                        example: '7627389201'
                      ifsc:
                        type: string
                        description: Flattened from identifiers (ACCOUNT_DETAILS)
                        example: SBIN0001829
                      bank_account_status:
                        type: string
                        description: Verification status
                        example: VERIFIED
                        enum:
                          - PROCESSING
                          - VERIFIED
                          - FAILED
                          - MANUAL_REVIEW
                      beneficiary_name:
                        type: string
                        description: Account holder name returned by bank verification
                        example: JOHN DOE
                      bank_name:
                        type: string
                        description: Bank name
                        example: State Bank of India
                      failure_reason:
                        type:
                          - string
                          - 'null'
                        description: Set when bank_account_status is FAILED
                        example: null
        '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:
                      account_number:
                        type: array
                        items:
                          type: string
                        example:
                          - account_number is required
                  data:
                    type: 'null'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: Internal Server Error
                  data:
                    type: 'null'
                  err_code:
                    type: string
                    example: SYS_INTERNAL_ERROR
                  errors:
                    type: string
                    example: Unexpected error occurred. Please try again later.
      servers:
        - url: https://sandbox.zapyd.com/cms/api/v1
          description: Customer 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

````