rakshithxaloori / watchpartyyoutube-api

Run your existing YouTube library as a Live Stream
0 stars 0 forks source link

Stripe sharing first subscription charge for inviting #1

Open rakshithxaloori opened 1 year ago

rakshithxaloori commented 1 year ago

FROM STRIPE SUPPORT You can create the subscription with the transfer_data then when a first invoice was sent and paid, you can then update the subscription and remove the transfer_data so invoice moving forward will not have a destination payment: Stripe Update Subscription

FROM BING CHAT Yes, you can create a destination charge for the first invoice and then have future invoices without one. You can automate this process by integrating with the Stripe Invoicing API⁷. This will allow you to create and send invoices programmatically, without having to manually create a new invoice in your backend every month. You can also use the Invoicing API to customize the behavior of your invoices, such as specifying whether to charge automatically or send an invoice⁶. Is there anything else you would like to know? 😊

Source: Conversation with Bing, 06/09/2023 (1) Integrate with the Invoicing API | Stripe Documentation. https://stripe.com/docs/invoicing/integration. (2) Stripe API reference – Create an invoice. https://stripe.com/docs/api/invoices/create. (3) Creating destination charges on your platform - Stripe. https://stripe.com/docs/connect/destination-charges. (4) Create a charge | Stripe Documentation. https://stripe.com/docs/connect/charges. (5) Stripe Invoicing pricing : Stripe: Help & Support. https://support.stripe.com/questions/stripe-invoicing-pricing. (6) How To Manually Enter A Charge Into Stripe – SpentApp. https://spentapp.com/how-to-manually-enter-a-charge-into-stripe/. (7) Stripe Invoicing | Create and Send Invoices Online. https://stripe.com/invoicing. (8) undefined. https://api.stripe.com/v1/payment_intents.

import stripe

stripe.api_key = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"

# Create a Customer
customer = stripe.Customer.create(
    email="customer@example.com",
    source="tok_visa" # obtained with Stripe.js
)

# Create a Subscription
subscription = stripe.Subscription.create(
    customer=customer.id,
    items=[{"plan": "plan_CBb6IXqvTLXp3f"}],
    application_fee_percent=10,
    transfer_data={"destination": "{{CONNECTED_STRIPE_ACCOUNT_ID}}"},
)

# Update the Subscription to remove the destination charge
stripe.Subscription.modify(
    subscription.id,
    transfer_data=None
)

Once the first invoice is paid, update the subscription and remove the transfer_data

rakshithxaloori commented 1 year ago

Express and Custom accounts are not supported in India yet [1] https://support.stripe.com/questions/stripe-india-support-for-marketplaces [2] https://stripe.com/docs/connect/express-accounts#prerequisites-for-using-express