Sandbox APIs Overview
Overview
The Sandbox APIs provide a safe testing environment for partners to integrate with Binance Connect without using real funds or affecting production systems. These APIs allow you to simulate the complete order lifecycle, test different order types, and verify your integration before going live.
Note1: The sandbox environment is isolated from production. All data and operations here do not impact real user accounts or transactions.
Note2: Invoke the pre-order API first, then use the sandbox APIs below.
Purpose
The sandbox environment enables you to:
- Test order placement flows without real transactions
- Simulate various order types (BUY, BUY_P2P, SEND, Convert)
- Manually control order status transitions for testing webhooks and order state management
- Validate your integration with different scenarios and edge cases
Available APIs
1. Place Order
Place standard test orders to simulate regular cryptocurrency purchase flows.
2. Place Convert Feature Order
Test cryptocurrency conversion scenarios where users convert from one crypto to another.
3. Place Buy Any Token Order
Simulate purchases of any token, including tokens not listed on Binance spot markets.
4. Order Status Transition
Manually trigger order status changes to test your order lifecycle management and webhook handling.
Testing Flow
A typical testing workflow in the sandbox:
- Place an Order: Use one of the place order endpoints to create a test order
- Verify Order Creation: Check that your system correctly receives and processes the order
- Trigger Status Transitions: Use the order status transition API to simulate different order states
- Test Webhooks: Verify your webhook handlers correctly process status updates
- Validate Order Queries: Use the order query API to fetch and verify order details
Key Differences from Production
- No real funds are used
- Orders don't execute actual blockchain transactions
- Status transitions are manual and controlled by the partner
- All operations are isolated to the sandbox environment
Getting Started
To start testing with sandbox APIs:
- Ensure you have sandbox credentials configured
- Review the individual API documentation for each endpoint
- Start with simple order placement and gradually test more complex scenarios
- Use the order status transition API to simulate various order states
Best Practices
- Test all possible order types your integration will support
- Verify error handling for invalid requests
- Test webhook delivery and processing for all status transitions
- Validate order query functionality with different order states
- Test edge cases like very small or large amounts