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_idconfiguration confirmed during onboarding - Webhooks are delivered normally
- All API responses mirror production behavior
Balance
balance.getreturns 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 usingpayment.in — it will transition through created to success status:
Successful Deposit (Turkey)
Create a TRY deposit using thehavale payment method:
Turkey (TRY) deposit methods:
havale, papara, kredikarti. Withdrawals use bank_transfer with IBAN format.Successful Withdrawal
Create a withdrawal payment usingpayment.out (requires sufficient available balance on the configured route):
Check Payment Status
Query the status of a payment usingpayment.status:
Error Response Example
Errors are returned with HTTP 400 (or HTTP 404 for unknown methods) andsuccess: 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:Authentication
Authentication
- Compute
X-Data-Hashcorrectly assha512(requestBody + secretKey) - Send required
X-Data-Application-Idand a correctX-Data-Hash; if testing replay proof, send bothX-Data-TimestampandX-Data-Nonce - Verify
gateway.pingreturns a successful response - Store credentials securely (environment variables, not hardcoded)
Payment Creation
Payment Creation
- Create deposit payments (
payment.in) successfully - Create withdrawal payments (
payment.out) successfully - Handle error responses gracefully (check
successfield) - Store
h_idfrom response for subsequent status queries - Send unique
c_idper payment to avoid duplicates (error 6009)
Payment Status
Payment Status
- Retrieve payment status using
payment.statuswithh_id - Handle all status values:
created,processing,success,error,canceled,declined,refunded,partially_refunded - Check the
finalfield to determine if a payment has reached a terminal state - Check the
successfield to determine if a final payment was successful
Webhooks
Webhooks
- Receive webhook notifications
- Verify webhook signatures
- Handle payment completion events
- Handle payment failure events
- Process events idempotently
Error Handling
Error Handling
- Success returns HTTP 200, errors return HTTP 400/404 — always check
successfield - 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
Balance
Balance
- Check balance using
balance.getbefore 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_key3
Update Configuration
Replace test
application_id and secret_key with production credentials in your production environment4
Update Webhook URLs
Ensure webhooks point to your production server
5
Monitor
Watch the dashboard for your first live transactions
Common Testing Mistakes
Using Production Credentials in Dev
Always use test
application_id and secret_key in developmentSkipping 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_keyNeed Help?
Developer Support
Contact our team if you have questions about testing
