Integrating Your CRM with B2BINPAY Payouts

Have more questions? Submit a request

A Practical Guide to Correct Payout Creation, Commission Handling, and Reconciliation

This article explains how to correctly create payouts in B2BINPAY using the API, how to calculate and store commissions inside your CRM, and how to reconcile the final amounts using B2BINPAY responses, transfers, and callbacks.

It is intended for technical teams integrating an internal CRM with B2BINPAY for automated crypto payouts.

Official API reference:
👉 https://docs.b2binpay.com/api-guide/payout-methods


1. High-Level Payout Flow

When your CRM initiates a payout, the lifecycle looks like this:

  1. CRM calculates business values
    • User payout amount
    • CRM commission (your fee)
    • Final payout amount sent to B2BINPAY
  2. CRM sends a Payout API request to B2BINPAY
  3. B2BINPAY creates a payout
  4. B2BINPAY creates one or more transfers
    • Main blockchain transfer
    • Internal service/transportation transfers
  5. B2BINPAY sends a callback with final data
  6. CRM reconciles amount, commission, and transaction status

Each step is explained below.


2. Understanding Key Amounts and Commissions

Before calling the API, your CRM must clearly separate three different concepts:

Concept Controlled by Description
User payout amount Your CRM What the end user should receive
CRM commission Your CRM Your business fee
B2BINPAY commission B2BINPAY B2BINPAY service commission

Important Rule

👉 B2BINPAY commission is NOT set by your CRM.
It is calculated automatically and returned in the response and callbacks.


3. Preparing the Payout in Your CRM

Example Business Logic in CRM

Let’s assume:

  • User should receive: 55 USDT
  • Your CRM commission: 5 USDT
  • Total charged from user balance: 60 USDT

Your CRM should:

  • Store user_payout_amount = 55
  • Store crm_commission = 5
  • Send 55 as the payout amount to B2BINPAY

❗ Never add your CRM commission to the B2BINPAY payout amount.


4. Creating a Payout via B2bINPAY API

Payout Request Example

{
  "data": {
    "type": "payout",
    "attributes": {
      "label": "Salad",
      "amount": "55",
      "fee_amount": "35",
      "address": "TEDFKBLLZ5MjEBGngvWtyGyLEDn8BpoTKt",
      "tracking_id": "12356"
    },
    "relationships": {
      "wallet": {
        "data": {
          "type": "wallet",
          "id": "665"
        }
      },
      "currency": {
        "data": {
          "type": "currency",
          "id": "2145"
        }
      }
    }
  }
}

Key Fields Explained

Field Description
amount Net amount sent to the blockchain
fee_amount Maximum allowed blockchain fee
tracking_id Your CRM’s internal payout ID
wallet.id B2BINPAY wallet ID
currency.id B2BINPAY currency ID (e.g., USDT-TRX)

5. Payout Creation Response

{
    "data": {
        "type": "payout",
        "id": "3908",
        "attributes": {
            "amount": "55.000000",
            "address": "TEDFKBLLZ5MjEBGngvWtyGyLEDn8BpoTKt",
            "target_deposit": "984e1279-a9f1-4b29-8952-757952aad8a9",
            "target_wallet": null,
            "tracking_id": "b41a2c75-e0d3-4b5a-b6be-6456260b2224",
            "label": "Salad",
            "confirmations_needed": null,
            "fee_amount": "35.000000",
            "is_fee_included": false,
            "status": 2,
            "rate_requested": "0.999939",
            "callback_url": null,
            "force_blockchain": false,
            "exp": 2,
            "tag_type": null,
            "tag": null,
            "destination": {
                "address_type": null,
                "address": "TEDFKBLLZ5MjEBGngvWtyGyLEDn8BpoTKt"
            }
        },
        "relationships": {
            "currency": {
                "data": {
                    "type": "currency",
                    "id": "2145"
                }
            },
            "wallet": {
                "data": {
                    "type": "wallet",
                    "id": "665"
                }
            }
        }
    }
}

What Your CRM Should Do

  • Store payout.id = 3908
  • Map it to your internal payout record
  • Continue waiting for transfer creation or callback

6. Understanding Transfers and B2bINPAY Commission

After payout creation, B2BINPAY generates transfer records.

Main Transfer Example

{
    "data": {
        "type": "transfer",
        "id": "14323",
        "attributes": {
            "op_id": 3908,
            "op_type": 2,
            "amount": "55.000000",
            "rate_target": "0.999939892000000000",
            "commission": "1.000671",
            "fee": "0.000000",
            "txid": "cb27bfe75b12a5e37062ab5815e2d08cb602a94bd755d57bfe7af9d7002d8e57",
            "status": 1,
            "user_message": null,
            "created_at": "2026-01-15T14:20:27.197341Z",
            "updated_at": "2026-01-15T14:20:30.784224Z",
            "confirmations": 139,
            "risk": 0,
            "risk_personal": null,
            "risk_personal_status": 4,
            "risk_status": 4,
            "amount_target": "56.00",
            "commission_target": "1.00",
            "amount_cleared": "-56.00"
        },
        "relationships": {
            "currency": {
                "data": {
                    "type": "currency",
                    "id": "2145"
                }
            },
            "wallet": {
                "data": {
                    "type": "wallet",
                    "id": "665"
                }
            },
            "parent": {
                "data": {
                    "type": "transfer",
                    "id": "14324"
                }
            }
        }
    }
}

