We are looking to be able to have a sales channel know what sales came from what store so we can correctly bill usage charges. We see in the documentation here (step 3) you can attribute to a store but it only shows how the store can see now but no clear API response for the sales channel to get for tracking purposes.
1. Can we use in the draftOrder instead of Cart Permalink?
2. How can we track orders created by Cart Permalink on the sales channel end (not just store)?
3. How can we go past 'The store can not accept payment' for the test stores so we can fully test pseudo-transactions in a sandbox?
I have to be honest I have never created a sales channel app but I maybe I can give you a few tips on how I would go about it.
If you look at the requirements for sales channels specifically the payments and order management section your app will automatically be assigned a scope that allows it to read the orders that it creates (and only those orders).
1) Honestly not sure on the right answer here, but I would suspect that you can't create a draft order from the sales channel directly thats kinda what the permalink does is set up the checkout with the products you specify.
2) make sure you attribute the order via the storefront access token or I don't think Shopify will know that your sales channel was responsible for the sale
3) set up the Bogus Payment Gateway on the test store
With the attribution shopify will know that your sales channel was responsible for making the sale, with the
read_only_own_orders scope you will be able to query the shops orders and find out exactly how many orders your channel was responsible for (which means you could charge the merchant for those orders as per your fee structure).
You could set up a cron job and using query parameters find our how many orders were added since the last time you ran the cron job, add them to your own db so you can provide the merchant reporting. If you have access to webhooks then you could create an orders/create webhook and get informed every time an order (maybe in this case only your own orders) are created.
Hope this helps,