docs: update pricing module docs with the latest changes (#5749)
Co-authored-by: Shahed Nasser <27354907+shahednasser@users.noreply.github.com>
This commit is contained in:
co-authored by
Shahed Nasser
parent
deca78f749
commit
870d686136
@@ -21,12 +21,18 @@ export async function POST(request: Request) {
|
|||||||
const pricingService = await initializePricingModule()
|
const pricingService = await initializePricingModule()
|
||||||
const body = await request.json()
|
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([
|
const priceSet = await pricingService.create([
|
||||||
{
|
{
|
||||||
|
rules: [{ rule_attribute: "region_id" }],
|
||||||
prices: [
|
prices: [
|
||||||
{
|
{
|
||||||
currency_code: body.currency_code,
|
currency_code: body.currency_code,
|
||||||
amount: body.amount,
|
amount: body.amount,
|
||||||
|
rules: {
|
||||||
|
region_id: body.region_id,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user