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.

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

  1. Visit Paybin Portfolio
  2. Create an account or sign in
  3. Navigate to API settings
  4. 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"
}
ComponentDescription
apiVersionIndicates the current version of the Paybin API you are interacting with. It ensures compatibility and access to version-specific features or changes.
dataContains the relevant data payload for your request. This could include details of a transaction, user information, or other pertinent data.
codeA status code representing the outcome of the API call. A code of 200 indicates success, while any other code signifies an error.
messageProvides 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

CodeDescription
Z200Invalid credentials
Z300Invalid symbol
Z400Blockchain network error
Z500No wallet found
Z600Invalid parameters
Z800Invalid 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)

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:

Was this page helpful?