Challenge
Build your Composable Commerce developer skills by completing our challenge.
After completing this page, you should be able to:
- Demonstrate that you can create, maintain, and query resources in Composable Commerce.
Congratulations on reaching this milestone!
You've completed the Developer Essentials Learning Path and are now ready to put your new Composable Commerce skills to the test. This challenge module will help you solidify your knowledge and gain practical experience.
This challenge module provides:
- Practical tasks to complete using your preferred SDK.
- The flexibility to tackle the challenge your own way. While we recommend working through the tasks in order, feel free to pick and choose what tasks to work on.
When you are ready, you can start working your way through the tasks. Once you've completed the challenge, mark this module as complete using the quiz feature at the bottom of the page.
Prepare your environment
- Update the Countries, currencies, and languages to support Australia and New Zealand.
- Enable indexing on Orders.
- Read the Project settings and programmatically check that you have the expected settings. Take note of the
trialUntil
information.
CRUD operations
- Update a Customer's phone number:
- Create a function that takes a Customer
key
,version
, and updates the phone number. - Handle version mismatch.
- Create a function that takes a Customer
- Check if a specific Product Variant (identified by an
sku
) is in stock for a given Store.- Fetch the Product Variant using Product Search or Product Projection Search.
- Determine if there is at least one Inventory entry for the Store.
- Console log a user-friendly message indicating availability.
- Build a set of functions to manage a basic Shopping Cart.
- Create a new Cart for an anonymous user.
- Add a Product (which has available inventory) to the Cart.
- Increase the quantity of the existing Line Item in the Cart (check that you have enough inventory for this item to complete the action).
- Make multiple changes to the Cart in a single request. This should include creating a Cart, adding an email address, Line Item, Country, and Locale.
HTTP API queries and Query Predicates
- Write a function that retrieves all Customers from a specific country.
- Modify the previous function to retrieve Customers from a specific city within a Country, ensuring the search is case-insensitive. (Hint: explore Query Predicates in the documentation).
- Make a request to get data for a Product Listing Page.
- Facets displayed should be: Price and Category
- Twelve Products should be displayed at a time. Display the second page of results.
- Products should be ordered by the
setCategoryOrderHint
. This ensures that Products are displayed in the correct merchandised order. - Filter by a single Store projection.
- Use the Product Projections or Product Search endpoint.
- Create a function that takes a Category's
id
and a maximum price as input and returns all the Products within that Category below the specified price. - Write a function that accepts an array of
sku
and returns all products that have at least one Product Variant matching any of the providedsku
values.
Work with GraphQL
- Make a request to get data for a Product listing page:
- Facets displayed should be: Price and Category
- Twelve Products should be displayed at a time. Display the second page of results.
- Products should be ordered by the
setCategoryOrderHint
. This ensures that Products are displayed the correct merchandised order. - Use the Product Projections or Product Search endpoint.
- Filter by a single Store projection
- The values returned should be the Product's name, ID, slug, Master Variant Image, price, and availability.
- Implement the functionality to add a Product Variant to a Customer's Cart using GraphQL mutations.
- Before adding the item to Cart, check that there is enough stock for the expected Store. If there is insufficient stock, log a message to the console.
- Create a GraphQL query that shows Customers their previous five orders. The customer should see the:
- Order ID
- Subtotal
- Shipping name
- Shipping price
- Grand total
- Order status
- Payment status
- Shopping address
- Billing address
- Line Item values: lineItems, SKU, price, special price, quantity, and total
- Bonus: sort and paginate using
createdAt
.
Import API
- Create an Import Container: programmatically create an Import Container for Products using the SDK.
- Retrieve an Import Container: fetch and log the details of the created Import Container using its
key
. - List all Import Containers: retrieve and display a list of all Import Containers and their status in your Project.
- Simulate a bulk Customer import and resolve any encountered errors using this sample Customer data.
- This sample Customer data contains various common import issues, such as missing dependencies.
- Your goal is to achieve a clean import of all ten customers in the sample data. This requires identifying and fixing errors within the sample data and ensuring your Composable Commerce Project is properly configured to accept the data.