How to add trail billing cycle ?

Aditykumarsinha
Contributor
Contributor

I have created a plan with a billing cycle of 

[{
tenure_type,
sequence: 1,
total_cycles: 0,
frequency: {
interval_count: 1,
interval_unit: 'YEAR'
},
pricing_scheme: {
fixed_price: {
value: 100,
currency_code: 'USD'
}
}
}]


but for some customers i want to add a trial period to this plan 
so using the create subscription api was changing the billing cycle to 
[
{
tenure_type: 'TRIAL',
sequence: 1,
total_cycles: 1,
frequency: {
interval_count: 1,
interval_unit: 'MONTH'
},
pricing_scheme: {
fixed_price: {
value: 0,
currency_code: 'USD'
}
}
},
{
tenure_type: 'REGULAR',
sequence: 2,
total_cycles: 0,
frequency: {
interval_count: 1,
interval_unit: 'YEAR'
},
pricing_scheme: {
fixed_price: {
value: 100,
currency_code: 'USD'
}
}
}
]

but it throws an error 

{
"name": "UNPROCESSABLE_ENTITY",
"message": "The requested action could not be performed, semantically incorrect, or failed business validation.",
"debug_id": "#id",
"details": [
{
"field": "/plan/billing_cycles/1/sequence",
"value": "2",
"location": "body",
"issue": "INVALID_BILLING_CYCLE_SEQUENCE",
"description": "The provided billing cycle sequence is not available."
}
],
"links": [
{
"rel": "information_link",
"method": "GET"
}
]
}

i am not able to understand what is that i am doing wrong here 
please help
Login to Me Too
0 REPLIES 0

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.