A record that includes all details of a transaction, including current status.

Returned within a successful result object from the following requests:

Attributes
addOns
Array of AddOn objects

The collection of add-ons associated with a subscription.

additionalProcessorResponse
String

Optional additional processor response information, provided as further context for the primary processor response.

amount
String

The billing amount of the request.

androidPayCard

If paymentInstrumentType is "android_pay_card", these are the details of the credit card used for the transaction.

bin
String

The first 6 digits of the device-specific account number (DPAN), known as the Bank Identification Number.

expirationMonth
String

The expiration month of the credit card, formatted MM.

expirationYear
String

The 2- or 4-digit year associated with the credit card, formatted YY or YYYY.

googleTransactionId
String

A unique identifier provided by Google to track the payment method's transactions.

imageUrl
String

A URL that points to a payment method image resource (a PNG file) hosted by Braintree.

sourceCardLast4
String

The last 4 digits of the payment method tokenized by the network.

sourceCardType
String

The type of the card tokenized by the network.

sourceDescription
String

Indicates what type of payment method was tokenized by the network. Also includes an identifier for the account (e.g. last 4 digits if the payment method was a credit card).

token
String

An alphanumeric value that references a specific payment method stored in your Vault. Value will be nil if the transaction was not created from a vaulted Android Pay card.

virtualCardLast4
String

The last 4 digits of the device-specific account number (DPAN).

virtualCardType
String

The card type of the device-specific account number (DPAN).

applePay

If paymentInstrumentType is "apple_pay_card", these are the details of the credit card used for the transaction.

cardType
String

The type of the credit card. Possible values:

  • Apple Pay - Visa
  • Apple Pay - MasterCard
  • Apple Pay - American Express
  • Apple Pay - Discover
cardholderName
String

The cardholder name associated with the credit card.

expirationMonth
String

The expiration month of the credit card, formatted MM.

expirationYear
String

The 4-digit expiration year of the credit card, formatted YYYY.

last4
String

The last 4 digits of the device-specific account number (DPAN).

paymentInstrumentName
String

A description of the payment method intended for display to the user, typically card type and last 4 digits of the physical card number stored by Passbook. Braintree receives this description alongside the DPAN when processing an Apple Pay transaction.

sourceDescription
String

Indicates what type of payment method was tokenized by the network. Also includes an identifier for the account (e.g. last 4 digits if the payment method was a credit card).

token
String

An alphanumeric value that references a specific payment method stored in your Vault. Value will be nil if the transaction was not created from a vaulted Apple Pay card.

avsErrorResponseCode

This field is populated if there was an error when checking AVS or the processing bank does not support AVS. Possible values:

  • S = Issuing bank does not support AVS
  • E = AVS system error


If this value is null, you will see responses in both avsPostalCodeResponseCode and avsStreetAddressResponseCode.

avsPostalCodeResponseCode

This is populated if the processor supports the address verification system (AVS). Possible values:

  • M = Matches
  • N = Does not match
  • U = Not verified
  • I = Not provided
  • A = Not applicable
avsStreetAddressResponseCode

This is populated if the processor supports the address verification system (AVS). Possible values:

  • M = Matches
  • N = Does not match
  • U = Not verified
  • I = Not provided
  • A = Not applicable
billing

The billing address details used to process this transaction. If billing address was stored in the Vault, then the billing_details is a snapshot of the address in the Vault at the time the transaction was created.

company
String

The billing company name. See the transaction API requests section for details.

countryCodeAlpha2
String

The 2-letter billing country code. See the transaction API requests section for details.

countryCodeAlpha3
String

The 3-letter billing country code. See the transaction API requests section for details.

countryCodeNumeric
String

The numeric billing country code. See the transaction API requests section for details.

countryName
String

The billing country name. See the transaction API requests section for details.

extendedAddress
String

The extended billing address. See the transaction API requests section for details.

firstName
String

The first name. See the transaction API requests section for details.

id
String

The billing details ID. A customer Vault record can contain up to 50 shipping and billing addresses, each with a unique ID. See the transaction API requests section for details.

