Custom node.js app - bundling through additional selections

Hello,

I’ve been developing an application which would allow me to create bundled products (products with multiple checkbox, where each checkox have a price). A rough vizualisation would be a pizza with extra toppings, each of the topping costs extra. The idea is to use the product as a base, add custom options through custom app and display them on product view. I’ve successfully tried to modify the order (orderDraft) through graphql on DRAFT_ORDERS_CREATE hook:

mutation draftOrderUpdate($id: ID!, $input: DraftOrderInput!) {
    draftOrderUpdate(id: $id, input: $input) {
      draftOrder {
         id
      }
    }
}

{
  "id": "gid://shopify/DraftOrder/853743730880",
  "input": {
   "lineItems": [
    {"title": "hello - world ?", "originalUnitPrice": 16, "quantity": 1 }
   ]
  }
}

however once I add there my custom line item through graphql modification - all the other line items are dissapearing.

Then I tried to modify the cart object through https://shopify.dev/api/storefront/reference/checkouts/cartlinesadd, however the following approach does not allow to add custom line items, only existing merchendise…

Any tips on how should I approach the issue ? (Paying for application is not an option for me :disappointed_face: )

1 Like

Hi [email removed]MrBubble

How do reach to catch DRAFT_ORDERS_CREATE from WebHooks list? I’m doing something a little be diffrent from you, but I couldn’t catch this webhook.

What I did is create a private app, that let me add products to my cart with some properties that determines their price, and then I use this properties to update the final order. The problem is that when I update this order it is already paid, now I’m trying to make a Payment App, but is on beta, etc

What I used was this https://shopify.dev/api/ajax/reference/cart#post-cart-add-js, there are also a method to update the card, that could maybe help you.