Recipe for creating subscriptions orders using only the API

Hi all,

I’m using Magedelight’s Subscription Now Pro to allow for recurring subscription orders but it’s cron based order processor has no sense of “bundling”. That is, if a single customer orders subscribes to two products at the same time (with the same frequency) two different subscription profiles are created (one for each product) and when the time comes to send, they’re treated as two separate orders with two separate shipping costs.

To get around this, I am considering creating my own processor that would be written in PHP but not leverage the Magento framework. It would directly read the subscriber table created by the Subscribe Now Pro plugin to identify items and order that need to be created. The “bundling” logic would be handled there. For creating the actual order I am looking at using the Rest APIs to create a cart on behalf of the customer, populate the cart with the products that need to be shipped, and then process the order. Payment for subscription items is handled via a reusable customer/payment token so requires no interaction with the customer.

I’m still fairly new to Magento so really just looking for a gut check here. Does this sound like a reasonable approach? Do you know of any existing code (github?) that has a demo of how to create an order on behalf of a customer? Is there an easier way?

Thanks!

submitted by /u/kwisatzcraperach
[link] [comments]