#ttt999_invoice-api

1 messages ยท Page 1 of 1 (latest)

sinful fernBOT
#

๐Ÿ‘‹ 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.

karmic lynx
#

Unfortunately this needs to be 3 calls if you don't want to wait an hour for invoice to auto finalize

long dew
#

ok - any way to take payment immediately?

#

What about setting:
automatically_finalizes_attimestamp
to now+60 seconds will this work?

karmic lynx
#

Yeah that should actually

#

Recommend testing in test mode

#

As long as you have auto_advance set to true

long dew
#

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"
}

#

customer is definitely valid

karmic lynx
#

You didn't pass automatically_finalizes though

#

But please share the request ID so I can take a look at why it's erroring

long dew
#

took it out as I was getting errors

#

checking id

#

req_jAAnyY7h4eRTGf

karmic lynx
#

You're not passing a request body at all

long dew
#

That's odd. I am using make.com - I will speak to their support and see if they can help

karmic lynx
#

Recommend using one of our client libraries

#

The request body needs to be form encoded data not json

long dew
#

ok think that is the issue if I add a query string then it works.

karmic lynx
#

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

long dew
#

automatically_finalizes works too, thanks for your help.

sinful fernBOT
#

ttt999_invoice-api

long dew
#

Thanks, how do I mark this as solved?

peak harbor
#

Hi ๐Ÿ‘‹ I'm taking over for my teammate. If you're all set I can close the thread.

long dew
#

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?

peak harbor
#

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.

long dew
#

Looking to check if they have actually added payment details before riasing the invoice

peak harbor
#

Added any Payment Method, or specifically added one to be used as the default for their Invoices?

long dew
#

one that can be used with autocharge

peak harbor
#

Okay, then for that you check the field I mentioned above.

long dew
#

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?

peak harbor
#

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.

long dew
#

Unfortunately their support is not as good as yours. I will give it a try regardless. Thank you.

peak harbor
#

Any time!

long dew
#

On the dashboard/transactions the description is "Payment for invoice" - any way I can customise this?

peak harbor
#

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

#

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?

long dew
#

Tried description - didnt work - it shows in the "Memo" field when viewing invoice

#

in_1QGMISIjV3l864vI8eskAozz

peak harbor
#

Ah, I see, it's the description field on the underlying Payment Intent.

#

pi_3QGMKCIjV3l864vI25kG31Um

long dew
#

looks like you can

#

thanks again