lastName
String

The last name. See the transaction API requests section for details.

locality
String

The locality/city. See the transaction API requests section for details.

postalCode
String

The postal code. See the transaction API requests section for details.

region
String

The state or province. See the transaction API requests section for details.

streetAddress
String

The street address. See the transaction API requests section for details.

channel
String

If the transaction request was created through a shopping cart provider or Braintree Partner, this field will have a string identifier for that shopping cart provider or Partner. For PayPal transactions, this maps to the PayPal account's bn_code.

createdAt
Date

The date/time the object was created.

creditCard

If paymentInstrumentType is "credit_card", these are the details of the card used for the transaction. If the transaction was created using Vault tokens, then this attribute is a snapshot of the credit card in the Vault at the time the transaction was created.

bin

The first 6 digits of the credit card, known as the Bank Identification Number.

cardType

The type of the credit card. Possible values:

  • American Express
  • Carte Blanche
  • China UnionPay
  • Diners Club
  • Discover
  • JCB
  • Laser
  • Maestro
  • MasterCard
  • Solo
  • Switch
  • Visa
  • Unknown
cardholderName
String

The cardholder name associated with the credit card.

commercial
enum

Whether the card type is a commercial card and is capable of processing Level 2 transactions. Possible values:

  • CreditCard.Commercial.Yes
  • CreditCard.Commercial.No
  • CreditCard.Commercial.Unknown
countryOfIssuance
String

The country that issued the credit card. Possible country values follow ISO 3166-1.

customerLocation

This is "US" if the billing address is in the US or if a country is not specified. The location is "International" if the billing country passed is not the US.

debit
enum

Whether the card is a debit card. Possible values:

  • CreditCard.Debit.Yes
  • CreditCard.Debit.No
  • CreditCard.Debit.Unknown
durbinRegulated
enum

A value indicating whether the issuing bank's card range is regulated by the Durbin Amendment due to the bank's assets. Possible values:

  • CreditCard.DurbinRegulated.Yes
  • CreditCard.DurbinRegulated.No
  • CreditCard.DurbinRegulated.Unknown
expirationDate
String

The expiration date, formatted MMYY or MMYYYY. May be used instead of expiration_month and expiration_year.

expirationMonth
String

The expiration month of the credit card used, formatted MM.

expirationYear
String

The expiration year of the credit card used, formatted YYYY.

healthcare
enum

Whether the card is a healthcare card. Possible values:

  • CreditCard.HealthCare.Yes
  • CreditCard.HealthCare.No
  • CreditCard.HealthCare.Unknown
imageUrl

A URL that points to an image resource (a PNG file) hosted by Braintree, which represents the issuing card network (Visa, MasterCard, American Express, Discover, JCB).

issuingBank
String

The bank that issued the credit card.

last4

The last 4 digits of the credit card number.

maskedNumber

A value comprised of the bank identification number (BIN), 6 asterisks blocking out the middle numbers (regardless of the number of digits present), and the last 4 digits of the card number. This complies with PCI security standards.

payroll
enum

Whether the card is a payroll card. Possible values:

  • CreditCard.Payroll.Yes
  • CreditCard.Payroll.No
  • CreditCard.Payroll.Unknown
prepaid
enum

Whether the card is a prepaid card. Possible values:

  • CreditCard.Prepaid.Yes
  • CreditCard.Prepaid.No
  • CreditCard.Prepaid.Unknown
token
String

The Vault token for the credit card. This attribute is not a snapshot. If you update the payment method token after creating a transaction, credit_card_details.token attribute will return the new value rather than the value associated with the transaction at the time it was created. See the transaction API requests section for additional details.

uniqueNumberIdentifier

A randomly-generated string that uniquely identifies a credit card number in the Vault. If the same credit card is added to a merchant's Vault multiple times, each Vault entry will have the same unique identifier. This value is randomly generated by merchant gateway account, so it will be different for each merchant's Vault.

currencyIsoCode

The currency for the transaction (e.g. "USD" for US dollars). See the ISO 4217 codes.

customFields

A collection of custom field/value pairs.

