- Go to the Stripe dashboard and get your API secret key.
- In the Cosmic dashboard go to Stripe Products / Settings and add
stripe_secret_key
as a Query Parameter with the Stripe API secret key set as the value.
- Make the extension available on the Products Object type on the Object edit page.
- IMPORTANT: Make sure your Products Object type includes the following Metafields:
image
(image), stripe_product_id
(text), price
(number), and recurring
(parent) containing is_recurring
(switch) and interval
(select dropdown with month
and year
options)
- Go to any Product and you should now see the option to Add to Stripe.
- Click Add to Stripe, refresh the page, and you should now see the Stripe Product ID field populated along with a link to view the product in Stripe.
- Syncing to Stripe: After adding your product to Stripe, you will be able to Sync to Stripe after making updates to your product in Cosmic.
- Price Variants: To create price variants, add a Repeater Metafield to your Products Object type with the following Metafield structure:
Price Variants price_variants
(repeater)
-- Label label
(text)
-- Price price
(number)
-- Stripe Price ID stripe_price_id
(text)
- Enable auto-syncing with webhooks: Go to the Blocks Ecommerce page to see how to set up automatic syncing with webhooks.