Issue:
We are unable to create hosted subscriptions with tiered plans in rapyd. Whenever I tried to create a hosted subscription with tiered plan through api, it gave me an error “Add a plan with ‘billing_scheme’ with the following value: ‘per_unit’”.
But I need a subscription with a tiered plan.
Step 1.
with plan.json file I have hit the plan post api and get response successfully.
Step 2.
In the checkout/subscription api I have used checkout-subscription.json file but did not get success result. error mentioned above.
{
"customer": "cus_7e9a93edfa9e2c0d6128045a38xxxxxx",
"merchant_reference_id": "cus_7e9a93edfa9e2c0d6128045a38xxxxxx",
"country": "pk",
"language": "en",
"billing": "pay_automatically",
"simultaneous_invoice": true,
"cancel_at_period_end": true,
"coupon": "",
"payment_fees": {
"fx_fee": {
"calc_type": "net",
"fee_type": "percentage",
"value": 2.5
}
},
"subscription_items": [{
"plan": "plan_1dffe87d824287c1893db70245xxxxxx",
"quantity": 1
}],
"metadata": {
"merchant_defined": true
},
"tax_percent": 10.5,
"complete_payment_url": "https://qari.jenzo.pk/std/requests?contractId=dsdsdsd",
"error_payment_url": "https://example.com/error",
"page_expiration": 1672470811,
"trial_from_plan": false,
"trial_period_days": null
}
Rapyd Response:
{
"status": {
"error_code": "ERROR_HOSTED_PAGE_MVP_SUBSCRIPTION_INVALID_PLAN_BILLING_SCHEME",
"status": "ERROR",
"message": "The request tried to create or update a subscription through a hosted page solution flow, but the value of the 'billing_scheme' parameter related to the plan is invalid. The request was rejected. Corrective action: Add a plan with 'billing_scheme' with the following value: 'per_unit'. This could change in the future, if we decide to support more use cases.",
"response_code": "ERROR_HOSTED_PAGE_MVP_SUBSCRIPTION_INVALID_PLAN_BILLING_SCHEME",
"operation_id": "bcc13b0a-9f58-496f-8285-375fb53ca133"
}
}