Get Instant Solutions for Kubernetes, Databases, Docker and more
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.
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.
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.
To resolve the 91520 error, follow these actionable steps:
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.
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.
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
}
]
}'
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.
(Perfect for DevOps & SREs)
Try Doctor Droid — your AI SRE that auto-triages alerts, debugs issues, and finds the root cause for you.