Get Instant Solutions for Kubernetes, Databases, Docker and more
Braintree Recurring is a powerful tool designed to handle billing and subscription management for businesses. It allows developers to integrate seamless subscription services into their applications, providing a robust solution for recurring billing needs. With Braintree, you can manage customer subscriptions, handle payments, and automate billing cycles efficiently.
When working with Braintree Recurring, you might encounter an error message indicating an 'Invalid subscription price'. This error typically arises during the creation or update of a subscription. The error message might look something like this:
{
"error": "91518",
"message": "Invalid subscription price"
}
This error prevents the subscription from being processed correctly, disrupting the billing cycle.
Error code 91518 signifies that the subscription price provided does not conform to the expected format or does not align with the plan settings configured in Braintree. This can occur if the price is not a valid number or if it does not match the predefined pricing structure of the subscription plan.
Ensure that the subscription price is a valid numerical value. It should not contain any currency symbols or commas. For example, instead of "$10.00", use 10.00
.
Review the plan settings in your Braintree dashboard to confirm that the price you are providing matches the expected price for the subscription plan. You can access your plan settings by logging into your Braintree account and navigating to the Recurring Billing section.
Ensure that your code correctly formats and sends the subscription price. Here is an example of how to set the subscription price in a Braintree API request:
result = gateway.subscription.create({
"payment_method_token": "the_payment_method_token",
"plan_id": "your_plan_id",
"price": "10.00"
})
Make sure that the price
field is a string representing a valid number.
After making the necessary adjustments, test the subscription creation or update process to ensure that the error is resolved. You can use Braintree's sandbox environment for testing purposes.
By following these steps, you should be able to resolve the 'Invalid subscription price' error in Braintree Recurring. Ensuring that your subscription price matches the plan settings and is correctly formatted will help maintain a smooth billing process. For further assistance, consider reaching out to Braintree's support team.
(Perfect for DevOps & SREs)
Try Doctor Droid — your AI SRE that auto-triages alerts, debugs issues, and finds the root cause for you.