Herospark
Connect Herospark to your Cademí: the product ID and the Piloto Automático webhook automations for payment and cancellation.
Connect Herospark to your Cademí so each approved purchase gives the student access on its own. You need an ID for the product and automations in Herospark's Piloto Automático (Autopilot) that notify Cademí. Herospark does not ask for a token.
Before you start
Ask Herospark support, through the chat on their platform, to turn off Herospark's native members area on your account. That way the sales from your checkout no longer create access in Herospark's members area, and the student's access lives in Cademí.
1. Create the delivery in Cademí
- In the Cademí dashboard, open Sales → Deliveries and add a delivery.
- In Select a Gateway, pick Herospark.
- 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 Herospark.
- 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. Choose the product ID
With Herospark, you write the product ID yourself in the automation in step 3. What matters is that the same value is in both places.
- Choose an ID for the product: the product code on Herospark, for example.
- Paste the ID into Product ID in the Cademí delivery and keep it for step 3.
3. Create the payment confirmed automation
- On Herospark, open Piloto Automático (Autopilot) and create the Pagamento Confirmado (Payment confirmed) automation, with the webhook option.
- In Filtro de disparo (Trigger filter), pick the product (or products) you deliver through this delivery.
- In URL, paste the Postback URL of the delivery.
- In Método (Method), keep the default value, POST.
- In Headers, add the key
Content-Typewith the valueapplication/json. - In Body, paste the code below exactly. Then replace
00000with the product ID of the delivery, keeping the quotes.
{"valor": "{{ offer_price | divided_by: 100.00}}", "codigo": "{{ payment_id }}", "status": "aprovado", "produto_id": "00000", "cliente_doc": "{{ buyer_document_id }}", "cliente_nome": "{{ buyer_name }}", "cliente_email": "{{ buyer_email }}", "recorrencia_id": "{{subscription_id}}", "cliente_celular": "{{ buyer_phone }}", "recorrencia_status": "ativo", "subscription_expiration_at": "{{subscription_expiration_at}}", "subscription_next_invoice_at": "{{subscription_next_invoice_at}}"}- Turn on the automation and, in Cademí, save the delivery.
4. Create the cancellation automations
If you sell subscriptions, create two more automations, Assinatura cancelada pelo cliente and Assinatura cancelada pelo produtor (subscription canceled by the customer, by the producer). They make the student inactive in Cademí when the subscription is canceled on Herospark.
- Fill in each one as in step 3, with the same filter, URL, method and header.
- In Body, paste the code below exactly and replace the product ID the same way.
{"valor": "{{ offer_price | divided_by: 100.00}}", "codigo": "{{ payment_id }}", "status": "cancelado", "produto_id": "00000", "cliente_doc": "{{ buyer_document_id }}", "cliente_nome": "{{ buyer_name }}", "cliente_email": "{{ buyer_email }}", "recorrencia_id": "{{subscription_id}}", "cliente_celular": "{{ buyer_phone }}", "recorrencia_status": "cancelado", "subscription_expiration_at": "{{subscription_expiration_at}}", "subscription_next_invoice_at": "{{subscription_next_invoice_at}}"}- Turn on both automations.