Braintree

App · Payments & Billing · 5 actions

Accept card and digital-wallet payments and automate refunds with Braintree, a PayPal service.

Actions

ActionWhat it does
Create a Braintree transactionCharge a payment method (a client-generated nonce or a vaulted token) for a given amount.
Generate a Braintree client tokenGenerate a client token used to initialize Braintree's client-side SDKs (Drop-in UI, Hosted Fields, or the mobile SDKs).
Refund a Braintree transactionRefund a settled transaction, in full or in part.
Reverse a Braintree transactionCancel a transaction.
Search Braintree transactionsSearch recent transactions, optionally filtered by status.

Create a Braintree transaction

Charge a payment method (a client-generated nonce or a vaulted token) for a given amount.

Inputs

Payment methodpayment_method_idtextRequired
A single-use payment method nonce or a vaulted payment method token to charge. In the sandbox you can use 'fake-valid-nonce' to simulate a successful card.
AmountamounttextRequired
The amount to charge as a decimal string, for example '10.00'. Use the account's default currency.
Order IDorder_idtext
Your own order or invoice reference (optional).

Outputs

Braintree transaction object with its id, status, amount, and order id.

Example output
{
  "amount": {
    "currencyIsoCode": "USD",
    "value": "10.00"
  },
  "id": "test_txn_id",
  "status": "SUBMITTED_FOR_SETTLEMENT"
}

Generate a Braintree client token

Generate a client token used to initialize Braintree's client-side SDKs (Drop-in UI, Hosted Fields, or the mobile SDKs).

Inputs

Merchant account IDmerchant_account_idtext
Scope the token to a specific merchant account, for example a non-default currency (optional).

Outputs

Object with a 'clientToken' string to hand to a Braintree client SDK.

Example output
{
  "clientToken": "test_client_token_value"
}

Refund a Braintree transaction

Refund a settled transaction, in full or in part. Use Reverse a transaction instead if it has not settled yet.

Inputs

Transaction IDtransaction_idtextRequired
The ID of the settled transaction to refund.
Amountamounttext
The amount to refund as a decimal string, for example '5.00'. Leave blank to refund the full amount.

Outputs

Braintree refund object with its id, status, and amount.

Example output
{
  "amount": {
    "currencyIsoCode": "USD",
    "value": "5.00"
  },
  "id": "test_refund_id",
  "status": "SUBMITTED_FOR_SETTLEMENT"
}

Reverse a Braintree transaction

Cancel a transaction. Braintree voids it if it has not settled yet, or refunds it in full if it already has.

Inputs

Transaction IDtransaction_idtextRequired
The ID of the transaction to reverse.

Outputs

Braintree reversal object: either the voided transaction or a refund, distinguished by its __typename.

Example output
{
  "__typename": "Transaction",
  "amount": {
    "currencyIsoCode": "USD",
    "value": "10.00"
  },
  "id": "test_txn_id",
  "status": "VOIDED"
}

Search Braintree transactions

Search recent transactions, optionally filtered by status.

Inputs

Statusstatustext
Filter by transaction status, for example 'SETTLED', 'SUBMITTED_FOR_SETTLEMENT', 'VOIDED', or 'PROCESSOR_DECLINED'. Leave blank to return the most recent transactions of any status.
Maximum resultsfirstnumber
Maximum transactions to return (Braintree caps a page at 50).From 1 to 50. Default: 20.

Outputs

Array of Braintree transaction objects.

Example output
[
  {
    "amount": {
      "currencyIsoCode": "USD",
      "value": "10.00"
    },
    "id": "test_txn_id",
    "status": "SETTLED"
  }
]

On this page