Setup order attribution for SMS marketing app

Hey folks. We built a standalone sms marketing app. Want to bring it to shopify app store. The main goal is to setup revenue attribution for subscribers that purchase coming from our app.

Has anyone done this before? Not sure how to approach this.