# Shopify

> Connect Shopify to your Cademí: the product ID in the admin address and the order payment and order cancelled webhooks, in JSON, with the Postback URL.

Connect Shopify to your Cademí so each paid order gives the student access on its own. You need the ID of each product and two webhooks pointing to Cademí. Shopify does not ask for a token.

## 1. Create the delivery in Cademí

1. In the Cademí dashboard, open **Sales > Deliveries** and add a delivery.
2. In **Select a Gateway**, pick **Shopify**.
3. In **Delivery Name**, enter a name that helps you recognize it later.
4. **Sales Mode** shows only **One-time sale**: a Shopify delivery has no **Subscription** option.
5. The **Gateway connection** section shows the **Product ID** field and the **Postback URL**.

Keep the delivery open: you come back to it in the next steps.

## 2. Find the product ID

1. In the Shopify admin, open the product's edit page.
2. In the browser's address bar, copy the number that appears in the page address: that is the product ID.
3. Paste the number into **Product ID** in the Cademí delivery.

Repeat for each product you sell on Shopify and deliver through Cademí.

## 3. Set up the webhooks

Shopify asks for one webhook per event. You create two: one for the paid order (order_payment) and another for the cancelled order (order_cancelled).

1. In the Shopify admin, open **Settings > Notifications** and scroll to the **Webhooks** section.
2. Click **Create webhook**.
3. Pick the order payment event (order_payment).
4. For the format, choose **JSON**.
5. In **URL**, paste the **Postback URL** of the delivery.
6. For the API version, choose the latest one.
7. Save the webhook.
8. Repeat steps 2 to 7 with the order cancelled event (order_cancelled).
9. In Cademí, save the delivery.
