Debug Your Infrastructure

Get Instant Solutions for Kubernetes, Databases, Docker and more

AWS CloudWatch
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
Pod Stuck in CrashLoopBackOff
Database connection timeout
Docker Container won't Start
Kubernetes ingress not working
Redis connection refused
CI/CD pipeline failing

Braintree Recurring Invalid subscription add-on quantity error encountered during subscription creation or update.

The add-on quantity provided is not a valid number.

Understanding Braintree Recurring

Braintree Recurring is a powerful tool designed to manage billing and subscriptions for businesses. It allows developers to integrate subscription billing into their applications, providing a seamless experience for managing recurring payments. Braintree handles the complexities of billing cycles, invoicing, and payment processing, making it an essential tool for businesses offering subscription-based services.

Identifying the Symptom

When working with Braintree Recurring, you might encounter the error code 91520, which indicates an issue with the subscription add-on quantity. This error typically arises during the creation or updating of a subscription, where the system detects an invalid quantity for an add-on.

Exploring the Issue

The error code 91520 is triggered when the quantity specified for a subscription add-on is not a valid number. This could mean that the quantity is either missing, set to a non-numeric value, or falls outside the acceptable range defined by Braintree. Ensuring that the add-on quantity is correctly specified is crucial for the successful processing of subscriptions.

Common Causes

  • Non-numeric values provided for the add-on quantity.
  • Quantity values that are negative or exceed the maximum allowed limit.
  • Missing quantity field in the subscription request.

Steps to Fix the Issue

To resolve the 91520 error, follow these actionable steps:

Step 1: Validate the Add-on Quantity

Ensure that the add-on quantity is a valid integer. Check your code to confirm that the quantity is being set correctly. For example:

{
"addOns": [
{
"id": "add-on-id",
"quantity": 2
}
]
}

Make sure the quantity field is present and set to a valid number.

Step 2: Check for Negative or Excessive Values

Verify that the quantity is not negative or excessively large. Braintree may have specific limits on the maximum quantity allowed. Refer to the Braintree documentation for details on acceptable quantity ranges.

Step 3: Review API Request

Double-check the API request being sent to Braintree. Use logging or debugging tools to inspect the request payload and ensure that the add-on quantity is correctly included. Here's an example of a correct API request:

curl -X POST https://api.braintreegateway.com/merchants/your_merchant_id/subscriptions \
-H "Content-Type: application/json" \
-d '{
"paymentMethodToken": "your_payment_method_token",
"planId": "your_plan_id",
"addOns": [
{
"id": "add-on-id",
"quantity": 1
}
]
}'

Conclusion

By following these steps, you should be able to resolve the 91520 error related to invalid subscription add-on quantities in Braintree Recurring. Ensuring that your API requests are correctly formatted and that all values are within acceptable ranges is key to maintaining a smooth subscription management process. For further assistance, consult the Braintree Developer Documentation.

Master 

Braintree Recurring Invalid subscription add-on quantity error encountered during subscription creation or update.

 debugging in Minutes

— Grab the Ultimate Cheatsheet

(Perfect for DevOps & SREs)

Most-used commands
Real-world configs/examples
Handy troubleshooting shortcuts
Your email is safe with us. No spam, ever.

Thankyou for your submission

We have sent the cheatsheet on your email!
Oops! Something went wrong while submitting the form.

🚀 Tired of Noisy Alerts?

Try Doctor Droid — your AI SRE that auto-triages alerts, debugs issues, and finds the root cause for you.

Heading

Your email is safe thing.

Thank you for your Signing Up

Oops! Something went wrong while submitting the form.

MORE ISSUES

Deep Sea Tech Inc. — Made with ❤️ in Bangalore & San Francisco 🏢

Doctor Droid