Discussing APIs and development related to customers, discounts, and order management.
I am looking to add comments using REST API on customer object, and I am able to add these comments from front-end easily requests are hitting https://admin.shopify.com/api/shopify/store-name?operation=TimelineCommentCreate&type=mutation with message and other variables but when I read the documentation it tells that mutation timelineCommentCreate doesn't exist on the 'Mutation' type.
How can we achieve this?
Hi Abdul_Qayyum,
The timelineCommentCreate
mutation is not available in Shopify's public API. If you want to store extra data about a customer, one workaround could be to use Metafields. You can create a new metafield for a customer and store your comment there. You can use the metafieldCreate
mutation in the GraphQL API, or you can use the /admin/api/#{api_version}/customers/#{customer_id}/metafields.json
endpoint in the REST API to do this.
Hope this helps,
Liam | Developer Advocate @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog
Is there any way i can create the activity using REST API?
I just want to create a timeline activity programmatically in Shopify using REST API or something else if Comment APIs are not available!
same here, is it on the backlog to add this to the api rest or graphql? would be great if we can add events to the timeline for specific orders through the api