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

# Mock Testing Guide

Returns the current mock testing configuration for the staging environment. Use specific transaction amounts to simulate different outcomes.

<Note>
  Mock testing is only available in the **staging environment**.
</Note>

***

## Mock Rules

### On-Ramp Transactions

Use `fiatAmount` to trigger specific behaviors:

| Fiat Amount | Expected Status                          | Description                            |
| ----------- | ---------------------------------------- | -------------------------------------- |
| `10.01`     | `COMPLETED`                              | Transaction completes successfully     |
| `10.02`     | `CANCELLED` (NAME\_VERIFICATION\_FAILED) | Bank beneficiary is not the KYC'd user |

### Off-Ramp Transactions

Use `cryptoAmount` to trigger specific behaviors:

| Crypto Amount | Expected Status                          | Description                          |
| ------------- | ---------------------------------------- | ------------------------------------ |
| `10.01`       | `COMPLETED`                              | Transaction completes successfully   |
| `10.02`       | `CANCELLED` (NAME\_VERIFICATION\_FAILED) | Bank beneficiary is not a KYC'd user |
| `10.03`       | `CRYPTO_NOT_RECEIVED`                    | Failure due to no crypto transfer    |

***

## Important Notes

* You must use the **exact amounts** specified above (10.01, 10.02, 10.03).
* All other validation rules still apply (KYC status, limits, etc.).
* The system automatically handles state transitions to reach the target status.

***

## Error Codes

### Common Errors

| HTTP Status | Code                   | Message                            |
| ----------- | ---------------------- | ---------------------------------- |
| 401         | `UNAUTHORIZED`         | "API Key is missing"               |
| 401         | `UNAUTHORIZED`         | "Invalid API Key format"           |
| 401         | `UNAUTHORIZED`         | "Invalid API Key"                  |
| 403         | `INVALID_PARTNER_FLOW` | "The partner has an invalid flow." |


## OpenAPI

````yaml reference/openapi/TransactionPartnerV2Controller_getMockTestingGuide.json GET /api/partner/v2/transactions/mock-testing-guide
openapi: 3.0.0
info:
  title: Capa Partner API - V2
  description: >-
    Partner API for integrating cryptocurrency on-ramp and off-ramp services
    using Capa's infrastructure. Enable your users to seamlessly convert between
    fiat and crypto.
  version: v2
  contact: {}
servers:
  - url: https://staging-api.capa.fi
  - url: https://production-api.capa.fi
security: []
paths:
  /api/partner/v2/transactions/mock-testing-guide:
    get:
      tags:
        - transactions
      operationId: TransactionPartnerV2Controller_getMockTestingGuide
      responses:
        '200':
          description: |-
            This endpoint provides documentation for partners on how to trigger
            different transaction statuses using specific amounts.

            Only available in testing environments.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    type: object
              example:
                success: true
                data: {}
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                UNAUTHORIZED:
                  value:
                    success: false
                    code: UNAUTHORIZED
                    message: API Key is missing
                UNAUTHORIZED_2:
                  value:
                    success: false
                    code: UNAUTHORIZED
                    message: Invalid API Key format
                UNAUTHORIZED_3:
                  value:
                    success: false
                    code: UNAUTHORIZED
                    message: Invalid API Key
      security:
        - PartnerApiKey: []
components:
  schemas:
    ErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          example: false
        code:
          type: string
          description: Machine-readable error code.
        message:
          type: string
          description: Human-readable error message.
        errors:
          type: array
          description: Optional per-field validation details.
          items:
            type: object
            properties:
              field:
                type: string
              message:
                type: string
      required:
        - success
        - code
        - message
  securitySchemes:
    PartnerApiKey:
      type: apiKey
      in: header
      name: partner-api-key
      description: API key for the affiliated partner performing the request.

````