Subscribe customer to products 🔄

Now that we have Created our first Product 🎛️ and Added customers to Plutto 👥 we're ready to create our first subscription

The only thing we have to do is make this request

When creating a subscription, you have to also send this data:

  • bills_at: Choose if you want to bill your customers at the start or the end of a period. (Netflix is an example for the start of a period, Heroku for the end).
  • billing_period_duration: Select the length of each period (i.e monthly, daily, etc).
curl --request POST \
     --url https://sandbox.getplutto.com/api/v1/plan_subscriptions \
     --header 'Accept: application/json' \
     --header 'Authorization: Bearer <your-api-key>' \
     --header 'Content-Type: application/json' \
     --data '
{
     "customer_id": "<your-customer-id>",
         "pricing_ids": ["pricing_5198c6ad60c3363b089a1422"]
     "bills_at": "end",
     "billing_period_duration": "P1M",
}
'

🚧

Bills_at and metered pricings

When using metered pricings, the related subscription MUST bill at the end of the period, so you can get usage while during this period.

Note that the pricing_id can be obtained in products section inside Plutto

Important:
You can subscribe your customers to a product using one of the many pricings yo have created for this product. Make sure to suscribe a customer only once to each product.

pricing_idpricing_id

pricing_id

The customer_id is the same you send as identifier when creating customers. In case you didn't provided the identifier you must use the field id provided by us.

You can always update a customer if you forgot to add your own identifier.