1 payment split into multiple orders different merchants

I am using the new JS Square Payment Form to collect customer credit card information and this returns a Nonce. I have a need to have this payment go to multiple merchants. For example, it could be 1 food order going to a food truck operated by one merchant, but then a drink order that needs to go to a different merchant that operates the bar. I only want the customer to have to go through the checkout process and pay one time. I’m trying to find a way to accomplish this. Need to know if there is a way that I’m not thinking of or an API that I could leverage. What I am thinking of doing is that I would need to call CreateCustomer and then CreateCard on both of these merchant’s accounts in square. Then, I would create an Order into both of their accounts and Pay for the order using the respective Card ID that I have created and stored under their separate square accounts. In other words, I would have to store the card under both of these merchant’s accounts so that I would be able to pay for the order. Would this work or is the card only able to be stored once per SQ Payment Form that is rendered? I only want the customer to have to pay one time and I am going to tally up the entire order amount and then ideally have each merchant’s square account process their respective portion of the order. Or, is there a way I can collect the money into my own developer square account and then push a paid Order into each merchant’s account instead of me having to essentially run the payment through twice (once on each merchant’s account)?

Hello! :wave: Each nonce generated by the Web Payments SDK (Square’s new Payment Form) can only be used once regardless of if you are using it to create a payment or store a card on file. Unfortunately, this means that if you wanted to store the card on file for two merchants, they would need to enter it twice.

Square’s APIs does not currently support multi-party payment or transferring funds directly from your account to another Square account. If you wanted to go the route of accepting funds to your own account before distributing them to the merchants, your app would need to handle the distribution of funds outside of Square.

Thank you for the response, I had a feeling that might be the case. However, I stumbled across an article that might work for me. It looks like I might be able to store the card as a “shared” card under my own developer account and from there, use that card to make payments and create orders to the other merchants that are part of my overall order? I would just have to split things out programmatically and then use the saved card under my developer account as the payment source. Would this work? It is under the section titled “Store and charge a card on behalf of a seller account”

This should work for your flow, as long as you’re okay with associating the “overall order” on your end (since for Square, the two payments will belong to two separate orders) :slight_smile: