#espagnol01 - subscription zapier

1 messages · Page 1 of 1 (latest)

light marshBOT
hardy needle
#

With that being said:

Case 1: 1 time payment (old solution)

          If initial price = 0
          And monthly price after initial term is > 0
  1. Create a customer in Stripe (Zapier Native Integration)
    a. Name:
    b. Email:
    c. Description:
    d. Billing Address:
    e. Billing City:
    f. Billing State:
    g. Billing ZIP:
    h. Billing Country:
    i. Language: en
    j. Credit Balance: “initial price”
    (This is pretty straight forward)

  2. Create Product in Stripe (Zapier Native Integration)
    a. Name: “Internal Campaign Name”
    b. Description: “Name BB”
    c. Tax Code: “txcd_10010001”
    (Do we need to create a product every time? Does this means that we are going to end up with the same amount of products as the amount of customers in our database? Should we add a “find product” step in between? How many products can we have in our database? In reality, we have around 21 products in our database. This number may increase to around 40)

  3. Create Price in Stripe (Zapier Native Integration)
    a. Product: “output_id from step 2”
    b. Price: “initial price”
    c. Currency: “GBP”
    d. Recurring or One Time: One Time
    e. Tax Behavior: Inclusive
    (Is there another way to do this? Usually the prices are always the same.

  4. Create an Invoice (API)
    a. Collection_method: “send_invoice”
    b. Customer: “output_id from step 1”
    c. Days_until_due: “30”
    d. Description: “Service Campaign Name”
    e. Pending_invoice_items_behavior: “exclude”
    f.

  5. Create an Invoice Item (API)
    a. Customer: “output_id from step 1”
    b. Description: “1 time payment”
    c. Invoice: “output_id from step 4”
    d. Price: “output_id from step 3”
    e. Currency: “GBP”
    f. Quantity: 1

  6. Finalize Invoice (send to customer)

a. POST to https://api.stripe.com/v1/(output_id from step 4)/finalize

#

Quoting here for context. That's a lot of text

mellow harness
#

and basically, I need some help figuring out how can I achieve this

#

is it possible to share my zap with you guys so that you can double check it? Because, for example, I am not receiving the invoice, I need to save the payment information, and overall I am adding parameters that may be duplicated but I dont really understand how the whole thing works

hardy needle
#

I'm sorry this is a lot of information. Give me a minute to read through it

mellow harness
#

absolutely, I understand

#

thank you for taking the time

hardy needle
#

Okay so my first question is, are you writing code and/or hitting Stripe APIs directly?

mellow harness
#

for the first part (create customer, create product, create price) i am using Stripe Native integration for Zapier

#

for creating an invoice, invoice item and finalize I am using Zapier Webhooks that can do POST

hardy needle
#

I'm not familiar with any Zapier integrations. If you aren't writing your own code to perform these actions I may not be able to offer much advice. I am still trying to understand what your question is though

mellow harness
#

i believe that in the background, the stripe integration is using Python to create the customer, product and price

#

I have 2 questions

hardy needle
#

No Stripe isn't using Python

#

The Zapier integration may be but my advice would have to do with writing that Python code

mellow harness
#
  1. For some reason, the invoice is not being sent automatically
  2. My subscription is not being send to the customer and it gets cancelled automatically
hardy needle
#

Do you have an invoice number I can examine?

mellow harness
#

yes

hardy needle
#

it'll start with inv_

mellow harness
#

I have created 2 customers with my own information

hardy needle
#

an ID, I should say

mellow harness
#

pi_3M9dbCKavdtumQQG0UfGMby6

#

that is the subscription that i created

#

using this flow:

hardy needle
#

That isn't a subscription. It's a payment intent

mellow harness
#

i did it using the stripe integration and it says subscription, but I understand that maybe it is doing something else.

hardy needle
#

Taking a look at it

mellow harness
#

ah you are right. maybe I copied it wrong

#

would it be this one? in_1M9dbhKavdtumQQG3TRRdpUS

hardy needle
#

Okay that's an invoice so we are getting closer

mellow harness
#

can I give you my customer id instead?

#

so that you can see the invoices attach to it?

#

cus_MtQKM3U26iKty5

#

this is the customer that was created based on the subscription flow

hardy needle
#

This invoice was set to be manually captured. It hasn't been attempted because you need to manually trigger it to send the invoice to the customer

#

That may be something the Zapier integration is supposed to do but it does not appear to be triggered

mellow harness
#

can I do an api call to send it?

hardy needle
#

Wait, that invoice is in a Draft state

mellow harness
#

yes

#

that is what I can see in the dashboard

hardy needle
#

I don't think your integration is properly moving the invoice along

mellow harness
#

maybe I am doing something wrong

hardy needle
mellow harness
#

i have been all over this

#

I tried to do as much as I could by myself

#

i am creating the customer without a problem

#

then I am creating a product

#

then the price

#

and finally, the subscription

hardy needle
#

Ah, wait I see

#

Hmmm

mellow harness
#

i am going to delete the customers and run it again

hardy needle
mellow harness
#

to see exactly what is going on

#

can I test it from scratch? so that you can see a clear log?

hardy needle
#

I don't know that it will help

mellow harness
#

now

#

there should be a new customer

#

cus_MtRTAxMETh3hdq

#

a new product: prod_MtRTto7zNk9Imc

#

a new price: price_1M9eb8KavdtumQQGMLi94LWd

#

is this correct?

hardy needle
#

None of those are the issue here. I am trying to understand why we don't send the invoice

#

I'm sorry to say I don't know whether that is correct or not. I have never used that interface.

#

espagnol01 - subscription zapier

#

Wait....

#

In this case the invoice will remain in a draft state for 1 hour to allow you to make changes. It will transition and send after that time is up

#

So I think you just need to wait in order to test this

mellow harness
#

ok

#

i will wait. Can I come back tomorrow to this same thread?

hardy needle
#

We don't keep threads open but you can come back and ask a new question and we'll be happy to help

mellow harness
#

and 1 quick question before you go. Once the customer pays, will it save the payments details so that the next invoices get pay automatically?

#

or do I need to pass a parameter to store the payment details? or does it depends on the customer if he wants to store his details?

willow briar
#

👋 Taking over this thread, catching up now

#

If payment_settings.save_default_payment_method [0] is set to on_subscription, the collected payment methods will be set as default payment method for the subscription and charged automatically for future invoices for this subscription.

[0] https://stripe.com/docs/api/subscriptions/create#create_subscription-payment_settings-save_default_payment_method

mellow harness
#

so, this is something that i need to specify when I create the subscription right?

#

another question: when creating a subscription, is it expecting the price_item as the item? or is it the product?

willow briar
mellow harness
#

do you know if I can pass the parameter as metadata?

willow briar
#

If the parameter is for your own internal reference, it can be set as a metadata. If it's for functional usage in Stripe such as saving a payment method on a subscription, it can't be set as a metadata

mellow harness
#

I understand. Thank you.

willow briar
#

No problem! Happy to help 😄

mellow harness
#

i need to enable bacs. Do I need to pass this on the invoice creation and subscription creation?

mellow harness
#

hi @willow briar. I followed your advise and I created an API call instead to create an invoice

#

this are the parameters:

willow briar
#

Do I need to pass this on the invoice creation and subscription creation?
You may ser payment_settings.payment_method_types with ['bacs_debit']

mellow harness
#

the invoice is showing as incomplete

#

the email was not send automatically

#

si I did another API to send the invoice

#

but there are no payment methods

#

no bacs nor card

willow briar
#

Could you share the subscription ID?

mellow harness
#

in_1M9fsxKavdtumQQGyYA7tfHq

#

and it seems that payment_method_options was not saved

willow briar
#

In test mode, email will not be sent. I'm checking why invoice doesn't have any payment methods displayed

mellow harness
#

I am using the live mode

willow briar
#

Oh sorry my bad! Based on the history, the invoice email was sent to the customer's email address on Nov 30th 2022 2:19:38 am UTC

mellow harness
#

hmm

#

ok

#

let me try again

#

i think it is this one: sub_1M9fsxKavdtumQQGl5hwkfU4

#

I have a problem with this one

#

it is not sending the email automatically

#

i think it works now

#

but i cannot see the bacs

#

only card

#

and gpay

#

i just created a new one: sub_1M9gKCKavdtumQQG30fsy8NU

#

no, i dont get the email after creating a subscription

willow briar
#

Which subscription should I look into and what the problem it is? Email not sent or BACS not showing?

mellow harness
#

email not being send after creating the subscription

#

i can see that bacs is enabled but it does not show for me when I am trying to pay

#

i believe that it could be related to the location. I am preparing this flow to be deployed in UK but I am currently in Sweden

#

could that be the reason?

willow briar
#

The invoice (in_1M9gKCKavdtumQQGlskM1G5r) of sub_1M9gKCKavdtumQQG30fsy8NU is not sent because it is still in draft status. Email will only sent after the invoice is finalised

mellow harness
#

do I have to finalize or send?

willow briar
#

Stripe will automatically send invoices to customers according to your subscriptions settings. However, if you’d like to manually send an invoice to your customer out of the normal schedule, you can do so. When sending invoices that have already been paid, there will be no reference to the payment in the email.
Ref: https://stripe.com/docs/api/invoices/send

With subscription, invoice will be sent automatically after the invoice is finalized after an hour of invoice creation.

#

I have a check why BACS is not shown. Your subscription is created via Zapier and Zapier controls the supported payment methods. BACS is not enabled by Zapier.

mellow harness
#

but I used API call to create it and I added BACS

willow briar
mellow harness
#

how do I fix this then?

#

should I talk to Zapier support?

willow briar
#

Yup! I'd recommend reaching out to Zapier support to enable BACS if you wish to support BACS as part of integration.

mellow harness
#

got it

#

thank you

#

thank you very much for today

willow briar
#

No problem! Happy to help 😄

mellow harness
#

i finally feel like I am getting closer

willow briar
#

Yay! Feel free to reach out to us if you have further questions 😄

mellow harness
#

thank you

#

have a good night

willow briar
#

Have a good night to you as well!