You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Create/Update Commerce API documentation with Axios examples #117
What are you trying to do?
I have a project which uses decoupled frontend on Nuxt.js and headless Craft as backend/api.
My task is to implement cart logic on the frontend (get cart, add items, remove items, checkout procedure etc.), so I have to use GraphQL/axios calls.
However I find it a little bit challenging to implement all Axios calls for cart, as currently GraphQL supports only product/variant, but not cart/order/checkout; And there are no examples of handling Commerce API with Axios on decoupled frontend (only twig template code examples) in documentation.
What's your proposed solution?
It would be really great to have documentation with the way of handling API with Axios independently from twig code
(with available methods, query parameters, body parameters etc.), at least until Commerce is fully manageable by GraphQL
changed the title [-]Update Commerce documentation with Axios API examples[/-][+]Crate/Update Commerce API documentation with Axios examples[/+]on Dec 11, 2020
changed the title [-]Crate/Update Commerce API documentation with Axios examples[/-][+]Create/Update Commerce API documentation with Axios examples[/+]on Dec 11, 2020
Activity
[-]Update Commerce documentation with Axios API examples[/-][+]Crate/Update Commerce API documentation with Axios examples[/+][-]Crate/Update Commerce API documentation with Axios examples[/-][+]Create/Update Commerce API documentation with Axios examples[/+]mattstein commentedon Feb 25, 2021
Hey @Stalex89, we’ve got a Controller Actions page for the Commerce documentation that’ll be launching alongside Commerce 3.3. It’s modeled after Craft’s own Controller Actions page and it should help in this case. Take a peek here if you’d like: https://github.com/craftcms/docs/blob/next/commerce/docs/commerce/3.x/dev/controller-actions.md
There aren’t Axios-specific examples, but that would look similar to the jQuery example here: https://craftcms.com/docs/commerce/3.x/orders-carts.html#fetching-a-cart
Stalex89 commentedon Feb 25, 2021
Hi @mattstein, thank you very much for the information, I will check it 😃
mattstein commentedon Feb 25, 2021
Also snuck in an Axios example here just for good measure: https://craftcms.com/docs/commerce/3.x/orders-carts.html#fetching-a-cart
🤫