Query Create and Update Customer via GraphQL
Author:
Fluent Commerce
Changed on:
12 July 2024
Overview
A best practice guide of creating customer entity.Key points
- A user guide on how to manage customer entities in OMS.
- Best practice guide on creating Customer entity in OMS before the createOrder mutation.
- Relationship between user entity and customer entity.
Query Customer in OMS
The user can use the`customers` or `customer` queries to search/retrieve customer data in the OMS.The GraphQL schema can be found here:https://api.production.shared-sydney-01.fluentcommerce.com/graphql/docs/operation/query/Here is a sample GraphQL `customer` query:Create Customer in OMS
The user can use the`createCustomer` mutation to create a customer entity in the OMS.The GraphQL schema can be found here:https://api.production.shared-sydney-01.fluentcommerce.com/graphql/docs/mutation/createcustomer/Here is a sample GraphQL `createCustomer` mutation:Update Customer in OMS
The user can use the`updateCustomer` mutation to update a customer entity in the OMS.The GraphQL schema can be found here:https://api.production.shared-sydney-01.fluentcommerce.com/graphql/docs/mutation/updatecustomer/Here is a sample GraphQL `updateCustomer` mutation:Best practice for creating Customers in OMS
Validate customer details before Order Creation
Since the`createOrder` mutation requires a customer ID, the below flowchart demonstrates the best practice for creating a customer: