What's your biggest current challenge? Have your say in Community Polls along the right column.
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Re: Getting error in SellingPlanRecurringPricingPolicy API

Getting error in SellingPlanRecurringPricingPolicy API

thimatic
Shopify Partner
8 0 0

Hello There,

We are trying to implement the "SellingPlanRecurringPricingPolicy" while creating a subscription group but getting the error.
Here is the error: "Exactly one field must have a value per selling plan pricing policy".
Here is the code that we are using:

 

 

 

{
    "status": false,
    "payload": {
        "input": {
            "appId": "appId",
            "name": "PRICING POLICY RECURING",
            "merchantCode": "PRICING POLICY RECURING",
            "options": [
                "PRICING POLICY RECURING"
            ],
            "position": 1,
            "sellingPlansToCreate": [
                {
                    "name": "Delivered Every Week",
                    "options": [
                        "1"
                    ],
                    "position": 1,
                    "billingPolicy": {
                        "recurring": {
                            "interval": "WEEK",
                            "intervalCount": 1
                        }
                    },
                    "deliveryPolicy": {
                        "recurring": {
                            "interval": "WEEK",
                            "intervalCount": 1
                        }
                    },
                    "pricingPolicies": {
                        "fixed": {
                            "adjustmentType": "PERCENTAGE",
                            "adjustmentValue": {
                                "percentage": 10
                            }
                        },
                        "recurring": {
                            "adjustmentType": "PERCENTAGE",
                            "adjustmentValue": {
                                "percentage": 20
                            },
                            "afterCycle": 1
                        }
                    }
                }
            ]
        }
    },
    "message": "Exactly one field must have a value per selling plan pricing policy"
}

 

 

 


How can we fix this issue?
Thank you.

Reply 1 (1)

hernancarrizo
Tourist
3 0 5

If you want to specify two pricing policies (which seems to be the case). You should specify the "pricingPolicies" as an array that contains boths policies (an object for your recurring one and another object, second element in the array, for your fixed policy)