customer

The customer details used to process this transaction. If the transaction was created using Vault tokens, then the customer_details is a snapshot of the customer in the Vault at the time the transaction was created.

company
String

The customer company name. See the transaction API requests section for details.

email
String

The email address. See the transaction API requests section for details.

fax
String

The customer fax number. See the transaction API requests section for details.

firstName
String

The first name. See the transaction API requests section for details.

id
String

Reference value that is associated with the customer's id at the time of the transaction.

lastName
String

The last name. See the transaction API requests section for details.

phone
String

The customer phone number. See the transaction API requests section for details.

website
String

The customer website address. See the transaction API requests section for details.

cvvResponseCode

The processing bank's response to the card verification value (CVV) provided by the customer. Possible values:

  • M = Matches
  • N = Does not match
  • U = Not verified
  • I = Not provided
  • S = Issuer does not participate
  • A = Not applicable
descriptor
name
String

The value in the business name field of a customer's statement.

phone
String

The value in the phone number field of a customer's statement.

url
String

The value in the URL/web address field of a customer's statement.

disbursementDetails

Disbursement details contain information about how and when the transaction was disbursed, including timing and currency information. This detail is only available if you have an eligible merchant account.

disbursementDate

The date that the funds associated with this transaction were disbursed. This attribute is only available if you have an eligible merchant account.

fundsHeld
bool

A value indicating whether funds have been withheld from a disbursement to the merchant's bank account.

settlementAmount
String

The amount of the transaction in the settlement currency. This attribute is only available if you have an eligible merchant account.

settlementCurrencyExchangeRate

The exchange rate from the presentment currency to the settlement currency. This attribute is only available if you have an eligible merchant account.

settlementCurrencyIsoCode

The settlement currency. See the ISO 4217 codes. This attribute is only available if you have an eligible merchant account.

success

A value indicating whether the funds were disbursed successfully. This value can change over time if we receive an exception and then retry the disbursement. This attribute is only available on eligible merchant accounts.

Some of the most common reasons that funds are held from disbursement are risk reviews of the merchant's recent processing or as a result of ACH returns or rejects. If funds are held (for any reason) you will be notified with the proper steps to take by the appropriate team within Braintree.

discounts
Array of Discount objects

A collection of discounts associated with this subscription.

disputes

A collection of disputes associated with the transaction.

  • dispute.amount - Amount customer requested when disputing the transaction. This can be any amount up to the full amount of the original transaction.
  • dispute.currencyIsoCode - The currency of the amount.
  • dispute.dateOpened - The date the dispute was opened.
  • dispute.dateWon - The date the dispute was won. Only available on disputes that were won.
  • dispute.id - A unique ID for each dispute.
  • dispute.kind - The kind of dispute. Possible values: chargeback, pre_arbitration, retrieval. For more information see the article on dispute kinds.
  • dispute.receivedDate - The date we received the dispute.
  • dispute.replyByDate - The date a reply with evidence is due.
  • dispute.reason - The reason the dispute was created. Possible values:
    • cancelled_recurring_transaction - The cardholder was billed for a recurring charge they canceled or attempted to cancel.
    • credit_not_processed - The cardholder was told they were to receive a credit and did not.
    • duplicate - The individual charge was submitted more than once.
    • fraud - The cardholder is claiming this transaction to be fraudulent.
    • general - A generic response was provided by the card-issuing bank.
    • invalid_account - Card was expired, had an invalid account number, or had an account number that did not match the card number of the original transaction.
    • not_recognized - The cardholder claims they do not recognize/did not participate in this charge.
    • product_not_received - The cardholder did not receive (or only partially received) the goods/services they paid for.
    • product_unsatisfactory - The cardholder received the goods/services, but the product was defective, different than described, or otherwise did not meet expectations.
    • transaction_amount_differs - The cardholder claims the charge the merchant submitted was different than what the cardholder agreed to pay.
  • dispute.status - The latest status of the dispute. Possible values:
    • open - Dispute has been opened by the customer and funds have been debited from your account
    • lost - The bank has reviewed evidence and declined to reverse the dispute or you didn't provide evidence
    • won - The bank has reversed the dispute and funds have been credited to your account
