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

# Mock responses

# Mock responses

KwikPaisa Neo Bank Sandbox environment provides mock responses to help merchants simulate different transaction scenarios during integration and testing.

Mock responses allow developers to:

* Test successful transactions
* Simulate failed payments
* Validate payout failures
* Test webhook handling
* Verify retry mechanisms
* Build reconciliation workflows safely

Mock responses are available only in the Sandbox environment.

***

## Why Mock Responses are Important

During development, merchants need to test:

* Success scenarios
* Failure handling
* Timeout workflows
* Retry mechanisms
* Webhook processing
* Edge cases

Mock responses help simulate these situations without real money movement.

***

## Supported Mock Scenarios

### Payment Gateway

| Scenario | Description |
| - | - |
| Payment Success | Simulates successful payment |
| Payment Failed | Simulates failed transaction |
| Payment Processing | Simulates delayed payment |
| Payment Expired | Simulates expired payment session |

***

### Payout APIs

| Scenario | Description |
| - | - |
| Payout Success | Simulates successful payout |
| Payout Failed | Simulates payout failure |
| Insufficient Balance | Simulates wallet balance error |
| Processing Payout | Simulates delayed settlement |

***

## Example Payment Gateway Response

> [tab] Success
>
> ```json theme={null}
> {
>   "code": "200",
>   "status": "success",
>   "message": "Payment completed successfully.",
>   "return_data": {
>     "x_order_id": "kp_40dec464",
>     "order_id": "6116229263036",
>     "order_status": "PAID",
>     "transaction_id": "TXN938482920",
>     "amount": "105.00",
>     "currency": "INR"
>   }
> }
> ```

> [tab] Failed
>
> ```json theme={null}
> {
>   "code": "200",
>   "status": "failed",
>   "message": "Payment failed.",
>   "return_data": {
>     "kwikX_order_id": "kp_40dec464",
>     "order_id": "6116229263036",
>     "order_status": "FAILED",
>     "transaction_id": null,
>     "amount": "105.00",
>     "currency": "INR"
>   }
> }
> ```

> [tab] Processing
>
> ```json theme={null}
> {
>   "code": "200",
>   "status": "processing",
>   "message": "Payment is under processing.",
>   "return_data": {
>     "kwikX_order_id": "kp_40dec464",
>     "order_id": "6116229263036",
>     "order_status": "PROCESSING"
>   }
> }
> ```

## Example Payout Response

> [tab] Success
>
> ```json theme={null}
> {
>   "status": true,
>   "code": 200,
>   "message": "Payout status fetched successfully.",
>   "data": {
>     "payout_id": "payout_b7c9d4d780db71e8",
>     "payout_order_id": "1778761897",
>     "status": "FAILED",
>     "amount": "9999999999",
>     "currency": "INR",
>     "utr_number": "NA",
>     "message": "Txn failed due to insufficient funds"
>   }
> }
> ```

> [tab] Failed
>
> ```json theme={null}
> {
>   "status": true,
>   "code": 200,
>   "message": "Payout status fetched successfully.",
>   "data": {
>     "payout_id": "payout_b7c9d4d780db71e8",
>     "payout_order_id": "1778761897",
>     "status": "FAILED",
>     "amount": "9999999999",
>     "currency": "INR",
>     "utr_number": "NA",
>     "message": "Txn failed due to insufficient funds"
>   }
> }
> ```

> [tab] Insufficient Funds
>
> ```json theme={null}
> {
>   "status": false,
>   "code": 422,
>   "message": "Insufficient wallet balance."
> }
> ```

> [tab] Transaction Not Found
>
> ```json theme={null}
> {
>   "status": false,
>   "code": 404,
>   "message": "Payout transaction not found."
> }
> ```

## Webhook Mock Testing

Sandbox webhooks can also simulate:

* Payment success events
* Payment failures
* Payout success notifications
* Payout failures
* Duplicate webhook events

Merchants should test:

* Signature verification
* Retry handling
* Idempotent processing
* Webhook logging

***

## Recommended Testing Checklist

Before production deployment, verify:

* Payment success handling
* Payment failure handling
* Processing state retries
* Payout success flow
* Payout failure flow
* Insufficient balance handling
* Webhook verification
* Retry workflows
* Duplicate transaction protection

***

## Important Notes

* Mock responses are for testing only
* Sandbox responses do not represent real settlements
* UTR numbers in Sandbox are simulated
* Banking confirmations are mocked in test mode

***

## Best Practices

* Test both success and failure scenarios
* Validate retry handling properly
* Verify webhook security
* Handle all API status codes safely
* Maintain test transaction logs

***

## Security Recommendations

* Never expose Sandbox credentials publicly
* Validate webhook signatures even in test mode
* Use separate environments for testing and production
* Avoid mixing Sandbox and production credentials


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.