#Braintree GraphQL API

Number of APIs: 3

This collection contains examples of all the mutations and queries in the Braintree GraphQL API. The examples list all the input and output fields that the mutation or query supports.

Step-by-step instructions of using this collection

Here are the steps to make your first API call.

Step 1: Add your API key to Qodex

To invoke the Braintree API from Qodex, you need to add your API key to Qodex. Here are the steps to add your API key to Qodex:

  1. Get your sandbox API by following the steps described in the Braintree API documentation .
  2. In Qodex, select an environment or create a new one and navigate to the Variables tab.
  3. Add a new variable called apiKey of type secret and enter the API key as the value.
  4. Save the changes in the environment.

Step 2: Make your first API call - Tokenize credit card

  1. Navigate to the tokenizeCreditCard mutation in the Mutations folder.
  2. Click on the Body tab to edit the query.
  3. Populate the following input fields under creditCard :
    1. number : 4111111111111111
    2. expirationYear : \[a year in the future\]
    3. expirationMonth : \[a month in the future\]
  4. Remove the following input fields or fill in appropriate values as leaving them blank will result in an error:
    1. cvv
    2. cardholderName
    3. billingAddress
  5. Click Send to execute the query.

The query should return a object that contains the payment method ID that represents the credit card.

How should I use this collection?

The Braintree GraphQL mutations and queries accept several input fields and return several output fields to support a variety of use-case. Typically, the use-case that you’re working on will need a subset of these fields.

The best way to use this collection is to remove the input and output fields that you don’t require and execute the query.

  1. Mutations - createNonInstantLocalPaymentContext POST {{baseUrl}}/graphql

  2. Queries-Search Queries - inStoreReaderSearch POST payments.sandbox.braintree-api.com/graphql

  3. Queries - inStoreLocations POST {{baseUrl}}/graphql