escrowStatus

This attribute is only available to Braintree Marketplace merchants. See Holding Funds in Escrow to learn more. Possible values:

  • "hold_pending"
  • "held"
  • "release_pending"
  • "released"
  • "refunded"
gatewayRejectionReason

This value will only be set if the transaction status is gateway_rejected. Possible values:

  • "avs"
  • "avs_and_cvv"
  • "cvv"
  • "duplicate"
  • "fraud"
  • "three_d_secure"
  • "application_incomplete"
merchantAccountId
String

The merchant account ID used to create a transaction. Currency is also determined by merchant account ID.

orderId
String

The order ID of the transaction. On PayPal transactions, this field maps to the PayPal invoice ID. PayPal invoice IDs are unique in your PayPal business account.

paymentInstrumentType

The method of payment used to process the transaction. Possible values:

  • "android_pay_card"
  • "apple_pay_card"
  • "credit_card"
  • "paypal_account"
  • "venmo_account"
paypalAccount

If paymentInstrumentType is "paypal_account", these are the details of the PayPal account used for the transaction.

authorizationId
String

The identification value of the authorization within PayPal's API.

captureId
String

PayPal id for a transaction.

customField
String

Custom field/value pairs.

imageUrl
String

A URL that points to a PayPal image resource (a PNG file) hosted by Braintree.

payerEmail
String

The email address associated with the PayPal account that was used to create the request. This field will not be populated if the PayPal transaction declines and the payment method was not previously stored in the Vault.

payerFirstName
String

The first name associated with the PayPal account used to create the request.

payerId
String

The identifier for the PayPal account used in the request.

payerLastName
String

The last name associated with the PayPal account used to create the request.

paymentId
String

The identification value of the payment within PayPal's API.

refundId
String

PayPal id for a refund.

sellerProtectionStatus
String

Indicates whether a transaction qualifies for PayPal Seller Protection.

taxId
String

Payer's tax id. Only returned for payments from Brazilian accounts.

taxIdType
String

Payer's tax id type. Only returned for payments from Brazilian accounts. Allowed values BR_CPF or BR_CNPJ.

token
String

An alphanumeric value that references a specific payment method stored in your Vault. Length and format of gateway-generated tokens and IDs may change at any time.

transactionFeeAmount
String

The transaction fee amount of the PayPal transaction.

A transaction fee of 1 will always be returned in sandbox integrations.

transactionFeeCurrencyIsoCode
String

The currency of the associated transaction fee.

planId
String

The plan identifier.

processorAuthorizationCode

The authorization code returned by the processor.

processorResponseCode
String

The processor response code. See the list of possible processor authorization responses.

processorResponseText
String

The processor response text. See the list of possible processor authorization responses.

processorSettlementResponseCode
String

The status of the request to capture the funds. See the list of possible processor settlement responses.

processorSettlementResponseText
String

The text explanation of the above processor settlement response code.

purchaseOrderNumber
String

A Level II data field that can be used to store a purchase order identification value.

recurring

A value indicating whether the transaction was passed with a recurring e-commerce indicator (ECI) flag.

refundIds

The transaction refund ID(s) associated with a sale transaction. See the transaction API requests section for details.

refundedTransactionId
String

The sale transaction ID associated with a refund transaction. See the transaction API requests section for details.

riskData

Risk data on credit card transactions. The data includes the risk identifier and the risk decision, which can provide further context on how a transaction was scored by Braintree.

decision
String

The risk decision. Possible values:

  • Not Evaluated
  • Approve
  • Review
  • Decline
id
String

The risk data identifier.

serviceFeeAmount
String

The portion of a sub-merchant's transaction revenue that was routed to the master merchant account.

Available to Braintree Marketplace merchants and Partners. See Service Fee for more details.

settlementBatchId
String

The identification value of the settlement batch in which the transaction was processed. The format may change at any time but is currently YYYY-MM-DD_md where m is the merchant account token without special characters and d is an optional digit to guarantee uniqueness.

