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

# Testing

> Test your integration with mock transactions in staging

You can use [the mock UI](https://staging-dashboard.getpartna.com/mock/deposit) on the staging dashboard to execute test transactions with a few clicks. The staging environment also includes mock API endpoints for more flexibility. Use them to test your integration end-to-end without moving real funds.

## Mock endpoints

### Mock Deposit

Simulates a crypto deposit to a user's account. Use this to test webhook delivery for `Deposit` events and to fund test accounts for subsequent operations.

```bash theme={null}
curl --request POST \
  --url https://staging-api.getpartna.com/v4/mock/deposit \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: YOUR_API_KEY' \
  --header 'x-api-user: YOUR_USERNAME' \
  --data '{
    "amount": 100,
    "currency": "USDT"
  }'
```

See the full reference: [Mock Deposit](/api-reference/endpoint/v3/mock/mock-deposit)

### Mock Fiat Deposit

Simulates a fiat (local currency) deposit. Use this to test the collect flow and onramp scenarios where a user pays in fiat.

```bash theme={null}
curl --request POST \
  --url https://staging-api.getpartna.com/v4/mock/fiat-deposit \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: YOUR_API_KEY' \
  --header 'x-api-user: YOUR_USERNAME' \
  --data '{
    "amount": 50000,
    "currency": "NGN"
  }'
```

See the full reference: [Mock Fiat Deposit](/api-reference/mock/mock-fiat-deposit)

You can also run these from the staging dashboard UI: [Mock Deposits](https://staging-dashboard.getpartna.com/mock/deposit).

## Testing workflow

A typical testing workflow looks like this:

<Steps>
  <Step title="Create a test user account">
    Use [Create Account](/api-reference/account/create-account) to set up a test user. In staging, KYC can be completed with test data.
  </Step>

  <Step title="Complete KYC">
    Run through the [KYC flow](/guides/accounts-and-kyc) using test identity data. In staging, you can use any 11-digit BVN, `08030013843` for phone verification, and `123456` as the OTP.
  </Step>

  <Step title="Fetch a rate">
    Call [Get Rate](/api-reference/rate/get-rate) to get a conversion rate and rate key.
  </Step>

  <Step title="Initiate a ramp request">
    Use [Onramp and Offramp](/api-reference/ramp/onramp-and-offramp) to create a test transaction.
  </Step>

  <Step title="Simulate the payment">
    For onramp: call Mock Fiat Deposit to simulate the user's local currency payment. For offramp: call Mock Deposit to simulate an incoming crypto payment.
  </Step>

  <Step title="Verify webhook delivery">
    Confirm your webhook endpoint received the expected events (`Deposit`, `Convert`, `Transfer`, etc.) with valid signatures.
  </Step>
</Steps>

## Webhook testing tips

If you do not have a publicly accessible server during development, use a tunneling tool like [ngrok](https://ngrok.com) or [webhook.site](https://webhook.site) to expose your local endpoint:

```bash theme={null}
ngrok http 3000
```

Then set your webhook URL to the forwarding address (e.g., `https://abc123.ngrok.io/webhook`) via the [Update Webhook URL](/api-reference/user/update-webhook-url) endpoint. If you just want to inspect payloads without writing code, webhook.site gives you a unique URL that logs every request it receives.

## Going to production

When your staging integration is working correctly:

1. Swap the base URL from `https://staging-api.getpartna.com/v4` to `https://api.getpartna.com/v4`
2. Replace staging credentials with your production `x-api-key` and `x-api-user`
3. Update your webhook signature verification to use the production public key
4. Update your webhook URL to your production endpoint

No other code changes are required. The API behaves identically in both environments.
