GraphQL checkout tutorial
This tutorial describes how to place an order through GraphQl. Customers can make purchases in two ways:
- As a logged-in user
- As a guest user who does not create an account
The 10-step tutorial generally takes 30 minutes.
Magento GraphQL is designed to run queries and perform actions on behalf of a customer. Magento GraphQL does not perform backend tasks, such as manage invoices or shipments.
Before you begin
Complete the following prerequisites:
Install a Magento 2 instance with sample data. The sample data defines a functional store, called Luma, that sells fitness clothing and accessories. The store does not provide any sandbox accounts for testing credit card payments, so transactions will be simulated using an offline payment method.
Install a GraphQl client. You can use any GraphQl client to send calls to Magento. Altair is a good example.
Learn about GraphQL, how it works, and how to use it. See Introduction to GraphQL for details.
Know how to generate a customer token. See Authorization tokens for details.
In the Magento admin, create a coupon that will be used in Step 7. Apply a coupon.
Order processing tutorial shows a system integrator how REST APIs are used in the lifecycle of an order, including configuring a store and creating a customer; creating quotes, orders, invoices, and shipments; preparing for checkout; and more order-related tasks.
REST Tutorials provides additional information about completing any Magento REST tutorial.