Getting started overview
Integrating with the Wise API involves a sequence of steps designed to ensure secure and functional access to its financial services. This guide outlines the process from initial account setup to making a verifiable API request. The core components include establishing a Wise Business account, understanding the authentication mechanism (OAuth 2.0), generating API tokens, and interacting with the API in a sandbox environment before transitioning to live operations.
The Wise Platform API facilitates various financial operations, such as initiating international transfers, managing multi-currency accounts, and accessing real-time exchange rates. Developers can utilize official SDKs or make direct HTTP requests to integrate these functionalities into their applications.
Here is a quick-reference table for the essential getting started steps:
| Step | What to do | Where |
|---|---|---|
| 1. Create Account | Register for a Wise Business account. | Wise Business website |
| 2. Access API Dashboard | Navigate to the API section within your Wise Business account. | Wise Business account settings |
| 3. Generate API Keys | Create a new API token for sandbox testing. | Wise API dashboard |
| 4. Set up Environment | Configure your development environment to use the API token. | Your local development setup |
| 5. Make First Request | Send a simple API call to verify connectivity and authentication. | Wise API sandbox endpoint |
Create an account and get keys
To begin using the Wise API, a Wise Business account is required. Personal Wise accounts do not provide access to the API. If you do not have one, you can register for a Wise Business account on the Wise website. The registration process typically involves providing business details, verification documents, and agreeing to the terms of service.
Once your Wise Business account is active, you can navigate to the API section within your account dashboard. This section is where you will manage your API credentials. Wise utilizes OAuth 2.0 for authentication, which involves obtaining an access token to authorize API requests. For initial setup and testing, Wise provides a sandbox environment that mirrors the production API but operates with simulated funds and transactions, preventing real financial impact during development. You can find detailed instructions on generating API tokens and managing credentials in the Wise API reference documentation.
The process generally involves:
- Logging into your Wise Business account.
- Locating the "Settings" or "Developers" section.
- Selecting "API Tokens" or a similar option.
- Generating a new API token, ensuring you select the appropriate scope for your intended operations (e.g., read-only, transfers).
- Copying the generated token securely, as it will be used in your API requests. For security best practices regarding API keys, refer to the Google Cloud API key best practices guide.
It is crucial to differentiate between sandbox and production API tokens. Sandbox tokens are for development and testing, while production tokens are for live applications handling real money. Always use the appropriate environment and token for your current stage of development.
Your first request
After obtaining your API token, you can make your first request to the Wise API sandbox. This initial call verifies your setup and authentication. A common first request is to fetch your Wise profile or account details. This typically involves sending a GET request to a Wise API endpoint with your API token included in the authorization header.
Here's an example using curl to fetch your profile details in the sandbox environment:
curl -X GET \
'https://api.sandbox.wise.com/v1/profiles' \
-H 'Authorization: Bearer YOUR_SANDBOX_API_TOKEN' \
-H 'Content-Type: application/json'
Replace YOUR_SANDBOX_API_TOKEN with the actual token you generated in your Wise Business account's API section. The sandbox base URL is https://api.sandbox.wise.com. For production, the base URL is https://api.wise.com.
If successful, the API will return a JSON response containing information about your Wise profiles. This confirms that your API token is valid and correctly configured. The Wise API reference provides detailed information on all available endpoints and their expected responses.
For those using an SDK, the process would involve initializing the SDK with your API token and then calling the relevant method. For example, in Python:
import wise_client # Assuming you have an SDK or client library
client = wise_client.WiseClient(api_token="YOUR_SANDBOX_API_TOKEN", sandbox=True)
profiles = client.get_profiles()
print(profiles)
This snippet is illustrative and assumes the existence of a wise_client library. Refer to the official Wise documentation for specific SDK usage examples and installation instructions for Python, Node.js, Java, and other supported languages.
Common next steps
Once you have successfully made your first API call, several common next steps can help you further integrate and test the Wise API:
- Explore Endpoints: Review the Wise API reference documentation to understand the full range of available endpoints, including those for creating transfers, managing balances, and retrieving exchange rates.
- Implement Webhooks: Set up webhooks to receive real-time notifications about events such as transfer status changes or balance updates. This is crucial for building responsive applications. Stripe's webhook guide provides general principles for secure webhook implementation.
- Utilize SDKs: If you haven't already, consider using one of the official Wise SDKs (Java, Python, Node.js, PHP, .NET) to streamline development and handle authentication and request formatting.
- Error Handling: Implement robust error handling in your application to gracefully manage API errors, network issues, and unexpected responses.
- Security Best Practices: Ensure your application adheres to security best practices, especially concerning API key management, data encryption, and input validation.
- Transition to Production: Once your integration is thoroughly tested in the sandbox, follow Wise's guidelines for moving to the production environment, which includes obtaining production API tokens and potentially undergoing a review process.
For more advanced integrations, consider exploring Wise's capabilities for embedded finance solutions, which allow partners to offer Wise services directly within their own platforms.
Troubleshooting the first call
Encountering issues during your first API call is common. Here are some troubleshooting steps:
- Check API Token: Ensure your API token is correct and hasn't expired. Verify that you are using a sandbox token for sandbox endpoints and a production token for production endpoints.
- Authorization Header: Confirm that the
Authorizationheader is correctly formatted asBearer YOUR_API_TOKEN. A common mistake is omitting "Bearer " or having extra spaces. - Endpoint URL: Double-check that you are using the correct endpoint URL for the sandbox (
https://api.sandbox.wise.com) or production (https://api.wise.com) environment. - Content-Type Header: For requests with a body (e.g., POST, PUT), ensure the
Content-Type: application/jsonheader is present if sending JSON data. - Network Connectivity: Verify your internet connection and ensure no firewalls or proxies are blocking your requests to the Wise API.
- Error Messages: Carefully read any error messages returned by the API. They often provide specific clues about what went wrong (e.g., "Invalid token", "Missing required parameter"). The Wise API reference details common error codes and their meanings.
- Rate Limits: While less likely on a first call, be aware of API rate limits. If you're making many rapid requests, you might hit a limit, resulting in HTTP 429 Too Many Requests errors.
- SDK Specific Issues: If using an SDK, ensure it's correctly installed and configured. Check the SDK's documentation for common setup issues.
- Wise Status Page: Check the Wise status page for any ongoing service disruptions or outages that might affect API availability.
If issues persist after these checks, consulting the official Wise API documentation or reaching out to Wise developer support can provide further assistance.