Get Instant Solutions for Kubernetes, Databases, Docker and more
Braintree Recurring is a powerful tool within the Braintree suite that allows developers to manage billing and subscriptions seamlessly. It is designed to handle recurring payments, making it an essential component for businesses that offer subscription-based services. The API provides robust features to manage subscriptions, discounts, and billing cycles efficiently.
When working with Braintree Recurring, you might encounter the error code 91521, which indicates an 'Invalid subscription discount quantity'. This error typically arises when attempting to apply a discount to a subscription, and the specified discount quantity does not meet the required criteria.
The error code 91521 is triggered when the discount quantity provided in the subscription request is either not a valid number or exceeds the permissible limits set by Braintree. This can occur due to incorrect data entry or misunderstanding of the API's requirements.
Ensure that the discount quantity is a valid integer and falls within the acceptable range. Check the Braintree documentation for specific limits on discount quantities. You can refer to the Braintree Subscription Create API for detailed information.
Log into your Braintree control panel and navigate to the 'Discounts' section. Verify that the discount settings are configured correctly and that the discount quantity aligns with your business logic.
When making an API request to create or update a subscription, ensure that the discount quantity is correctly specified in the request payload. Here is an example of how to structure your API request:
{
"subscription": {
"planId": "your_plan_id",
"discounts": {
"add": [{
"inheritedFromId": "your_discount_id",
"quantity": 1
}]
}
}
}
By following these steps, you can resolve the 'Invalid subscription discount quantity' error and ensure that your subscription management process runs smoothly. For further assistance, consider reaching out to Braintree Support or exploring the Braintree Developer Documentation for more insights.
(Perfect for DevOps & SREs)
Try Doctor Droid — your AI SRE that auto-triages alerts, debugs issues, and finds the root cause for you.