#ttt999_invoice-api
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1301901466625376287
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Unfortunately this needs to be 3 calls if you don't want to wait an hour for invoice to auto finalize
ok - any way to take payment immediately?
What about setting:
automatically_finalizes_attimestamp
to now+60 seconds will this work?
Yeah that should actually
Recommend testing in test mode
As long as you have auto_advance set to true
ok will give it a try, thanks
POST /v1/invoices
{
"footer": null,
"customer": "cus_IpGHuWLsUlRLjm",
"metadata": [],
"discounts": [],
"description": "test",
"auto_advance": true,
"subscription": null,
"custom_fields": [],
"transfer_data": {
"amount": null
},
"default_source": null,
"collection_method": "charge_automatically",
"default_tax_rates": [],
"statement_descriptor": null,
"application_fee_amount": null,
"default_payment_method": null,
"pending_invoice_items_behavior": "include"
}
Does this look ok? Getting an error back:
[parameter_missing]
Must provide customer or from_invoice.
Reference: https://stripe.com/docs/error-codes/parameter-missing
customer is definitely valid
You didn't pass automatically_finalizes though
But please share the request ID so I can take a look at why it's erroring
Recommend using one of our client libraries
The request body needs to be form encoded data not json
ok think that is the issue if I add a query string then it works.
Still recommend using one of our client libraries as they make calling our api as easy as it can be
But glad you got it working
automatically_finalizes works too, thanks for your help.
will look into libraries also
Thanks, how do I mark this as solved?
Hi ๐ I'm taking over for my teammate. If you're all set I can close the thread.
Actually I have another question if that is ok:
Prior to riasing an invoice, I am looking to establish if the customer has a card saved with which to make an auotmatic payment - if I retrieve a customer and they have a default payment method set is it safe to assume this?
Yup
I'm not sure what the assumption is there. If the Customer object has a payment method specified in invoice_settings.default_payment_method, then either your integration updated that field or you presented your customer with a flow where they were able to set that.
https://billing.stripe.com/p/login/xxxxxxxxxxxxxxxxxxx
using this page to allow customers to add payment details
Looking to check if they have actually added payment details before riasing the invoice
Added any Payment Method, or specifically added one to be used as the default for their Invoices?
one that can be used with autocharge
Okay, then for that you check the field I mentioned above.
Great, thank you.
Another question - we have this stripe account linked with Xero. Is it possible when I raise an invoice using the Stripe API to link this with a corresponding invoice on Xero?
I'm not sure, I'm not sure how the integration provided by Xero functions. You'd want to speak with their teams to get clarity on that.
Unfortunately their support is not as good as yours. I will give it a try regardless. Thank you.
Any time!
On the dashboard/transactions the description is "Payment for invoice" - any way I can customise this?
I'm not as familiar with what fields on API objects map to in our dashboard, my teamamtes and I focus on the API side of these flows. I'd suggest trying to adjust the description parameter on the Invoice object and see if that does the trick:
https://docs.stripe.com/api/invoices/object#invoice_object-description
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
If it doesn't, can you share the ID of the Invoice from your testing so we can take a closer look at what is set for the various fields to see where it could be getting pulled from?
Tried description - didnt work - it shows in the "Memo" field when viewing invoice
in_1QGMISIjV3l864vI8eskAozz
Ah, I see, it's the description field on the underlying Payment Intent.
pi_3QGMKCIjV3l864vI25kG31Um
I can't recall offhand if you can update the Payment Intent that an Invoice generates. Can you try updating that description field?
https://docs.stripe.com/api/payment_intents/update#update_payment_intent-description
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.