#GRINGO
1 messages · Page 1 of 1 (latest)
Here's a step for adding Shipping. There are options for selecting Android and iOS as well: https://stripe.com/docs/payments/quickstart#address-element
Why not accept the Shipping address when you accept payment?
I quote the shipping value in my backend
and I have my own address form
but I don't know how to add the shipping price
to the users subscription
this is how I doing that
but if the user don't pay the subscription he is creating, it stays active
For context, Subscriptions don't have shipping address on them. Only the Payment Intents and Customers do (both are used with Subscriptions), so if you don't accept it during the payment stage of the process, then you would need to store the address on the Customer object: https://stripe.com/docs/api/customers/create#create_customer-address
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
I tried that, but it doesn't work in subscription creation
i don't need to store the shipping address, I need to add the shipping price to my subscription invoice
What you're talking about are Shipping Rates. These don't have an address on them, so I can only assume you're talking about something totally different from what you asked in your original question
Are you following a guide?
sorry if I was not clear
lets restart
my app has stripe payments for one year
we are developing it native on iOS and using javascript on the backend
but right now we are creating a new subscription
that has shipping
but we quote the shipping price on the checkout and it is different for every user
so I need to add this shipping value to my subscription
this is related to what I need
You have to use either Stripe Checkout or Orders to create/use Shipping Rates: https://stripe.com/docs/api/shipping_rates
The solution in the StackOverflow question you mentioned does not use Shipping Rates. You would need to create a separate Invoice Item that represents your shipping costs if you want to have a quote for your client before they pay
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
This answer is the correct one if you're not using Orders or Checkout: https://stackoverflow.com/a/27308712/18637382
i think that for mobile isn't possible to use Order or Checkout
yes, that answer is exactly what I do
but my problem is, I was testing this method
and I was going to to checkout, and it created the subscription and the invoice item, all right
but if I already have a subscription, and didn't finish this flow that created that new invoice item, this invoice item appear on my active subscription
That's expected. If you add an Invoice Item to an active Subscription, but you don't end up charging for it, then you just need to remove the Invoice Item: https://stripe.com/docs/api/invoiceitems/delete
yes, but i can't identify that the user didn't finish the subscription :/
because he can just kill the app
so I don't know when to delete this invoice item
I was wondering if there's a way to create a subscription for the user and it create the invoice as draft, so I could add the invoiceItem for this invoice only
Ahhhh, okay. I understand. So in that case you will want to look into the Upcoming Invoice API. You use this to simulate what their Invoice will be on an active Subscription based on the changes you make to it: https://stripe.com/docs/api/invoices/upcoming
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
ok, so that way I need to delete the invoiceItem I created before?
would be so much easy if I could create the item after the subscription creation, so I could related them
With Upcoming Invoices, you don't need to delete anything, since it doesn't change anything on the Subscription
So, you said your problem is that your Customer may not approve the new Invoice Item right? So in that case, you need to just create a new Invoice Item to use for the active Subscription, then pass that Invoice Item into the Upcoming Invoice API (https://stripe.com/docs/api/invoices/upcoming#upcoming_invoice-invoice_items), which will give you information about what will happen to the Subscription if you actually add the Invoice Item to the Subscription "for real".
It's the same as creating a fake Invoice to see what the numbers are. If the Customer chooses to add it to the Subscription, then you add the Invoice Item to the Subscription. If the Customer chooses not to, then you do nothing.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
No no
thats not my problem
I'm a customer, and I subscribe for the Health Insurance for pets, ok?
now I'm navigating in the app, and I saw this new subscription, I go to the checkout, to see the price, quote the shipping, and was ready to purchase
in the backend, I already created a new subscription and the invoiceItem for the shipping
so the user doesn't finish the payment of the new subscription
and it canceled automatically in 2 days
but this invoice Item stays active and appears on my health insurance subscription
I have no idea what the difference is between what you just asked and what you asked before. I would recommend working with our support folks. They can help you in your specified language and hopefully get to the bottom of what's going wrong: https://support.stripe.com/contact
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.