How to Read This

Field Meaning
amount Net blockchain amount
commission B2BINPAY commission
amount_target Amount deducted from wallet
commission_target Rounded commission in your wallet currency
amount_cleared Final wallet balance change

👉 B2BINPAY commission = 1.000671 USDT
This value must be stored in your CRM for reconciliation.


7. Callback: Your Source of Truth

Once processing is complete, B2BINPAY sends a signed callback.

Callback Highlights

{
  "data": {
    "type": "payout",
    "id": "3908",
    "attributes": {
      "address": "TEDFKBLLZ5MjEBGngvWtyGyLEDn8BpoTKt",
      "created_at": "2026-01-15T14:20:25.026081Z",
      "tracking_id": "b41a2c75-e0d3-4b5a-b6be-6456260b2224",
      "fee_amount": "35.000000",
      "is_fee_included": false,
      "amount": "55.000000",
      "destination": {
        "address_type": null,
        "address": "TEDFKBLLZ5MjEBGngvWtyGyLEDn8BpoTKt"
      }
    },
    "relationships": {
      "wallet": {
        "data": {
          "type": "wallet",
          "id": "665"
        }
      },
      "currency": {
        "data": {
          "type": "currency",
          "id": "2145"
        }
      },
      "transfer": {
        "data": {
          "type": "transfer",
          "id": "14323"
        }
      },
      "transportation": {
        "data": {
          "type": "transfer",
          "id": "14324"
        }
      }
    }
  },
  "included": [
    {
      "type": "wallet",
      "id": "665",
      "attributes": {
        "label": "",
        "status": 3,
        "type": 1,
        "created_at": "2024-12-17T09:21:51.279931Z",
        "balance_confirmed": "267.83",
        "balance_pending": "-427.84",
        "balance_unusable": "0.00",
        "minimal_transfer_amount": "0.00"
      },
      "relationships": {
        "currency": {
          "data": {
            "type": "currency",
            "id": "840"
          }
        }
      }
    },
    {
      "type": "currency",
      "id": "2145",
      "attributes": {
        "blockchain_name": "",
        "iso": 2145,
        "name": "TetherUS",
        "alpha": "USDT-TRX",
        "alias": "USDT",
        "tags": "",
        "exp": 6,
        "confirmation_blocks": 20,
        "minimal_transfer_amount": "1.000000",
        "block_delay": 75
      }
    },
    {
      "type": "transfer",
      "id": "14323",
      "attributes": {
        "op_id": 3908,
        "op_type": 2,
        "amount": "55.000000",
        "rate_target": "0.999939892000000000",
        "commission": "1.000671",
        "fee": "0.000000",
        "txid": "cb27bfe75b12a5e37062ab5815e2d08cb602a94bd755d57bfe7af9d7002d8e57",
        "status": 1,
        "user_message": null,
        "created_at": "2026-01-15T14:20:27.197341Z",
        "updated_at": "2026-01-15T14:20:30.784224Z",
        "confirmations": 193,
        "risk": 0,
        "risk_personal": null,
        "risk_personal_status": 4,
        "risk_status": 4,
        "amount_target": "56.00",
        "commission_target": "1.00",
        "amount_cleared": "-v.00"
      },
      "relationships": {
        "currency": {
          "data": {
            "type": "currency",
            "id": "2145"
          }
        },
        "parent": {
          "data": {
            "type": "transfer",
            "id": "14324"
          }
        }
      }
    }
  ],
  "meta": {
    "time": "2026-01-15T14:30:36.274217+00:00",
    "sign": "***"
  }
} 

CRM Actions on Callback

  1. Verify callback signature
  2. Match tracking_id to CRM payout
  3. Read included transfer data

8. Final Accounting Model (Recommended)

Your CRM ledger should store three independent values:

Item Amount
User payout 55.00
CRM commission 5.00
B2BINPAY commission 1.00
Total deducted from your B2BINPAY wallet 56.00

This ensures:

  • Clean audits
  • Transparent user reports
  • Correct profit calculation

9. Common Integration Mistakes to Avoid

❌ Adding CRM commission to amount
❌ Trying to manually calculate B2BINPAY commission
❌ Ignoring transfer objects
❌ Not reconciling amount_target
❌ Using callbacks without signature verification


10. Best Practices Summary

✅ Always send net payout amount
✅ Store CRM and B2BINPAY commissions separately
✅ Use tracking_id for reconciliation
✅ Trust callbacks + transfers, not estimates
✅ Treat B2BINPAY commission as dynamic


Conclusion

A correct B2BINPAY integration requires a clear separation of responsibilities:

  • Your CRM controls business logic and client commissions
  • B2BINPAY controls blockchain execution and network fees

By following this structure, your payout system will be:

  • Accurate
  • Auditable
  • Scalable
  • Production-safe

For full endpoint details, always refer to the official documentation:
👉 https://docs.b2binpay.com/api-guide/payout-methods

Articles in this section

Was this article helpful?
0 out of 0 found this helpful
Share

Comments

0 comments

Article is closed for comments.