Create a plan with ID validation¶
In Ecovelo API a plan is called Forfait
This object contains a lot of parameters as we offer many possibilities for you to setup your bike-sharing service pricing.
We will only see the parameter needed for our example, to see them all, Check out the Forfait endpoints
Here are the specifications of the plan we are going to create:
The plan is called “Annual - under 26yo”
It is an non recurring annual subscription of 10€
To subscribe to this plan, the user must have 26yo or less
The user can rent right after subscribing, even if it’s ID card is still not validated
A deposit of 50€ is asked
The trips are billed monthly
The first 30 minutes of each trip are free. Then, it’s 0.50€ per hour
POST /programs/<service>/forfaits¶
Request body¶
{
"name": "Annual - under 26yo",
"plan": {
"amount": 1000,
"interval": "year",
"interval_count": 1,
"nickname": "annual"
},
"allow_renting_if_not_validated": true,
"billing_for_trips_interval": "month",
"deposit": 5000,
"plan_items": [
{
"amount": 0,
"interval_multiplier": 30,
"payment_capture": "next_invoice",
"payment_trigger": "renting",
"payment_type": "variable",
"round": "up",
"start_at": 0,
"end_at": 30,
"statement_descriptor": "first 30 minutes",
"vehicule_type": "any"
},
{
"amount": 50,
"interval_multiplier": 60,
"payment_capture": "next_invoice",
"payment_trigger": "renting",
"payment_type": "variable",
"round": "up",
"start_at": 30,
"statement_descriptor": "each hour more",
"vehicule_type": "any"
}
],
"recurring": false,
"supporting_documents": [
"ID card"
],
"vehicule_type": [
"any"
],
"with_manual_validation": true,
"with_pass": false
}
Note
We create a plan in draft status. This way, we can always check if everything is OK before changing it to live