Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: update pricing module docs with the latest changes #5749

Merged
merged 7 commits into from
Nov 28, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion www/apps/docs/content/experimental/pricing/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,18 @@ export async function POST(request: Request) {
const pricingService = await initializePricingModule()
const body = await request.json()

// A rule type with `rule_attribute=region_id` should
// already be present in the database
const priceSet = await pricingService.create([
{
rules: [{ rule_attribute: "region_id" }],
prices: [
{
currency_code: body.currency_code,
amount: body.amount,
rules: {
region_id: body.region_id,
},
},
],
},
Expand Down Expand Up @@ -248,4 +254,4 @@ export async function GET(

## More Examples

The [module interface reference](../../references/pricing/interfaces/IPricingModuleService.mdx) provides a reference to all the methods available for use with examples for each.
The [module interface reference](../../references/pricing/interfaces/IPricingModuleService.mdx) provides a reference to all the methods available for use with examples for each.