# Yampi

> Connect Yampi to your Cademí: the product ID, the secret key that works as the token and the webhook with the order events that give the student access.

Connect Yampi to your Cademí so each approved purchase gives the student access on its own. You need the product ID, the secret key of the Yampi webhook and a webhook pointing to Cademí.

## 1. Create the delivery in Cademí

1. In the Cademí dashboard, open **Sales > Deliveries** and add a delivery.
2. In **Select a Gateway**, pick **Yampi**.
3. In **Delivery Name**, enter a name that helps you recognize it later.
4. **Sales Mode** shows only **One-time sale**: a Yampi delivery has no **Subscription** option.
5. The **Gateway connection** section shows the **Product ID** and **Token** fields 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 Yampi dashboard, open **Produtos** (Products) in the side menu and click **ver todos** (see all).
2. Copy the ID shown on the product row in the list.
3. Paste the ID into **Product ID** in the Cademí delivery.

## 3. Copy the token

If you already registered your Yampi token in another delivery, pick it in **Use an already registered token** and go to step 4.

1. In the Yampi dashboard, open **Configurações > Webhooks** (Settings > Webhooks) in the side menu.
2. Click **Novo Webhook** (New webhook).
3. Copy the value of **Chave Secreta** (Secret key) and paste it into **Token** in the Cademí delivery.

Keep the webhook screen open: the next step continues there.

## 4. Set up the webhook

If you already have the Cademí webhook on Yampi, open it, add the new product to its product list and save. Setup ends here.

1. On the **Novo Webhook** screen, in **Nome** (Name), enter "Cademí".
2. In **URL**, paste the **Postback URL** of the delivery.
3. Select the events: Pedido criado, O status de um pedido foi atualizado, Pedido atualizado and Pedido aprovado (order created, order status updated, order updated and order approved).
4. Choose the product you deliver through Cademí.
5. Click **Salvar** (Save) and, in Cademí, save the delivery.

**For each new product:** when you start delivering another product through Cademí, add it to this webhook's product list.

## Good to know

- **Kits and order bumps.** Each product in the purchase reaches Cademí with its own ID. Register a delivery for each product that grants access. A product in the purchase with no delivery makes the sale fail with an error: see what to do in [Sales received](https://help.cademi.cloud/en/vendas/vendas-recebidas.md).
