Returns a collection of Transaction response objects.

For operators available on search fields, see the search fields page.

C♯
var request = new TransactionSearchRequest().
    CustomerId.Is("the_customer_id");

ResourceCollection<Transaction> collection = gateway.Transaction.Search(request);

foreach (Transaction transaction in collection)
{
    Console.WriteLine(transaction.Amount);
}
Parameters
Amount range

The amount of the transaction. The amount must be formatted like xx or x.xx.

AuthorizationExpiredAt range

The date/time the transaction's authorization expired.

AuthorizedAt range

The date/time the transaction was authorized.

BillingCompany text

The company name on the billing address used for the transaction.

BillingCountryName text

The country name on the billing address used for the transaction.

BillingExtendedAddress text

The extended address on the billing address used for the transaction.

BillingFirstName text

The first name on the billing address used for the transaction.

BillingLastName text

The last name on the billing address used for the transaction.

BillingLocality text

The locality (e.g. city) on the billing address used for the transaction.

BillingPostalCode text

The postal code on the billing address used for the transaction.

BillingRegion text

The region (e.g. state) on the billing address used for the transaction.

BillingStreetAddress text

The street address on the billing address used for the transaction.

CreatedAt range

The date/time at which the transaction was created.

CreatedUsing multiple

The data used to create the transaction. Possible values:

  • TransactionCreatedUsing.TOKEN
  • TransactionCreatedUsing.FULL_INFORMATION
CreditCardCardType multiple

The type of credit card used in the transaction. Possible values:

  • "American Express"
  • "Discover"
  • "Maestro"
  • "JCB"
  • "MasterCard"
  • "UnionPay"
  • "Visa"
CreditCardCardholderName text

The cardholder name in the transaction. This only applies to credit card transactions.

CreditCardCustomerLocation multiple

The location of the customer in the transaction. Possible values:

  • international
  • us
CreditCardExpirationDate text

The expiration date of the card used in the transaction. This only applies to credit card transactions.

CreditCardNumber text

The number of the card used in the transaction.

Card number search is restricted: starts with searches up to the first 6 digits, ends with searches last 4 digits, and contains is not allowed.

CreditCardUniqueIdentifier text

The unique identifier of the card number. See the transaction response reference for more details.

Currency text

The currency of the transaction.

CustomerCompany text

The customer's company associated with the transaction.

CustomerEmail text

The customer's email address associated with the transaction.

CustomerFax text

The customer's fax number associated with the transaction.

CustomerFirstName text

The customer's first name associated with the transaction.

CustomerId text

A string value representing an existing customer in your Vault that is associated with the transaction.

CustomerLastName text

The customer's last name associated with the transaction.

CustomerPhone text

The customer's phone number associated with the transaction.

CustomerWebsite text

The customer's website associated with the transaction.

DisbursementDate range

Only available for certain account types; contact us for details.

The date the transaction was disbursed to your bank account. This field does not include a time value.

DisputeDate range

Only available for certain account types; contact us for details.

The date the transaction was disputed. This field does not include a time value.

FailedAt range

The date/time the transaction failed.

GatewayRejectedAt range

The date/time the transaction was rejected by the gateway.

Id text

The ID of the transaction.

Ids multiple

The list of transaction IDs to search for.

MerchantAccountId multiple

The merchant account IDs associated with transactions.

OrderId text

The order ID of the transaction. On PayPal transactions, this field maps to the PayPal invoice number. PayPal invoice numbers are unique in your PayPal business account. Maximum 255 characters or 127 for PayPal transactions.

PaymentInstrumentType multiple

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

  • "android_pay_card"
  • "apple_pay_card"
  • "credit_card"
  • "masterpass_card"
  • "paypal_account"
  • "samsung_pay_card"
  • "venmo_account"
  • "visa_checkout_card"
PaymentMethodToken text

The payment method token used in the transaction.

PaypalAuthorizationId text

The Authorization ID for a PayPal transaction.

PaypalPayerEmail text

The PayPal account holder's email for a PayPal transaction.

PaypalPaymentId text

The identification value of the payment in PayPal's API for a PayPal transaction.

ProcessorAuthorizationCode text

The authorization code returned by the processor for the transaction.

ProcessorDeclinedAt range

The date/time the transaction was declined by the processor

Refund multiple

Whether or not the transaction is a refund. The value may be either true or false. This parameter must be used in conjunction with Type.

SettledAt range

The date/time the transaction finished settling.

SettlementBatchId text

ID of the batch the transaction was submitted for settlement under.

ShippingCompany text

The company name on the shipping address used for the transaction.

ShippingCountryName text

The country name on the shipping address used for the transaction.

ShippingExtendedAddress text

The extended address on the shipping address used for the transaction.

ShippingFirstName text

The first name on the shipping address used for the transaction.

ShippingLastName text

The last name on the shipping address used for the transaction.

ShippingLocality text

The locality (e.g. city) on the shipping address used for the transaction.

