PagarMe
Connect PagarMe to your Cademí: the product or subscription ID, the webhook with order and subscription events and how to find the ID in a received sale.
Connect PagarMe to your Cademí so each approved purchase gives the student access on its own. You need the product ID (or the subscription ID) and a webhook pointing to Cademí. PagarMe does not ask for a token.
1. Create the delivery in Cademí
- In the Cademí dashboard, open Sales → Deliveries and add a delivery.
- In Select a Gateway, pick PagarMe.
- In Delivery Name, enter a name that helps you recognize it later.
- In Sales Mode, choose One-time sale or Subscription, matching the product on PagarMe.
- The Gateway connection section shows the Product or Subscription ID field and the Postback URL.
Keep the delivery open: you come back to it in the next steps.
2. Find the product ID
On PagarMe, the product ID can be in two places: in the store where you created the product or in PagarMe itself.
In the store:
- In the store dashboard, open Produtos (Products) and pick the product.
- Copy the ID shown below the offer name or in the browser address bar.
In PagarMe:
- In the PagarMe dashboard, open Vendas → Links de Pagamento (Sales > Payment links).
- Click Detalhes (Details) on the link you sell.
- On the Informações (Information) tab, copy the code of the Link de Pagamento (payment link). It starts with
pl_, followed by letters and numbers.
Paste the value into Product or Subscription ID in the Cademí delivery.
If you are not sure about the ID: set up the webhook (step 3), make a test purchase and open Sales → Sales in Cademí. In View details of the sale, the Data tab shows Product ID in the gateway: that is the value PagarMe sends. Paste it into the delivery.
3. Set up the webhook
- In the PagarMe dashboard, open Configurações → Webhooks (Settings > Webhooks) and click Criar Webhook (Create webhook).
- In Status, choose Ativo (Active).
- In URL, paste the Postback URL of the delivery.
- In Máximo de tentativas (Maximum attempts), enter 3.
- In Eventos (Events), select
order.paid,order.payment_failed,order.canceled,subscription.createdandsubscription.canceled. - Click Salvar (Save) and, in Cademí, save the delivery.