Billing Quickstart

Learn how to charge for your app through Appollo

You might decide to put a paywall in front of your apps premium content. Perhaps you require that merchants pay for your app immediately after sign-up. Some platforms like Shopify provide APIs for charging your users on your behalf. The proceeds are then sent to you. Appollo provides support for creating charges on these platforms.

🚧

Platform Support

Not all platforms are supported. Be sure to check if the platform is supported before sending a request. If the platform is not supported, you must handle the charge on yourself e.g. using your own stripe integration.

❗️

Platform Requirements

Some platforms require that you use their billing flow to charge users. If you don't, your app might not be approved!

Platform Requirements

Platform

Required (Platform requires usage of billing API to charge for app)

Shopify

REQUIRED

Wix

REQUIRED

Squarespace

NOT REQUIRED

WooCommerce

NOT REQUIRED

Magento

NOT REQUIRED

Etsy

NOT REQUIRED

BigCommerce

NOT REQUIRED

Square

NOT REQUIRED

Using the billing methods:

If you plan to launch a paid app to either Wix or Shopify (or both), you will need to use the Appollo billing API.

The billing API returns a checkout Url, you should redirect your users to this Url where they will be asked to pay for your app at the platform.

There are two possible ways you can charge your app users, either through our recurringCharge or singleCharge method. You should make sure to set the pricing of your app within the Appollo dashboard.

You should also make sure to get the unique ChargeId for each price from the Appollo dashboard.

The methods you can use for billing are the following:

const Appollo = require("appollo");
const appollo = new Appollo(apiKey, apiSecret);

appollo.createSingleCharge(merchantId, chargeId)
.then(res => console.log(res))
// Get a checkoutUrl for a single charge

appollo.createRecurringCharge(merchantId, chargeId)
.then(res => console.log(res))
// Get a checkoutUrl for a recurring charge

You now need to redirect your users to the checkoutURL to accept or decline the charges. When they accept or decline, we will call your webhook endpoint with a payload.

Accepted Charge

{
  "appollo_merchant_id": MERCHANT_APPOLLO_ID,
  "merchant_name":  MERCHANT_NAME,
  "merchant_email": MERCHANT_EMAIL,
  "merchant_shop": MERCHANT_SHOP_DOMAIN,
  "platform": MERCHANT_PLATFORM
  "topic": "billing_update",
  "created_at":  CREATION_DT,
  "last_update_at":  UPDATE_DT,
  "data":{
         "id": WEBHOOK_ID
         "type": "PLAN_PURCHASE"
        }
 }

Declined Charge

{
  "appollo_merchant_id": MERCHANT_APPOLLO_ID,
  "merchant_name":  MERCHANT_NAME,
  "merchant_email": MERCHANT_EMAIL,
  "merchant_shop": MERCHANT_SHOP_DOMAIN,
  "platform": MERCHANT_PLATFORM
  "topic": "billing_update",
  "created_at":  CREATION_DT,
  "last_update_at":  UPDATE_DT,
  "data":{
         "id": WEBHOOK_ID
         "type": "PLAN_CANCEL"
        }
 }

Did this page help you?