TanqoryDocs

Charging merchants

Create a subscription for your app, send the merchant to approve it, and check what the store pays for.

Your app charges a store through the Admin API. The merchant approves each charge in the store dashboard, and it is added to the store's Tanqory bill. On a development store every charge is a test charge.

Charging a merchant, from the charge to your payout
  1. Your app → Tanqory appSubscriptionCreate: name, price, returnUrl
  2. Tanqory → Your app confirmationUrl; the subscription is PENDING
  3. Your app → Merchant Opens confirmationUrl at the top of the browser
  4. Merchant → Tanqory Approve charge, within 48 hours (store owner or admin)
  5. Tanqory The subscription is ACTIVE; an app_subscriptions/update webhook goes to your app
  6. Merchant → Your app Comes back to returnUrl with charge_id
  7. Your app → Tanqory Checks activeSubscriptions before unlocking the plan
  8. Tanqory Each period, the charge goes on the store's Tanqory bill (never a test charge)
  9. Tanqory → Your organization Your share, paid out on the 1st and the 16th once your payout account and tax form are set up

1. Create the charge

GraphQL
mutation Subscribe($name: String!, $returnUrl: URL!, $lineItems: [AppSubscriptionLineItemInput!]!, $test: Boolean) {
  appSubscriptionCreate(name: $name, returnUrl: $returnUrl, lineItems: $lineItems, test: $test) {
    appSubscription { id status }
    confirmationUrl
    userErrors { field message }
  }
}
JSON
{
  "name": "Basic",
  "returnUrl": "https://example.com/billing/return",
  "test": true,
  "lineItems": [
    { "plan": { "appRecurringPricingDetails": { "price": { "amount": 9.99, "currencyCode": "USD" }, "interval": "EVERY_30_DAYS" } } }
  ]
}

The subscription starts as PENDING, and the answer carries a confirmationUrl.

2. Send the merchant to approve it

Open confirmationUrl at the top level of the browser, not inside your frame. An embedded app does this with App Bridge's redirect.remote.

The page Approve app charge shows your app, the plan, the price, the first charge date and the currency, and on a development store "This is a test charge. You won't be billed." The merchant selects Approve charge or Decline charge. The request expires after 48 hours.

After approving, the merchant comes back to your returnUrl, with charge_id added to it.

3. Check what is active

GraphQL
{
  currentAppInstallation {
    activeSubscriptions {
      name
      status
      test
      currentPeriodEnd
      lineItems { plan { pricingDetails { ... on AppRecurringPricing { price { amount currencyCode } interval } } } }
    }
  }
}

An approved subscription is ACTIVE. Check this on your server before you unlock what the merchant paid for; never trust the return alone.

Other kinds of charges

The prices in your app must match the pricing plans in your listing.

What reaches the store's bill

Only an approved, non-test charge in US dollars on a store that is not a development store is put on the store's Tanqory bill, and only that earns you a share. Two kinds of charge are accepted but held instead, never billed and never paid out:

  • Charges on a development store. Every charge there is a test charge, whatever test you send, so you can try the whole flow for free.
  • Charges in another currency. The store's bill is in USD for now. A charge whose currencyCode is not USD can still be created and approved, but it is held and not billed. Price your plans in USD.

Built from commit c0b3fb3fdef7 · API version 2026-10