Get Started with Braintree

This guide is currently set to show iOS client code and Node.js server code. If that's not correct, choose your preferred languages from the selector at the top right of this page.

Braintree's v.zero consists of complementary client and server SDKs:

  • The iOS client SDK enables you to collect payment method (e.g. credit card, PayPal) details in your app
  • The server SDKs manage all requests to the Braintree gateway

Before we get started, there are two key concepts to introduce—the client token and the payment method nonce.

Client token

A client token is a signed data blob that includes configuration and authorization information required by the Braintree Client SDK. These should not be reused; a new client token should be generated for each customer request that's sent to Braintree. For security, we will revoke client tokens if they are reused excessively within a short time period.

Your server is responsible for generating the client token, which contains all of the necessary configuration information to set up the client SDKs. When your server provides a client token to your client, it authenticates the application to communicate directly to Braintree.

Your client is responsible for obtaining the client token and initializing the client SDK. If this succeeds, the client will generate a payment_method_nonce.

Payment method nonce

The payment method nonce is a string returned by the client SDK to represent a payment method. This string is a reference to the customer payment method details that were provided in your payment form and should be sent to your server where it can be used with the server SDKs to create a new transaction request.

Payment method nonces expire after 24 hours.

Your server integration doesn't need to know the payment method type (e.g. credit card, PayPal account, Bitcoin) that is represented in the nonce. This means that your first v.zero integration should continue to work with few or no code changes when new payment method types are introduced.

How it works

  1. Your app or web front-end requests a client token from your server in order to initialize the iOS SDK
  2. Your server generates and sends a client token back to your client with the Node.js SDK
  3. Once the iOS SDK is initialized and the customer has submitted payment information, the SDK communicates that information to Braintree, which returns a payment method nonce
  4. You then send the payment nonce to your server
  5. Your server code receives the payment method nonce from your client and then uses the Node.js SDK to create a transaction or perform other Braintree functions detailed in the guides

API keys

Get your sandbox or production API keys from the Control Panel to complete your integration. Once you're ready to go live, be sure to switch from your sandbox API keys to production.

Next: Set Up Your Client →


Still Have Questions?

If you can’t find an answer, give us a call at 877.434.2894 or email our Support team.