Braintree Integration
This document provides partners to ability to integrate with Braintree for payments.
Creating a Braintree token
If You Have An Existing Braintree Integration
Partners who use Braintree can use the Braintree Grant API to share access to a payment method with Ticketmaster. To share info, Ticketmaster will need access to the partner’s OAuth application to consent to receiving a granted payment method. You can send the link to your application to partnersupport@ticketmaster.com.
If You Do Not Have An Existing Braintree Integration:
Partners who don’t use Braintree have two options to create a Braintree token:
Option 1: Client-side Tokenization using Braintree Client SDK
Partners can use the Braintree Client SDK to collect payment information from users at no additional cost. Braintree provides a client SDK for Android, iOS, and JavaScript.
The client SDK requires authorization for payment method tokenization. Ticketmaster uses a client token for authorization. Your application can request a client token from the Payment Initialization API, which provides initialization information for the client SDK and authenticates your application to communicate directly to Braintree. A new client token should be generated for each request your application sends to Braintree. Client tokens should not be reused.
Once the client SDK is initialized and the customer has submitted payment information, the SDK communicates that information to Braintree and returns a payment token. You can use the payment token as the payment method for the order.
Steps to generate a payment token:
- Your app requests a client token from the Payment Initialization API to initialize the client SDK (see Payment Initialization [POST]example below)
- The client SDK communicates the client token and payment information to Braintree to generate a payment token
- Follow the process outlined in the payment method flow to add the Braintree token as the method of payment for the order
Option 2: Server-side Tokenization using Braintree GraphQL API
You can make a server-side call with the Braintree GraphQL API to generate a Braintree token. You will need to obtain a tokenization key from Ticketmaster to authorize your application to create a payment token. Your application may reuse the tokenization key with each request to generate a Braintree token. You do not need to generate a new key for each request. Send an email to partnersupport@ticketmaster.com to request a tokenization key.
Steps to generate a payment tokens:
- Obtain Braintree tokenization key from Ticketmaster
- Your app makes a server-side call with the Braintree GraphQL API to generate a payment token (see GraphQL request example below)
- Follow the process outlined in the payment method flow to add the Braintree token as the method of payment for the order
Payment Initialization [POST]
partners/v1/payment/token?apikey={apikey}
Polling: No
Parameters
Parameter | Description | Type | Example | Required |
---|---|---|---|---|
apikey |
Your API key | string | “GkB8Z037ZfqbLCNtZViAgrEegbsrZ6Ne” | Yes |
cart_id |
Card identifier. Must be url encoded | string | “bzJVZURoNit1UkhQQ25pcE5KSHh1K09SVE9lQ0k2RktwSEZFdnAwTlNJYS82ZE5WWldiREtSTQo%3D” | Optional *Note: cart_id is optional for US/CA but required for countries outside of US/CA |
*Note: If “includeADA” is not specified, then the response will return non-ADA only.
Initialization Response structure:
- ` initialization ` (array) - Initialization.
provider_id
(string) - Provider Idclient_token
(string) - Token
GraphQL request
This will return a Braintree payment token that you can use as the payment method for the order.