ShippingPostalCode text

The postal code on the shipping address used for the transaction.

ShippingRegion text

The region (e.g. state) on the shipping address used for the transaction.

ShippingStreetAddress text

The street address on the shipping address used for the transaction.

Source multiple

How a transaction was created. Possible values:

  • API
  • CONTROL_PANEL
  • RECURRING
  • OAuth application client ID of the transaction facilitator
Status multiple

The list of statuses to search for. Possible statuses:

  • AUTHORIZING
  • AUTHORIZED
  • AUTHORIZATION_EXPIRED
  • SUBMITTED_FOR_SETTLEMENT
  • SETTLING
  • SETTLEMENT_PENDING
  • SETTLEMENT_DECLINED
  • SETTLED
  • VOIDED
  • PROCESSOR_DECLINED
  • GATEWAY_REJECTED
  • FAILED
SubmittedForSettlementAt range

The date/time the transaction was submitted for settlement.

Type multiple

Possible values:

  • SALE
  • CREDIT
User multiple

A list of user IDs used to create the transaction. Specifically refers to Control Panel users and/or API users.

VoidedAt range

The date/time the transaction was voided.

Examples

Credit card

C♯
var request = new TransactionSearchRequest().
    CreditCardCardholderName.Is("Patrick Smith").
    CreditCardExpirationDate.Is("05/2012").
    CreditCardNumber.EndsWith("1111");

ResourceCollection<Transaction> collection = gateway.Transaction.Search(request);

Searching On Customer Details

C♯
var request = new TransactionSearchRequest().
    CustomerCompany.Is("Braintree").
    CustomerEmail.Is("smith@example.com").
    CustomerFax.Is("5551231234").
    CustomerFirstName.Is("Tom").
    CustomerLastName.Is("Smith").
    CustomerPhone.Is("5551231234").
    CustomerWebsite.Is("http://example.com");

ResourceCollection<Transaction> collection = gateway.Transaction.Search(request);

See search fields for a list of available operators. They allow you to do nice things like this:

C♯
var request = new TransactionSearchRequest().
    CustomerEmail.EndsWith("example.com");

ResourceCollection<Transaction> collection = gateway.Transaction.Search(request);

Billing address

C♯
var request = new TransactionSearchRequest().
    BillingFirstName.Is("Paul").
    BillingLastName.Is("Smith").
    BillingCompany.Is("Braintree").
    BillingStreetAddress.Is("123 Main St").
    BillingExtendedAddress.Is("Suite 123").
    BillingLocality.Is("Chicago").
    BillingRegion.Is("Illinois").
    BillingPostalCode.Is("12345").
    BillingCountryName.Is("United States of America");

ResourceCollection<Transaction> collection = gateway.Transaction.Search(request);

Shipping address

C♯
var request = new TransactionSearchRequest().
    ShippingFirstName.Is("Paul").
    ShippingLastName.Is("Smith").
    ShippingCompany.Is("Braintree").
    ShippingStreetAddress.Is("123 Main St").
    ShippingExtendedAddress.Is("Suite 123").
    ShippingLocality.Is("Chicago").
    ShippingRegion.Is("Illinois").
    ShippingPostalCode.Is("12345").
    ShippingCountryName.Is("United States of America");

ResourceCollection<Transaction> collection = gateway.Transaction.Search(request);

Other top-level attributes

C♯
var request = new TransactionSearchRequest().
    OrderId.Is("myorder").
    ProcessorAuthorizationCode.Is("123456");

ResourceCollection<Transaction> collection = gateway.Transaction.Search(request);

Vault associations

You can search for transactions associated to a payment method token.

C♯
var request = new TransactionSearchRequest().
    PaymentMethodToken.Is("the_token");

ResourceCollection<Transaction> collection = gateway.Transaction.Search(request);

How the transaction was created

You can search for transactions that were created using a token.

C♯
var request = new TransactionSearchRequest().
    CreatedUsing.Is(TransactionCreatedUsing.TOKEN);

ResourceCollection<Transaction> collection = gateway.Transaction.Search(request);

Or transactions that were created using full credit card information.

C♯
var request = new TransactionSearchRequest().
    CreatedUsing.Is(TransactionCreatedUsing.FULL_INFORMATION);

ResourceCollection<Transaction> collection = gateway.Transaction.Search(request);

Those are the only two choices for created_using.

Customer location

Customers in the US.

C♯
var request = new TransactionSearchRequest().
    CreditCardCustomerLocation.Is(CreditCardCustomerLocation.US);

ResourceCollection<Transaction> collection = gateway.Transaction.Search(request);

Or international customers.

C♯
var request = new TransactionSearchRequest().
    CreditCardCustomerLocation.Is(CreditCardCustomerLocation.INTERNATIONAL);

ResourceCollection<Transaction> collection = gateway.Transaction.Search(request);

Merchant account

A specific one.