shipping

The shipping address details used to process this transaction. If shipping address was stored in the Vault, then the shipping_details is a snapshot of the address in the Vault at the time the transaction was created.

company
String

The shipping company name. See the transaction API requests section for details.

countryCodeAlpha2
String

The 2-letter shipping country code. See the transaction API requests section for details.

countryCodeAlpha3
String

The 3-letter shipping country code. See the transaction API requests section for details.

countryCodeNumeric
String

The numeric shipping country code. See the transaction API requests section for details.

countryName
String

The shipping country name. See the transaction API requests section for details.

extendedAddress
String

The extended shipping address. See the transaction API requests section for details.

firstName
String

The first name. See the transaction API requests section for details.

id
String

The shipping details ID. A customer Vault record can contain up to 50 shipping and billing addresses, each with a unique ID. See the transaction API requests section for details.

lastName
String

The last name. See the transaction API requests section for details.

locality
String

The locality/city. See the transaction API requests section for details.

postalCode
String

The postal code. See the transaction API requests section for details.

region
String

The state or province. See the transaction API requests section for details.

streetAddress
String

The street address. See the transaction API requests section for details.

status
String

Possible values:

  • "authorization_expired"
  • "authorized"
  • "authorizing"
  • "settlement_pending"
  • "settlement_confirmed"
  • "settlement_declined"
  • "failed"
  • "gateway_rejected"
  • "processor_declined"
  • "settled"
  • "settling"
  • "submitted_for_settlement"
  • "voided"

See the transaction status explanations for details.

statusHistory

This value is a record of the statuses that a transaction has progressed through. Possible values:

  • "authorization_expired"
  • "authorized"
  • "authorizing"
  • "settlement_pending"
  • "settlement_confirmed"
  • "settlement_declined"
  • "failed"
  • "gateway_rejected"
  • "processor_declined"
  • "settled"
  • "settling"
  • "submitted_for_settlement"
  • "voided"
subscription
billingPeriodEndDate

The end date for the current billing period, regardless of subscription status. Automatic retries on past due subscriptions do not change the start and end dates of the current billing period.

billingPeriodStartDate

The start date for the current billing period, regardless of subscription status. Automatic retries on past due subscriptions do not change the start and end dates of the current billing period.

subscriptionId
String

The value used to identify a specific subscription.

taxAmount
String

A Level II data field that specifies the amount of tax that was included in the total transaction amount. It is never negative, and it does not add to the total transaction amount.

taxExempt
bool

A Level II data field that indicates whether or not the transaction should be considered eligible for tax exemption. This does not affect the total transaction amount.

threeDSecureInfo

The 3D Secure information for this transaction.

enrolled
String

Indicates whether a card is enrolled in a 3D Secure program or not. Possible values:

  • Y = Yes
  • N = No
  • U = Unavailable
  • B = Bypass
  • E = RequestFailure
liabilityShiftPossible
bool

Indicates whether a liability shift is possible.

liabilityShifted
bool

Indicates whether the liability shifted or not.

status
String

The 3D Secure status value. For a list of all possible statuses and their liability shifts, see the 3D Secure guide.

type
String

The value that defines whether a transaction is a sale or credit.

updatedAt
Date

The date/time the object was last updated.

venmoAccount

If paymentInstrumentType is "venmo_account", these are the details of the Venmo account used for the transaction.

Venmo payments are currently in a limited release and are only available to select merchants. See the Venmo guide for details.

imageUrl
String

A URL that points to a payment method image resource (a PNG file) hosted by Braintree.

sourceDescription
String

A short description of the payment method, including the Venmo username.

token
String

An alphanumeric value that references a specific payment method stored in your Vault. Value will be nil if the transaction was not created from a vaulted Venmo account.

username
String

The Venmo username of the Venmo account.

venmoUserId
String

The Venmo user ID of the Venmo account.

voiceReferralNumber

The value passed by the merchant with a voice-authorized transaction.

Result object

Read more about result objects.

Successful result

If the result is successful, the transaction will have either an authorized status, or (if the options.submitForSettlement option was used) a submitted for settlement status.

