Skip to content

Commit 870d686

Browse files
riqwanshahednasser
andauthored
docs: update pricing module docs with the latest changes (medusajs#5749)
Co-authored-by: Shahed Nasser <[email protected]>
1 parent deca78f commit 870d686

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

www/apps/docs/content/experimental/pricing/examples.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,18 @@ export async function POST(request: Request) {
2121
const pricingService = await initializePricingModule()
2222
const body = await request.json()
2323

24+
// A rule type with `rule_attribute=region_id` should
25+
// already be present in the database
2426
const priceSet = await pricingService.create([
2527
{
28+
rules: [{ rule_attribute: "region_id" }],
2629
prices: [
2730
{
2831
currency_code: body.currency_code,
2932
amount: body.amount,
33+
rules: {
34+
region_id: body.region_id,
35+
},
3036
},
3137
],
3238
},
@@ -248,4 +254,4 @@ export async function GET(
248254

249255
## More Examples
250256

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

0 commit comments

Comments
 (0)