# Greenn

> Connect Greenn to your Cademí: the product code in the address bar and the webhook delivery under Conteúdos with the sale events.

Connect Greenn to your Cademí so each approved purchase gives the student access on its own. You need the product code and a webhook pointing to Cademí, set up on each product. Greenn 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 **Greenn**.
3. In **Delivery Name**, enter a name that helps you recognize it later.
4. In **Sales Mode**, choose **One-time sale** or **Subscription**, matching the product on Greenn.
5. The **Gateway connection** section shows the **Product Code** field and the **Postback URL**.

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

## 2. Find the product code

1. In the Greenn dashboard, click **Meus Produtos** (My products) in the side menu.
2. On the product you deliver through Cademí, click the gear icon and **Editar Produto** (Edit product).
3. Copy the product code shown in the browser address bar. In `https://adm.greenn.com.br/produtos/edicao-produto/1234`, the code is `1234`.
4. Paste the code into **Product Code** in the Cademí delivery.

## 3. Set up the webhook

1. Still editing the product, open the **Conteúdos** (Content) tab and click **Adicionar Conteúdo > Sistema Externo > Entrega via Webhook** (Add content > External system > Webhook delivery).
2. In **Enviar para a URL** (Send to URL), paste the **Postback URL** of the delivery.
3. Turn on every option under **Vendas** (Sales) and **Assinatura** (Subscription), except these: venda recusada, venda não paga, venda aguardando pagamento and assinatura aguardando pagamento (declined sale, unpaid sale, sale awaiting payment and subscription awaiting payment).
4. Save the content on Greenn and, in Cademí, save the delivery.

**One product at a time:** the webhook delivery lives inside the product. Repeat steps 2 and 3 for each product you sell on Greenn and deliver through Cademí.