C♯
var request = new TransactionSearchRequest().
    MerchantAccountId.Is("the_merchant_account_id");

ResourceCollection<Transaction> collection = gateway.Transaction.Search(request);

Or any of several.

C♯
var request = new TransactionSearchRequest().
    MerchantAccountId.IncludedIn("account_1", "account_2");

ResourceCollection<Transaction> collection = gateway.Transaction.Search(request);

Credit card type

A specific one.

C♯
var request = new TransactionSearchRequest().
    CreditCardCardType.Is(CreditCardCardType.VISA);

ResourceCollection<Transaction> collection = gateway.Transaction.Search(request);

Or any of several.

C♯
var request = new TransactionSearchRequest().
    CreditCardCardType.IncludedIn(CreditCardCardType.VISA, CreditCardCardType.MASTER_CARD, CreditCardCardType.DISCOVER);

ResourceCollection<Transaction> collection = gateway.Transaction.Search(request);

Transaction status

Another one or many search field.

C♯
var request = new TransactionSearchRequest().
    Status.Is(TransactionStatus.AUTHORIZED);
ResourceCollection<Transaction> collection = gateway.Transaction.Search(request);

request = new TransactionSearchRequest().
      Status.IncludedIn(TransactionStatus.AUTHORIZED,
                        TransactionStatus.SUBMITTED_FOR_SETTLEMENT);
collection = gateway.Transaction.Search(request);

Transaction source

API, Control Panel, or Recurring Billing.

C♯
var request = new TransactionSearchRequest().
    Source.Is(TransactionSource.API);
ResourceCollection<Transaction> collection = gateway.Transaction.Search(request);

request = new TransactionSearchRequest().
      Source.IncludedIn(
          TransactionSource.API, TransactionSource.CONTROL_PANEL
      );
collection = gateway.Transaction.Search(request);

Transaction type

The two types of transactions are sale and credit. Refunds are a special kind of credit, so there are some extra options around them.

C♯
var request = new TransactionSearchRequest().
    Type.Is(TransactionType.SALE);

ResourceCollection<Transaction> collection = gateway.Transaction.Search(request);

This will return all credits, regardless of whether they're refunds, or standalone credits.

C♯
var request = new TransactionSearchRequest().
    Type.Is(TransactionType.CREDIT);

ResourceCollection<Transaction> collection = gateway.Transaction.Search(request);

If you only want the refunds:

C♯
var request = new TransactionSearchRequest().
    Type.Is(TransactionType.CREDIT).
    Refund.Is(true);

ResourceCollection<Transaction> collection = gateway.Transaction.Search(request);

And if you only want the credits that aren't refunds:

C♯
var request = new TransactionSearchRequest().
    Type.Is(TransactionType.CREDIT).
    Refund.Is(false);

ResourceCollection<Transaction> collection = gateway.Transaction.Search(request);

Amount

It's a range field.

C♯
var request = new TransactionSearchRequest().
    Amount.Between(100.00M, 200.00M);
ResourceCollection<Transaction> collection = gateway.Transaction.Search(request);

request = new TransactionSearchRequest().
    Amount.GreaterThanOrEqualTo(100.00M);
collection = gateway.Transaction.Search(request);

request = new TransactionSearchRequest().
    Amount.LessThanOrEqualTo(200.00M);
collection = gateway.Transaction.Search(request);

Status changes

You can search for transactions that entered a given status at a certain date and time. For instance, you can find all transactions which were submitted for settlement in the past 3 days.

You can search on these statuses:

  • CreatedAt
  • AuthorizedAt
  • SubmittedForSettlementAt
  • SettledAt
  • VoidedAt
  • ProcessorDeclinedAt
  • GatewayRejectedAt
  • FailedAt
  • AuthorizationExpiredAt

A few examples:

C♯
var searchRequest = new TransactionSearchRequest().
    CreatedAt.GreaterThanOrEqualTo(DateTime.Now.AddDays(-1));

ResourceCollection<Transaction> results = gateway.Transaction.Search(searchRequest);
C♯
var searchRequest = new TransactionSearchRequest().
    SettledAt.GreaterThanOrEqualTo(DateTime.Now.AddDays(-1));

ResourceCollection<Transaction> results = gateway.Transaction.Search(searchRequest);
C♯
var searchRequest = new TransactionSearchRequest().
    ProcessorDeclinedAt.GreaterThanOrEqualTo(DateTime.Now.AddDays(-1));

ResourceCollection<Transaction> results = gateway.Transaction.Search(searchRequest);

Dispute date range

C♯
var searchRequest = new TransactionSearchRequest().
    DisputeDate.GreaterThanOrEqualTo(DateTime.Now.AddDays(-1));

ResourceCollection<Transaction> results = gateway.Transaction.Search(searchRequest);
note

Time zones specified in the time value will be respected in the search; if you do not specify a time zone, the search will default to the time zone associated with your gateway account. Results will always be returned with time values in UTC.

See also