Node.js
result.success;
// true

result.transaction.status;
// "authorized"

Additionally, you may inspect the result to determine if the transaction was created using a specific payment method type (e.g. PayPal account or a credit card), using the provided format.

Node.js
var transaction = result.transaction;
transaction.paymentInstrumentType === braintree.PaymentInstrumentTypes.PayPalAccount;
// false
transaction.paymentInstrumentType === braintree.PaymentInstrumentTypes.CreditCard;
// true

Unsuccessful result

Success will return false if:

Node.js
result.success;
// false

result.errors.deepErrors();

Validation errors

If any parameters are invalid, then the success call will return false and the result object will contain one or more validation errors indicating which parameters were invalid.

When receiving a validation error, a Transaction object will not be present on the result object.

Processor declined

If the processor declines the transaction during the authorization, the processor response will be available on the transaction object.

Node.js
result.success;
// false

result.transaction.status;
// "processor_declined"

result.transaction.processorResponseCode;
// e.g. "2001"

result.transaction.processorResponseText;
// e..g "Insufficient Funds"

As a supplement to the standardized processor response codes, we will return bank-specific Additional Processor Responses on the transaction object. The standardized code is what you should use when handling the result object, but the Additional Processor Response might provide further context.

Node.js
result.transaction.additionalProcessorResponse;
# e.g. "05 : NOT AUTHORISED"

Processor settlement declined

If the processor declines the transaction at the settlement stage, the processor response will be available on the transaction object.

Node.js
result.success;
// false

result.transaction.status;
// "settlement_declined"

result.transaction.processorSettlementResponseCode;
// e.g. "4001"

result.transaction.processorSettlementResponseText;
// e..g "Settlement Declined"

Gateway rejection

If the transaction is rejected by the gateway based on your account settings, you can check for the transaction status and gateway rejection reason.

Node.js
result.success;
// false

result.transaction.status;
// "gateway_rejected"

result.transaction.gatewayRejectionReason;
// e.g. "cvv"

Risk data

We will also return the risk data on all credit card transactions. The data includes the risk identifier and the risk decision, which can provide further context on how a transaction was scored by Braintree.

Node.js
result.transaction.riskData.id;
// "1SG23YHM4BT5"
result.transaction.riskData.decision;
// "Decline"

The possible values of the risk decision are:

  • "Not Evaluated"
  • "Approve"
  • "Review"
  • "Decline"

Params retrieval

See our documentation on result objects.

Examples

Currencies

Each merchant account can only process transactions for a single currency. Setting which merchant account to use will also determine which currency the transaction is processed with.

Node.js
result.transaction.currencyIsoCode;
// USD

Settlement status

Check the result for success, and if it has failed, then first check for validation errors. If there are no validation errors, inspect the processorSettlementResponseCode on the transaction, which will indicate if the processor declined the request.

Node.js
gateway.transaction.submitForSettlement("theTransactionId", function (err, result) {
  if (result.success) {
    // submitted successfully
  } else if result.errors.deepErrors() > 0 {
    console.log(result.errors);
  } else {
    console.log(result.transaction.processorSettlementResponseCode);
    console.log(result.transaction.processorSettlementResponseText);
  }
});

Processor settlement declined

If the settlement request is declined by the processor, the processor response will be available on the transaction object.

Node.js
result.success;
// false

result.transaction.status;
// "settlement_declined"

result.transaction.processorSettlementResponseCode;
// e.g. "4001"

result.transaction.processorSettlementResponseText;
// e..g "Settlement Declined"

Voiding settlement

If you submit a transaction for settlement and then decide you actually don't want to settle it, you can void it before it's settled. After it's settled, you'll need to refund it. To check if the transaction has been settled, find the transaction and check the status.

Node.js
gateway.transaction.find("theTransactionId", function (err, transaction) {
  if (transaction.status === "submitted_for_settlement") {
    // can void
  } else if (transaction.status === braintree.Transaction.Status.Settled) {
    // have to refund
  }
});

See also

Still Have Questions?

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