Overview

Off-App Purchases let you generate a URL that your users can use to purchase a specific offering from your web or mobile app.

When opening the Off-App Purchase URL, customers sign up and confirm their purchase with Supertab. After completion, Supertab redirects the customer back to your app.

Prerequisites

Before generating a URL, make sure you have:

  • A Site with a URL you wish to use as the post-purchase redirect destination.
  • An Offering available for purchase.

Include the following required query parameters to generate a valid purchase link:

  • client_id – A live or test client ID associated with the Site you created.
  • offering_id – The ID of the Offering the user is purchasing.
Purchase URL
https://purchase.supertab.co/?client_id=client.your_client&offering_id=offering.your_offering

Metadata

You can optionally include a metadata parameter with custom key-value pairs. This metadata:

  • Is returned in the metadata query parameter during the redirect back to your app.
  • Is also attached to the purchase object after confirmation.

How to encode metadata:

  1. Format metadata as a URL query string (e.g. user_id=123&nonce=456).
  2. Then encode using URL component encoding (e.g. user_id%3D123%26nonce%3D456).
const metadata = {
    user_id: "123",
    nonce: "456",
    timestamp: Date.now()
};

const queryString = new URLSearchParams(metadata).toString();
const encodedMetadata = encodeURIComponent(queryString);

const purchaseUrl = `https://purchase.supertab.co/?client_id=client.your_client&offering_id=offering.your_offering&metadata=${encodedMetadata}`;

Example with metadata:

Purchase URL with Metadata
https://purchase.supertab.co/?client_id=client.your_client&offering_id=offering.your_offering&metadata=user_id%3D123%26nonce%3D456

Handling the Redirect

The customer is redirected to your app when they have completed the purchase flow.

ParameterDescriptionExample
purchase_idThe ID of the purchase.”purchase.cf637646-71a4-430d-aaea-a66f1a48a83c”
statusThe purchase status.
  • completed – the purchase was successful
  • abandoned – the user abandoned the purchase
”completed”
offering_idThe ID of the selected offering, passed in the original purchase URL.”offering.4df706b5-297a-49c5-a4cd-2a10eca12ff9”
metadataThe custom key-value metadata you included in the original URL.”user_id=123&nonce=456”