Skip to main content
GET
/
api
/
partner
/
v2
/
transactions
/
mock-testing-guide
cURL
curl --request GET \
  --url https://staging-api.capa.fi/api/partner/v2/transactions/mock-testing-guide \
  --header 'partner-api-key: <partner-api-key>'
{
  "success": true,
  "data": {}
}

Mock Testing Guide for Partners - Staging Environment

This guide explains how partners can test different transaction outcomes in the Capa.fi staging environment using specific transaction amounts.

Overview

The mock testing feature allows partners to simulate various transaction statuses without depending on real operational behavior. Capa will have this feature enabled in the staging environment for partner testing.

How to Use Mock Testing

For On-Ramp Transactions

Use the fiatAmount to trigger specific mock behaviors:
Fiat AmountExpected StatusDescription
1.01COMPLETEDTransaction completes successfully
1.02CANCELLED (NAME_VERIFICATION_FAILED)Bank beneficiary is not the KYC’d user

For Off-Ramp Transactions

Use the cryptoAmount to trigger specific mock behaviors:
Crypto AmountExpected StatusDescription
1.01COMPLETEDTransaction completes successfully
1.02CANCELLED (NAME_VERIFICATION_FAILED)Bank beneficiary is not a KYC’d user
1.03CRYPTO_NOT_RECEIVEDFailure due to no crypto transfer

API Endpoint

You can get the current mock testing configuration by calling:
GET /api/v1/transactions/mock-testing-guide
This endpoint returns:
  • enabled: Boolean indicating if mock testing is available
  • environment: Current environment (should be “staging”)
  • onRampRules: Array of on-ramp mock rules
  • offRampRules: Array of off-ramp mock rules

{
  "cryptoAmount": 1.03,
  "fiatAmount": 10.0,
  "fiatCurrencyId": "...",
  "blockchainToTokenId": "...",
  "userBankInformationId": "..."
}

Important Notes

  1. Exact Amounts: You must use the exact amounts specified above (1.01, 1.02, 1.03)
  2. State Transitions: The system will automatically handle the necessary state transitions to reach the target status
  3. Real Validation: All other validation rules still apply (KYC status, limits, etc.)

Headers

partner-api-key
string
required

Api key for the affiliated partner that is performing the request

Response

200 - application/json

This endpoint provides documentation for partners on how to trigger different transaction statuses using specific amounts.

Only available in testing environments.

success
boolean
Example:

true

data
object
I