Workflow for automatic billing

AFerrara
Shopify Partner
12 1 5

I have been searching the community for a similar use-case to see and can't find one that is matching up to what I'd like to do, so I'm hoping I can get a push in the right direction.

 

I've created an integration for two clients.  They want to cross-sell their goods, so the scenario is pretty simple, "store a" has a SKU setup that is ordered, but not fulfilled from their warehouse.  My integration service (using private app on both ends), communicates through the API and transfers the relevant order and lines and shipping information over to "store b" so they can fulfill their portion.  

 

All funds are being captured on store A, so effectively now store A just needs to pay store B for their portion.  I've been asked to automate this but since it is a private app, it doesn't appear the billing API will work?  Initial reading of the documentation seemed like it may be do-able based on setting up a recurring charge where store a is a customer of store b, then each time an order is transferred I write a usagecharge to the store.   But more in-depth reading it looks like this would only work as a public app? 

 

The other option I'll ask about is using orders or fulfillment orders.  But that seems to be a challenge with getting the actual payment portion to be automated.

 

My final idea is to just go straight to client a's merchant account using their APIs and invoke a charge that way, but since all of the other integrations are done just within the Shopify ecosystem i'm trying to keep it there...

 

Thoughts and suggestions are greatly appreciated so thanks in advance!  

Reply 1 (1)
hassain
Shopify Staff (Retired)
Shopify Staff (Retired)
624 104 184

Hey @AFerrara ,

 

That's definitely an interesting use case! Shopify does not natively support any functionality that allows merchant's to transfer money between stores in an automated fashion, so going straight to Store A's merchant account using their APIs would probably be the best approach. 

 

The Shopify Billing API was designed so that App Developers on Shopify can charge and get paid by merchants for the use of their apps. So with this in mind, it is only available for public apps on the Shopify App Store. As well, charging merchant's with a usage charge using this API will transact money from the merchant's account to your Partner organization account. For your use case if you went with this approach, you would still need to build a system that would take the money from your Partner organization account to Store B.

 

Regarding the other option of using Orders and Draft Orders - you are correct that it would be difficult to get the payment processing automated. In order to be able to do payment processing via the API, your app needs to become a Sales Channel and request for this functionality (https://shopify.dev/concepts/channels and https://shopify.dev/tutorials/complete-a-sales-channel-payment-with-checkout-api).

 

One other potential alternative could be to have your app create a checkout rather than an order, and then redirect to the webUrl of the checkout, and then use a browser automation tool (e.g. Selenium, Puppeteer) to provide all the payment details and complete the checkout on the web browser 

 

Hassain | Developer Support Specialist @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution