Skip to main content

Testing Guide

Use this guide to validate request signing, payment creation, status polling, balances, webhooks, and error handling before production traffic.

Test vs Production Mode

Test and production use the same API endpoint (POST /public/api/multihub/v1). The environment is determined by your credentials and the service routes assigned during onboarding. Your 123hub account manager will confirm which test credentials and low-value routes are available for your account.

Getting Test Credentials

Test credentials are provided by the 123hub team during onboarding. You will receive:
  • application_id — an integer identifying your test application
  • secret_key — a private key used to sign requests in test mode
1

Request credentials

Contact your 123hub account manager or support@123hub.pro to request test credentials.
2

Verify connectivity

Use the gateway.ping method to confirm your credentials work.
Contact support@123hub.pro if you need test credentials.

Test Credential Behavior

Payments

  • Payments are created and go through normal status transitions
  • Route behavior depends on the account and service_id configuration confirmed during onboarding
  • Webhooks are delivered normally
  • All API responses mirror production behavior

Balance

  • balance.get returns the balances configured for the credential environment
  • Confirm available currencies and balance funding with your account manager before withdrawal tests
  • Balance changes follow the same response format as production

Webhooks

  • Webhooks are delivered to your configured endpoints
  • Use webhook testing to verify your integration
  • Same signature verification as production

Payment Scenarios

Successful Deposit

Create a deposit payment using payment.in — it will transition through created to success status:

Successful Deposit (Turkey)

Create a TRY deposit using the havale payment method:
Turkey (TRY) deposit methods: havale, papara, kredikarti. Withdrawals use bank_transfer with IBAN format.

Successful Withdrawal

Create a withdrawal payment using payment.out (requires sufficient available balance on the configured route):

Check Payment Status

Query the status of a payment using payment.status:

Error Response Example

Errors are returned with HTTP 400 (or HTTP 404 for unknown methods) and success: false. Always check the success field. Here is an example of an invalid signature error:

Testing Webhooks

Local Development

For local development, use a tunneling service like ngrok to expose your local server:

Integration Checklist

Before going live, verify your integration handles these scenarios:
  • Compute X-Data-Hash correctly as sha512(requestBody + secretKey)
  • Send required X-Data-Application-Id and a correct X-Data-Hash; if testing replay proof, send both X-Data-Timestamp and X-Data-Nonce
  • Verify gateway.ping returns a successful response
  • Store credentials securely (environment variables, not hardcoded)
  • Create deposit payments (payment.in) successfully
  • Create withdrawal payments (payment.out) successfully
  • Handle error responses gracefully (check success field)
  • Store h_id from response for subsequent status queries
  • Send unique c_id per payment to avoid duplicates (error 6009)
  • Retrieve payment status using payment.status with h_id
  • Handle all status values: created, processing, success, error, canceled, declined, refunded, partially_refunded
  • Check the final field to determine if a payment has reached a terminal state
  • Check the success field to determine if a final payment was successful
  • Receive webhook notifications
  • Verify webhook signatures
  • Handle payment completion events
  • Handle payment failure events
  • Process events idempotently
  • Success returns HTTP 200, errors return HTTP 400/404 — always check success field
  • Handle error code 3000 (authentication error / invalid signature)
  • Handle error code 3003 (application not found)
  • Handle error code 2002 (no route available)
  • Handle error code 6004 (insufficient funds for withdrawals)
  • Handle error code 1005 (missing or invalid fields)
  • Handle network timeouts and retry with the same c_id
  • Check balance using balance.get before withdrawals
  • Handle insufficient funds errors (error code 6004)

Error Code Reference

Going Live

1

Complete Testing

Ensure all checklist items pass with the test credentials and routes assigned to your account
2

Request Production Credentials

Contact your 123hub account manager or support@123hub.pro to request production application_id and secret_key
3

Update Configuration

Replace test application_id and secret_key with production credentials in your production environment
4

Update Webhook URLs

Ensure webhooks point to your production server
5

Monitor

Watch the dashboard for your first live transactions
Never use production credentials in development or testing environments. Always keep test and production credentials separate.

Common Testing Mistakes

Using Production Credentials in Dev

Always use test application_id and secret_key in development

Skipping Signature Verification

Always verify webhook signatures, even in test mode

Not Testing Errors

Test error scenarios, not just happy paths. Verify your code checks the success field in every response.

Hardcoding Credentials

Use environment variables for application_id and secret_key

Need Help?

Developer Support

Contact our team if you have questions about testing