Quickstart
Welcome to the Paybin API Quickstart guide! This concise guide is designed to swiftly navigate you through the setup process, enabling you to begin utilizing the Paybin API effectively. We will cover the essentials: obtaining your API keys, understanding authentication, making your first API request, and guiding you towards comprehensive resources for deep diving into the full potential of our RESTful API.
Before you can make requests to the Paybin API, you will need to get your API key.
Authentication
Paybin API uses API key-based authentication. You will need two keys:
- Public Key: Used in request body for identification
- Secret Key: Used in
X-Api-Key
header for authentication
Getting Your API Keys
- Visit Paybin Portfolio
- Create an account or sign in
- Navigate to API settings
- Generate your Public and Secret keys
Making Your First Request
Here is a simple example of how to make a request to the Paybin API:
curl --location 'https://sandbox.paybin.io/v1/merchant/balances' \
--header 'X-Api-Key: YOUR_SECRET_KEY' \
--header 'Content-Type: application/json' \
--data '{
"PublicKey": "YOUR_PUBLIC_KEY"
}'
API Response Format
Understanding the structure of API responses is crucial for effectively integrating with and utilizing the Paybin API. Paybin API response design aims to provide clear, actionable information while enhancing security and facilitating internationalization.
Success Response
{
"apiVersion": "1.0.0.0",
"data": {
"btcBalance": 0.01827139,
"ltcBalance": 4.8155043,
"bscusdBalance": 124.900335290627,
"bnbBalance": 0.49766454477400346,
"ethBalance": 0.2053466266382856,
"usdtBalance": 0.391465,
"trxBalance": 4.846484,
"trxusdBalance": 0.314496,
"optusdBalance": 0.188525,
"optethBalance": 0.027137871507939223,
"ethusdcBalance": 0.0,
"bscusdcBalance": 0.0
},
"code": 200,
"message": "OK"
}
Error Response
{
"apiVersion": "1.0.0.0",
"data": null,
"code": 400,
"message": "Z200"
}
Component | Description |
---|---|
apiVersion | Indicates the current version of the Paybin API you are interacting with. It ensures compatibility and access to version-specific features or changes. |
data | Contains the relevant data payload for your request. This could include details of a transaction, user information, or other pertinent data. |
code | A status code representing the outcome of the API call. A code of 200 indicates success, while any other code signifies an error. |
message | Provides a brief message corresponding to the code . For success, it is typically "OK". For errors, unique codes like Z200 indicate specific issues. See all error codes |
Error Handling
Paybin employs unique error codes, such as Z200
, to enable clients to handle errors more easily, support localization, and enable precise issue identification. These codes are crucial for allowing the development of multilingual applications and facilitating easier debugging.
Common Error Codes
Code | Description |
---|---|
Z200 | Invalid credentials |
Z300 | Invalid symbol |
Z400 | Blockchain network error |
Z500 | No wallet found |
Z600 | Invalid parameters |
Z800 | Invalid body hash |
Environment URLs
Paybin provides different environments for testing and production:
- Sandbox:
https://sandbox.paybin.io
(for testing) - Production:
https://api.paybin.io
(for live transactions)
Always test your integration in the sandbox environment before going live with production.
What is Next?
Great! You are now set up with API authentication and have made your first request to the API. Here are some next steps:
- Explore the Withdraw API - Learn how to process withdrawals
- Check out the Deposit API - Learn how to accept deposits
- View Balance API - Learn how to check account balances
- Learn about error handling - Understand all error codes and messages
- Authentication guide - Deep dive into authentication methods