Extending controllers

module.exports = {

create: async (ctx) => {

    const { Name, Total, items, stripeTokenId } = ctx.request.body;

    const { id } = ctx.state.user;

    console.log('user', ctx.state.user);

    console.log('id', id);

    const charge = await stripe.charges.create({

        amount: Math.round(Total * 100),

        currency: 'usd',

        source: stripeTokenId,

        description: `order ${new Date()}`


    const order = await strapi.services.order.create({




        user: id


    return order;


Hi all,I am just new to the strapi.
1.My question is we have to extend the controllers to create/update/delete data or for example add entries.
2.Or because I have created a relation between 1 user-> multiple orders,to link user and orders i.e user who is creating orders should be configured in extending controllers.in other words user is creating order from the front end by sending data like Name,Total,items …
3.I am just not able to understand the logic.I am just learning react+ strapi course.
4.Precisely why we have to extend the controllers.

Can you please format your code using the code blocks please? It’s quite difficult to read.