KWIGA
KWIGA is a platform for online schools. Its process automations have the Send Webhook action, where you write the body of the request yourself. Pointed at the Flows address, it starts your flows: a payment for an offer succeeded or failed, an order is left unpaid, a student got access to a course — and the student gets the right message in Viber or SMS, with a reminder if nothing happens.
This page is written from the public documentation of KWIGA and has not been checked on a live account yet.
What you need
- Access to Courses → Process automation in KWIGA. Which plan includes automations and the webhook action is not stated in KWIGA's documentation.
- One KWIGA scenario per event: "successful payment" is one scenario, "access opened" is another. All of them use the same address.
- A KWIGA scenario works only for events that happen after it is published.
Step 1. Create a connection
- Open
Flows → Connections, press Connect a system and choose KWIGA. - Press Copy address. It looks like
https://events.alphasms.net/hooks/<TOKEN>— keep it secret.
Step 2. Set up a scenario in KWIGA
- Open Courses → Process automation and press Create scenario. Name it after the event, for example "AlphaFlow — successful payment".
- On the Start card press the pencil and choose the event: Sales → Offers → Successful offer payment. You can choose a particular offer.
- Add step → Action → the group System → General → Send Webhook.
- Request type —
POST, the page address — the address from the cabinet. - On the Headers tab add
Content-Typewith the valueapplication/json.Authorizationis not needed: the secret is in the address. - Request body — paste the body below as it is: KWIGA substitutes the variables in braces itself.
- Connect the steps, end the branch with the End step, press Save and Publish.
The body for a successful payment:
{
"event": "payment_succeeded",
"message_id": "kwiga:payment:{payment.id}",
"contact": { "phone": "{contact.phone}", "email": "{contact.email}" },
"traits": { "first_name": "{contact.first_name}", "last_name": "{contact.last_name}" },
"dedupe_key": "{order.id}",
"properties": {
"order_id": "{order.id}",
"offer": "{offer.title}",
"amount": "{payment.price}",
"currency": "{payment.currency_code}"
},
"context": { "source": "kwiga", "contact_id": "{contact.id}" }
}
For every other event create a separate scenario with the same address and change event, message_id and
properties in the body:
- Unsuccessful offer payment —
"event": "payment_failed","message_id": "kwiga:payment_failed:{payment.id}", the properties as above. - Offer payment refund —
"event": "refund_issued","message_id": "kwiga:refund:{payment.id}", the properties as above. - Unpaid order (request) —
"event": "order_created","message_id": "kwiga:order:{order.id}"; properties:order_id—{order.id},offer—{offer.title},amount—{order.price},currency—{order.currency_code}. - Free offer accepted, Registered for the webinar —
"event": "lead_submitted","message_id": "kwiga:access:{product.id}:{contact.id}"; properties:product—{product.title}. - CTA form request —
"event": "form_submitted","message_id": "kwiga:cta:{cta.id}:{contact.id}:{datetime|format:YYYYMMDDHHmmss}"; properties:form—{cta.title}.
The body for access to a course (Product access opened):
{
"event": "course_enrolled",
"message_id": "kwiga:course_enrolled:{product.id}:{contact.id}",
"contact": { "phone": "{contact.phone}", "email": "{contact.email}" },
"traits": { "first_name": "{contact.first_name}", "last_name": "{contact.last_name}" },
"properties": { "course": "{product.title}" },
"context": { "source": "kwiga", "contact_id": "{contact.id}" }
}
- Do not use variables the chosen event does not have:
{payment.id}, for example, is not available at Product access opened. KWIGA's list of variables says for each group at which events it is available. If{order.id}is not available, remove thededupe_keyline. - Course completed →
course_completedwithcourse. Whether the{product.*}variables are available at this event is not confirmed by the documentation: check the list of variables, and if they are, use the body for access withcourse_completedineventand inmessage_id.
Step 3. Send a test
Publish the scenario and go through the event yourself — a test payment or a free offer. The event appears in
Flows → Connections → Event journal within seconds. The
connection shows Recognised: KWIGA.
Events
| Event in KWIGA | AlphaFlow event | Properties |
|---|---|---|
| Successful offer payment | payment_succeeded | order_id, offer, amount, currency |
| Unsuccessful offer payment | payment_failed | order_id, offer, amount, currency |
| Offer payment refund | refund_issued | order_id, offer, amount, currency |
| Unpaid order (request) | order_created | order_id, offer, amount, currency |
| Product access opened | course_enrolled | course |
| Course completed | course_completed | course |
| Free offer accepted, Registered for the webinar | lead_submitted | product |
| CTA form request | form_submitted | form |
Each name goes only into the scenario started by its own KWIGA event from the table: payment_succeeded — only at
Successful offer payment, course_completed — only at Course completed. The same body in a scenario on another
event would tell the student about a payment or a course that did not happen.
The contact is found by the phone and the email of the KWIGA contact; the first and last names come from it too.
The id of the KWIGA contact goes to context.contact_id, not to the customer id, so it cannot clash with the ids
of your other systems. The body is already an event in the AlphaFlow format — see
Event format.
Good to know
- Whether KWIGA repeats a failed request, and how long it waits for the answer, is not described in its
documentation. A repeat with the same
message_idis not recorded twice. - KWIGA puts the values of the variables into the body as text. Whether it escapes quotes and line breaks is not
described, so do not put multi-line variables such as
{cta_request.form_data}into the body.amountcomes as text:"1490.00". - The
formatoption of{datetime}in the id of a CTA request is not confirmed by the documentation. - Nothing has to be signed: the secret in the address is enough.
- The event needs a phone or an email, or an id AlphaFlow already knows. Otherwise it is refused with
no_contactand shown in the journal. - The address always answers
200. Above the daily event limit the event is refused in AlphaFlow withquota_exceededand shown in the journal; the scenario in KWIGA stays published.