Skip to content

Commit 87399c4

Browse files
authored
Merge pull request Shopify#620 from Shopify/usage-billing
Usage Based Billing Helper functions
2 parents 3007e30 + 4fbc4ff commit 87399c4

File tree

5 files changed

+282
-216
lines changed

5 files changed

+282
-216
lines changed

docs/usage/billing.md

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,33 @@ const shopify = shopifyApi({
4141

4242
This setting is a collection of billing plans. Each billing plan allows the following properties:
4343

44+
### One Time Billing Plans
4445
| Parameter | Type | Required? | Default Value | Notes |
4546
| --------------------- | ---------------------------- | :-------: | :-----------: | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
4647
| `amount` | `number` | Yes | - | The amount to charge |
4748
| `currencyCode` | `string` | Yes | - | The currency to charge, currently only `"USD"` is accepted |
48-
| `interval` | `BillingInterval` | Yes | - | `BillingInterval` value |
49-
| `trialDays` | `number` | No | - | Give merchants this many days before charging. _Not available for `OneTime` plans_ |
50-
| `replacementBehavior` | `BillingReplacementBehavior` | No | - | `BillingReplacementBehavior` value, see [the reference](https://shopify.dev/api/admin-graphql/2022-07/mutations/appSubscriptionCreate) for more information. _Not available for `OneTime` plans_ |
49+
| `interval` | `ONE_TIME` | Yes | - | `BillingInterval.OneTime` value
50+
51+
### Recurring Billing Plans
52+
| Parameter | Type | Required? | Default Value | Notes |
53+
| --------------------- | ---------------------------- | :-------: | :-----------: | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
54+
| `amount` | `number` | Yes | - | The amount to charge |
55+
| `currencyCode` | `string` | Yes | - | The currency to charge, currently only `"USD"` is accepted |
56+
| `interval` | `EVERY_30_DAYS`, `ANNUAL` | Yes | - | `BillingInterval.Every30Days`, `BillingInterval.Annual` value |
57+
| `trialDays` | `number` | No | - | Give merchants this many days before charging |
58+
| `replacementBehavior` | `BillingReplacementBehavior` | No | - | `BillingReplacementBehavior` value, see [the reference](https://shopify.dev/api/admin-graphql/2022-07/mutations/appSubscriptionCreate) for more information. |
59+
60+
### Usage Billing Plans
61+
62+
| Parameter | Type | Required? | Default Value | Notes |
63+
| --------------------- | ---------------------------- | :-------: | :-----------: | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
64+
| `amount` | `number` | Yes | - | The maximum amount the merchant will be charged |
65+
| `currencyCode` | `string` | Yes | - | The currency to charge, currently only `"USD"` is accepted |
66+
| `interval` | `USAGE` | Yes | - | `BillingInterval.Usage` |
67+
| `usageTerms` | `string` | Yes | - | These terms stipulate the pricing model for the charges that an app creates. |
68+
`trialDays` | `number` | No | - | Give merchants this many days before charging |
69+
| `replacementBehavior` | `BillingReplacementBehavior` | No | - | `BillingReplacementBehavior` value, see [the reference](https://shopify.dev/api/admin-graphql/2022-07/mutations/appSubscriptionCreate) for more information. |
70+
5171

5272
## Checking for payment
5373

0 commit comments

Comments
 (0)