Transaction Validations

In addition to errors on the transaction directly, credit card, customer, and address validations also apply. Because transactions have a billing and a shipping address, it’s possible to get the same error code twice. Errors are scoped by parameter so if you get an error like “Street address is too long” you can determine whether it’s on the billing street address or shipping street address. See validation errors for more information.

81501 Amount cannot be negative.

Even if creating a credit transaction, the amount should be given as x.xx, not -x.xx.

81502 Amount is required.

You’ll get this error if amount is not given or is blank.

81503 Amount is an invalid format.

Amount must be formatted like “10” or “10.00”.

81528 Amount is too large.

The amount cannot be more than 10 characters, including the decimal point and two digits for cents. So “9999999.99” is the most that you can try to charge, if you really want to try.

81509 Credit card type is not accepted by this merchant account.

The credit card card type must be accepted by your merchant account. Note that there is a different error code when you get this error when creating transactions using tokens (91517).

81527 Custom field is too long.

Custom field values must be less than 255 characters. The error message for this validation error will contain a list of the custom fields that were too long.

91501 Order ID is too long.

Order ID must be less than 255 characters.

91530 Cannot provide a billing address unless also providing a credit card.

If you’re creating a transaction using a credit card token, then we will use the billing address associated to that token in the vault. You’ll get this error if creating a transaction using a token and specifing a billing address.

result = Braintree::CreditCard.sale(
  "the_token",
  :billing => {
    :street_address => "1 E Main St",
    :postal_code => "60622"
  }
)

91504 Transaction can only be voided if status is authorized or submitted_for_settlement.

Unless the transaction status is authorized or submitted_for_settlement, it cannot be voided.

91505 Cannot refund credit

Only sale transactions can be refunded.

91506 Cannot refund a transaction unless it is settled.

Transaction status must be settled to refund it.

91507 Cannot submit for settlement unless status is authorized.

Transaction status must be authorized to submit the transction for settlement.

91508 Need a customer_id, payment_method_token, credit_card, or subscription_id.

You’ll get this error if not specifying a credit card when creating a transaction. The credit card can be given directly, or you can use a customer ID, payment method token, or subscription ID.

91526 Custom field is invalid

Custom field keys must match the API name of a custom field configured in the control panel. The error message for this validation error will contain a list of the invalid keys.

91510 Customer ID is invalid.

You’ll get this error if you create a transaction using a customer ID and the customer ID isn’t in your vault.

91511 Customer does not have any credit cards.

When creating a transaction using a customer ID, we’ll use the customer’s default credit card. If the customer does not have any credit cards associated to it, you’ll get this error.

91512 Transaction has already been refunded.

Transactions can only be refunded once.

91513 Merchant account ID is invalid.

If you specify the merchant account ID to use to process a transaction and it does not match any of your merchant accounts, you’ll get this error.

91514 Merchant account is suspended.

You’ll get this error if you try to create a transaction using a suspended merchant account.

91515 Cannot provide both payment_method_token and credit_card attributes.

If you specify both a vault token and a full credit card number you’ll get this error.

91516 Cannot provide both payment_method_token and customer_id unless the payment_method belongs to the customer.

If you specify both a customer ID and a payment method token when creating a transaction, the payment_method_token must belong to the customer ID.

91527 Cannot provide both payment_method_token and subscription_id unless the payment method belongs to the subscription.

If you specify both a payment method token and a subscription ID the subscription ID must be associated to the token given.

91517 Credit card type is not accepted by this merchant account.

When providing a payment method token, your merchant account must be configured to accept the card type of the card represented by the token.

91518 Payment method token is invalid.

You’ll get this error if the payment method token isn’t in the vault.

91519 Processor authorization code cannot be set unless for a voice authorization.

You can only set the processor authorization code for voice authorization transactions.

91521 Refund amount cannot be more than the authorized amount.

You cannot refund more than the authorized amount.

91538 Cannot refund transaction with suspended merchant account.

You cannot refund a transaction associated with a suspended merchant account.

91522 Settlement amount cannot be more than the authorized amount.

You cannot settle more than the authorized amount.

91529 Cannot provide both subscription_id and customer_id unless the subscription belongs to the customer.

If you give both a customer ID and a subscription ID the subscription must be associated to the customer.

91528 Subscription ID is invalid.

You’ll get this error if the subscription ID given isn’t one of your subscriptions.

91523 Transaction type is invalid.

Valid transaction types are “sale” and “credit”

91524 Transaction type is required.

We need to know if you want to create a sale or a credit.

91525 Vault is disabled.

If you set the option to store in vault, your vault needs to be enabled.

91531 Subscription status must be past due

A subscription must be in past due status in order to manually retry the charge.

91547 Merchant Account does not support refunds

The merchant account account does not support refunds.

81531 Amount must be greater than zero

The amount of a transaction cannot be zero.

81534 Tax amount cannot be negative.

The tax amount cannot be less than zero.

81535 Tax amount is an invalid format.

The tax amount must be a number

81536 Tax amount is too large.

The tax amount cannot be bigger than 9999999.99

91537 Purchase order number is too long.

The purchase order number cannot be larger than 17 characters.

91539 Voice Authorization is not allowed for this card type

The specified card type does not support voice authorization codes.

91540 Transaction cannot be cloned if payment method is stored in vault

Instead, create a new transcation using the payment method’s token

91541 Cannot clone voice authorization transactions

Cloning voice authorizations is currently unsupported.

91542 Unsuccessful transaction cannot be cloned.

Only transactions that were authorized or settled are cloneable.

91543 Credits cannot be cloned.

You may only clone sale transactions

91544 Cannot clone transaction without submit_for_settlement flag.

You must specify whether or not to submit the cloned transaction for settlement upon creation.

91545 Voice Authorizations are not supported for this processor

Your processor does not support voice authorizations.

91546 Credits are not supported by this processor

Your processor does not support credits.

91548 Purchase order number is invalid

The purchase order number must be printable ASCII characters

See Also