From 870d686136ae1f0def062a98f0c308c702d32cba Mon Sep 17 00:00:00 2001 From: Riqwan Thamir Date: Tue, 28 Nov 2023 10:56:57 +0100 Subject: [PATCH] docs: update pricing module docs with the latest changes (#5749) Co-authored-by: Shahed Nasser <27354907+shahednasser@users.noreply.github.com> --- www/apps/docs/content/experimental/pricing/examples.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/www/apps/docs/content/experimental/pricing/examples.md b/www/apps/docs/content/experimental/pricing/examples.md index 4083b150f8..cde465cddb 100644 --- a/www/apps/docs/content/experimental/pricing/examples.md +++ b/www/apps/docs/content/experimental/pricing/examples.md @@ -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, + }, }, ], }, @@ -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. \ No newline at end of file +The [module interface reference](../../references/pricing/interfaces/IPricingModuleService.mdx) provides a reference to all the methods available for use with examples for each.