This repository has been archived by the owner on Apr 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 389
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1062 from Shopify/liz/lineitem-billing
LineItem billing support
- Loading branch information
Showing
12 changed files
with
1,358 additions
and
163 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
--- | ||
"@shopify/shopify-api": minor | ||
--- | ||
|
||
Line Item Billing | ||
|
||
Now with the future flag `unstable_lineItemBilling` you can specify multiple line items in a single billing request. This will allow you to create a single billing request for a subscription with both recurring and usage based app billing. | ||
|
||
You will define the new billingConfig as follows. | ||
|
||
```ts | ||
const shopify = shopifyApp({ | ||
billing: { | ||
"MultipleLineItems": { | ||
replacementBehavior: BillingReplacementBehavior.ApplyImmediately, | ||
trialDays: 7, | ||
lineItems: [ | ||
{ | ||
interval: BillingInterval.Usage, | ||
amount: 30, | ||
currencyCode: "USD", | ||
terms: "per 1000 emails", | ||
}, | ||
{ | ||
interval: BillingInterval.Every30Days, | ||
amount: 30, | ||
currencyCode: "USD", | ||
discount: { | ||
durationLimitInIntervals: 3, | ||
value: { | ||
amount: 10, | ||
}, | ||
}, | ||
}, | ||
], | ||
}, | ||
}, | ||
futures: { | ||
unstable_lineItemBilling: true, | ||
} | ||
}); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.