Braintree
App · Payments & Billing · 5 actions
Accept card and digital-wallet payments and automate refunds with Braintree, a PayPal service.
Actions
| Action | What it does |
|---|---|
| Create a Braintree transaction | Charge a payment method (a client-generated nonce or a vaulted token) for a given amount. |
| 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). |
| Refund a Braintree transaction | Refund a settled transaction, in full or in part. |
| Reverse a Braintree transaction | Cancel a transaction. |
| Search Braintree transactions | Search 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 method
payment_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.
- Amount
amounttextRequired - The amount to charge as a decimal string, for example '10.00'. Use the account's default currency.
- Order ID
order_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 ID
merchant_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 ID
transaction_idtextRequired - The ID of the settled transaction to refund.
- Amount
amounttext - 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 ID
transaction_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
- Status
statustext - 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 results
firstnumber - 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"
}
]