Bankei BaaS Admin
    Bankei BaaS Admin
    • Introduction
    • API Security and Authentication
    • Handling Monetary Values in Our System
    • Secure API Credential Exchange Process
    • Organization
      • Get Organization
        GET
    • Admin Account
      • Get Account Information
        GET
    • User
      • Create User - Basic
        POST
      • Get User
        GET
    • KYC
      • Request KYC Analisys - Company
        POST
      • Get KYC Analisys Status
        GET
      • Request KYC Analisys - Consumer
        POST
      • Send KYC Document
        POST
    • Checking Account
      • Get Account Information
        GET
      • Get Account Balance
        GET
      • Create Checking Account
        POST
      • Get Account Transactions
        GET
    • Card
      • Get Card Groups
        GET
      • Create Nominated Card
        POST
      • Get Cards
        GET
      • Get Card Shipping
        GET
      • Activate Nominated Card
        POST
      • Temporary Disable Card
        POST
      • Enable Temporary Disable Card
        POST
      • Block Card
        POST
      • Get Card Sensitive Information
        GET
    • Pix
      • Generate Pix-In Static BR Code
      • Generate Pix-In Dynamic Cob BR Code
      • Generate Pix-In Dynamic CobV BR Code
      • Get Account Pix Keys
      • Generate Pix Key
    • Pix Out
      • Preview Pix BrCode Payment
      • Preview Pix Key Payment
      • Confirm Pix Payment
    • Bill Payment
      • Line vs. Barcode
      • Bill Payment Preview
      • Create Bill Payment
    • Invoice
      • Generate Invoice
    • Receipt
      • Get Transaction Receipt
    • Webhook
      • Bill Payment Webhook Events
      • Create Webhook Subscription
      • Get Webhook Subscriptions
      • Delete Webhook Subscription
      • Get Webhook Events
      • Get Webhook Event Detail
      • Get Webhook Send Attempts
      • Get Webhook Send Attempt Detail
      • Dispatch Webhook Events
    • Sandbox
      • Pay Pix BrCode [Sandbox Only]
      • Confirm Bill Payment [Sandbox Only]
      • Reject Bill Payment [Sandbox Only]
      • Approve Kyc Analisys [Sandbox Only]
    • Schemas
      • Account
      • Asset
      • Metadata
      • Address
      • Consumer

    Handling Monetary Values in Our System

    To ensure accuracy and consistency in all financial transactions, our system adopts a specific approach for representing monetary values: all values are treated as integers, where each unit represents the smallest currency sub-unit (the centavo for Brazilian Real).
    For Brazilian Real (BRL), this means:
    1 unit in the system = R$0.01 (one centavo)
    100 units in the system = R$1.00 (one real)

    Practical Examples#

    To illustrate how this conversion works in practice, see the table below:
    Integer Value in SystemRepresentation in BRLNote
    1R$0.01One centavo
    10R$0.10Ten centavos
    55R$0.55Fifty-five centavos
    100R$1.00One real
    185R$1.85One real and eighty-five centavos
    1234R$12.34Twelve reais and thirty-four centavos
    10000R$100.00One hundred reais
    150075R$1,500.75One thousand five hundred reais and seventy-five centavos
    1000000R$10,000.00Ten thousand reais
    When sending or receiving monetary values through our API, always use this integer representation. Similarly, when displaying these values to the end-user, remember to format them correctly for Brazilian Real by dividing the integer value by 100 and applying appropriate currency formatting (e.g., two decimal places, using "R$" symbol for BRL).

    Why We Use This Approach (Benefits)#

    Working with monetary values as integers (representing centavos or cents) is a recommended practice in software engineering for several important reasons:
    1.
    Absolute Precision (Avoids Floating-Point Errors):
    Computers can struggle to represent decimal fractions exactly using floating-point data types (like float or double). This can lead to small rounding errors that, over many transactions, can accumulate and cause significant financial discrepancies. Using integers completely eliminates this problem, as all operations are exact.
    2.
    Simplicity in Mathematical Operations:
    Integer arithmetic is inherently simpler and often more performant than floating-point arithmetic. Operations like addition, subtraction, and multiplication are straightforward and don't carry the risk of precision loss.
    3.
    Consistency Across Systems:
    It ensures that different parts of the system, or even different systems that integrate, interpret monetary values in the same way, preventing conversion or interpretation errors.
    4.
    Ease of Storage and Indexing:
    Databases handle integer data types very well. They are efficient for storing, indexing, and querying, which is crucial for financial systems.
    5.
    Explicit Control Over Rounding:
    By dealing with the smallest currency unit (like centavos), you have full control over how and when rounding should be applied, especially when converting the value for display or performing calculations involving complex divisions (such as interest or fee distribution).
    6.
    Industry Standard:
    Many financial institutions and payment platforms (like payment gateways) adopt this practice, which facilitates integration and interoperability.
    Adopting this convention ensures that our financial system is robust, accurate, and reliable. If you have any questions about how to handle these values, please contact our support team.

    Converting to Decimal for Display or Other Purposes#

    While our system stores and processes all monetary values as integers (representing centavos), you'll often need to convert this integer back into a decimal format for display to users, for reporting, or before sending to a third-party system that expects a decimal.
    The conversion is straightforward: divide the integer amount by 100.
    Here are some examples in common programming languages:
    JavaScript
    You can put other components inside Accordions.
    Python
    Java
    C#
    Modified at 2025-05-19 23:55:11
    Previous
    API Security and Authentication
    Next
    Secure API Credential Exchange Process
    Built with