Need Help Adding Products from Third-Party Vendor

For context:

The store I’m working on sells products from a third party vendor.

Task:

Build a front end app that calls Vendor API so a customer can see the products available from the Vendor and purchase in the Shopify store

Problem:

I have to hide an API key to make API calls to Vendor so I’m thinking of handling that on the server side. I’m not sure how to add products to cart in Shopify store and go to checkout since the products don’t actually live in the store backend.

So far all I have for infrastructure is:

Liquid front end => host own server handling API calls to Vendor => Vendor confirms request from server and returns list of products => server relays to front end the list of products

I’m not sure how to get those products from the Vendor to the Shopify backend so the store “thinks” it has the products, so a customer can checkout. I thought of creating the products on server side using Admin API, but will the products persist after customer checkout? I’ll be writing the server in Node/Express.

Thank you for your time and help!

Unless you delete products, products persist when you add them a shopify store with the api, alternatively you can unpublish them.

For custom line items you could also use the draft orders api.

If you don’t have to do full auth to get the products, or they provide something like ftp or CSV, you could use a tool like usemechanic to get the list, create the products(or draft order) , and generate the cart

https://tasks.mechanic.dev/create-a-draft-order-from-the-cart

The Vendor API responds in XML.

So I have to create a product to add it to cart and checkout? There’s no way around going straight to cart?

Of course how else would it work, how would a ecommerce system track and process something that doesn’t exist let alone charge for it.

Your only alt is having a product of a predefined price act like a dummy placeholder that you append line item properties to it , kinda of like a personalization app.