Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I populate Stripe's description field on subscription charge?

I can populate Business::Stripe's description field for one off charges with the below code :

use Business::Stripe;    # Version 0.4

# Create Customer
my $customer = $stripe->api('post', 'customers',
    card        => $stripeToken,
    description => $username,
);

# Charge
my $charge = $stripe->api('post', 'charges',
    customer    => $customer,
    currency    => $currency,
    description => 'my description here no probs',
    amount      => $amount,
);

But when I create a customer a customer and assign them to a subscription plan I can't see how to populate the description of the charge made each billing period.

# Create Customer and subscribe to a plan
my $customer = $stripe->api('post', 'customers',
    card        => $stripeToken,
    description => 'description here is for the customer not the monthly charge',
    plan        => $plan
);

I want to be able to add a description to the charge that happens each billing period.

The API doesn't seem to show a way but the field is editable via the strie dashboard.

like image 641
James Morrison Avatar asked Oct 05 '14 16:10

James Morrison


People also ask

What information can be stored under a customer ID Stripe?

The Customer resource is a core entity within Stripe. Use it to store all of the profile, billing, and tax information required to bill a customer for subscriptions and one-off invoices.

How do I set up a one-time subscription on Stripe?

Add a one-time fee or discount with a new subscription plan : Stripe: Help & Support. To include a one-time charge or discount to the first subscription invoice, you can do so by adding an invoice item to the customer before creating the subscription. This can be done using the API or directly in the Stripe Dashboard.


1 Answers

Stripe is thinking about auto-populating the charge description on invoices, but that's not a feature that exists yet. In the meantime, once the invoice.payment_succeeded event occurs, you can get the charge ID from that event data. Then you can update the charge's description via the API:

https://stripe.com/docs/api#update_charge

Hope that helps, Larry

PS I work on Support at Stripe.

like image 87
Larry Ullman Avatar answered Sep 28 '22 00:09

Larry Ullman