Search code examples
paypalbraintree

How to distinguish my BrainTree merchant account?


I am developing 2 app both of them has been deployed with BrainTree V zero Payment feature. I have prepared too Braintree merchant Account within one Braintree Account User.

I only have one Hosting Server Braintree side instance.

My question is about how to distinguish them by my Get_Token or Payment API?

Thank you in advanced!


Solution

  • Full disclosure: I work at Braintree. If you have any further questions, feel free to contact support.

    It sounds like you have one merchant ID and two merchant account IDs.

    When creating transactions, you can pass a merchant_account_id to distinguish between your two Merchant Accounts. Here's an example from the Braintree Developer Docs:

    result = Braintree::Transaction.sale(
      :amount => "10.00",
      :merchant_account_id => "your_merchant_account",
      :payment_method_nonce => nonce_from_the_client
    )
    

    For sake of clarity, here's the difference between a Merchant ID and Merchant Account ID, also from the docs.

    Merchant account ID vs. merchant ID

    While merchant account ID and merchant ID sound similar, they are different values with distinct purposes.

    Your merchant ID is a unique identifier for your entire gateway account. This value is required for every API request, along with your API credentials.

    Your merchant account ID is a unique identifier for a specific merchant account. Within your Braintree gateway, you can have multiple merchant accounts to process transactions for different businesses or currencies. If you have a single merchant account, it is not necessary to specify a merchant account ID in your API requests. If you have multiple merchant accounts and choose not to specify the merchant account ID, all requests will process through your default merchant account.