#snackdex

1 messages · Page 1 of 1 (latest)

honest sundialBOT
#

Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

flint turret
#

if it helps this is how i am creating the subscription:

const subscription = await stripe.subscriptions.create({
      expand: ["latest_invoice.payment_intent"],
      customer: stripeCustomerId,
      payment_behavior: "default_incomplete",
      collection_method: "charge_automatically",
      items: [{ price: membershipPrice.stripePriceId }],
      add_invoice_items: additionalInvoiceItems,
      metadata: stripeMetadata
    });
shell thicket
#

Do you have a Subscription object ID I can use to look into it?

flint turret
#

would this be it:

"subscription": "sub_1O8SAaELLwkYyxmwb9qAmqJz",
        "subscription_item": "si_OwKqawdS97M8k7",
#

this is in our test environment btw

shell thicket
#

Ah, okay so this Customer has a Payment Method attached, but it needs to be set as the default for this Customer's Subscriptions. To do that you just have to update the Customer object and pass in that Payment Method ID to Customer.invoice_settings.default_payment_method: https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method

flint turret
#

ah ok! thank you so much!

shell thicket
#

Sure thing!

flint turret
#

if this is a first time customer, and i don't have the payment method until after they pay for it, would i update it in the invoice.paid webhook?