#befa_api

1 messages · Page 1 of 1 (latest)

wheat irisBOT
#

👋 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/1394946837848522773

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

molten karma
#

Hi! Any specific reason why you need to create the invoice before you know which customer is it for?

foggy prawn
#

Hello, our platform allows brands to distribute discount vouchers. We are implemented on cash register systems (in pharmacies for now), and we need to transfer the amount of the value of a discount voucher from the brand's account to the pharmacy's account. For example, L'Oreal issues a voucher for €1 off a tube of cream. When the discount voucher is used by a consumer in a pharmacy, we must transfer €1 from L'Oreal's account to the pharmacy's account.

#

When I asked how we could provide these features I was told that the best way to handle that would be to create a payment and manage distinct transfer

#

Which seems to make sense but when I try to create the payment I receive an error stating that I must provide a customerId or a privous invoiceId (which is the same since I guess that previous invoice should target a customerId

molten karma
#

Are these accounts (L'Oreal and the pharmacy) Connect accounts?

foggy prawn
#

Yes they are connected accounts

molten karma
#

But can I check if you have to Invoice for the payments?

foggy prawn
#

Indeed I was told to use seperate charges and transfer

foggy prawn
#

Oh you mean that maybe we can create a payment without producing an invoice ?

molten karma
#

Oh you mean that maybe we can create a payment without producing an invoice ?

Yeap

foggy prawn
#

OK. I still can use the on_behalf_of parameter so the amount of money is still "attached" to my connected account. And this payment_intent will return a virtual IBAN or something like that so the brand can make the payment this way?

molten karma
#

What payment method are you using?

foggy prawn
#

Bank transfer for the most part. Some brand may want to use credit card but since we're dealing with major companies they will most of the time make a bank transfer

wheat irisBOT
opal fractal
#

Hey, taking over here. Let me know if there's any follow-up Qs I can answer!

#

Which seems to make sense but when I try to create the payment I receive an error stating that I must provide a customerId or a privous invoiceId (which is the same since I guess that previous invoice should target a customerId
Do you have an example request that throws this error? ID will be req_xxx

foggy prawn
#

req_jTuCXUFw1fQtiD

#

Here is the request method.

#

sam_stripe told me that instead of creating an invoice I should create a payment_intent

opal fractal
#

Do you need an invoice?

foggy prawn
#

Which makes sense.

#

No I don't I am already building my own invoice by my side

#

I was having a look at the payment_intent object and was wondering what kind of response it can provide. If I choose bank_transfer as payment method. Does it returns a virtual IBAN where my client can make the bank transfer to ?

opal fractal
foggy prawn
#

So how can I create this payment without knowing this customer?

#

Should I make a dummy customer? Or create a customer with the same data that my connected account? It doesn't feel really nice to do it this way

opal fractal
#

Well if you're doing separate charges and transfers all the related objects will need to exist on the platform account

#

You need a Customer object on the platform to do what you want to do

#

How you model that is entirely up to you!

foggy prawn
#

OK, so I HAVE to create a customer, even a dummy one to be able to create this payment_intent. But if the customer and the connected accounts have the same informations it won't be blocked on the platform ?

opal fractal
#

But if the customer and the connected accounts have the same informations it won't be blocked on the platform
Not sure I understand this part

#

No, the same 'customer' can exist on multiple Stripe accounts. We'd probably recommend keeping some kind of internal mapping in your systems to explain that customer X is represented by cus_abc on platform and cus_xyz on the connected account

If that makes sense..

foggy prawn
#

OK, I will handle it this way.

foggy prawn
opal fractal
#

Nope, no validation like that exists. We just care that the cus_xxx ID you pass to customer parameter exists on the account you're creating the payment on (platform in your case)

foggy prawn
#

But maybe there is no double check like this on your side so I just need to handle teh customer and the connected account for each brand on my side (which isn't a problem)

#

OK so that's fine for me. Thank you for yur help

opal fractal
#

No problem, glad I could help!

foggy prawn
#

Have a nice day