# I run an association

_Yes: membership fee due with a payment link, general-assembly summons with a one-tap reply, membership receipt as PDF and event reminder, with the API._

Keywords: association, membership fee, general assembly, summons, receipt, event, member, savings group, NGO, church

## What you can automate

| Need | How | Recipe |
|---|---|---|
| Membership fee due | `cotisation_due` template with a variable-link button to the member's payment page. | [Variable link in a button](https://console.geskap.com/docs/lien-variable-bouton?lang=en) · [Unpaid reminder](https://console.geskap.com/docs/relance-impaye?lang=en) |
| Assembly summons | `convocation_assemblee` template with two buttons: attending or excused. | [Template buttons](https://console.geskap.com/docs/boutons-template-reponse-rapide?lang=en) · [Get the tap](https://console.geskap.com/docs/recuperer-le-clic?lang=en) |
| Membership receipt as PDF | `recu_cotisation` template with the receipt as a PDF header. | [PDF in the header](https://console.geskap.com/docs/document-pdf-en-tete?lang=en) |
| Event reminder | `rappel_evenement` template for registered members. An announcement to all members is promotion: MARKETING. | [Appointment reminder the day before](https://console.geskap.com/docs/rappel-rendez-vous-veille?lang=en) · [Abandoned cart and promo](https://console.geskap.com/docs/marketing-panier-promo?lang=en) |
| Event registration | Within 24 h: a list of events, then confirmation buttons. | [List menu](https://console.geskap.com/docs/menu-liste?lang=en) · [Yes, no, later](https://console.geskap.com/docs/oui-non-plus-tard?lang=en) |

Outside the 24 h that follow the customer's last message, only a Meta-approved template can be sent. Within 24 h you compose freely: buttons (3, 20 characters at most), a list (10 rows of 24 characters at most) or free text.

## Templates to create

| Name | Category | Text | Buttons |
|---|---|---|---|
| `cotisation_due` | UTILITY | Hello {{1}}, your {{2}} membership fee of {{3}} is due before {{4}}. You can pay it online with the button below. If it is already done, please ignore this message. | variable link: "Pay my fee" |
| `convocation_assemblee` | UTILITY | Hello {{1}}, you are invited to the general assembly of Association Exemple on {{2}} at {{3}}, at {{4}}. Please tell us whether you will attend. | quick reply: « I will attend », « I am excused » |
| `recu_cotisation` | UTILITY | Hello {{1}}, we have received your {{2}} membership fee of {{3}} on {{4}}. Your receipt is attached to this message as a PDF. Thank you for your support. | PDF header |
| `rappel_evenement` | UTILITY | Hello {{1}}, reminder: the event {{2}} you registered for takes place on {{3}} at {{4}}, at {{5}}. We are counting on you. | — |

## Full example

Membership fee due, with a payment button whose link tail is specific to each member. Creation, once.

```bash
# curl
curl -X POST "https://wa-api.geskap.com/v1/templates" \
  -H "Authorization: Bearer $GESKAP_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "cotisation_due",
  "language": "en",
  "category": "UTILITY",
  "body_text": "Hello {{1}}, your {{2}} membership fee of {{3}} is due before {{4}}. You can pay it online with the button below. If it is already done, please ignore this message.",
  "example_values": ["Awa", "annual", "10,000 F", "November 30"],
  "buttons": [
    {
      "kind": "url",
      "text": "Pay my fee",
      "url": "https://association-exemple.test/cotisation/{{1}}",
      "url_example": "https://association-exemple.test/cotisation/ab12cd"
    }
  ]
}'
```

```js
// Node.js
const res = await fetch("https://wa-api.geskap.com/v1/templates", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.GESKAP_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "name": "cotisation_due",
    "language": "en",
    "category": "UTILITY",
    "body_text": "Hello {{1}}, your {{2}} membership fee of {{3}} is due before {{4}}. You can pay it online with the button below. If it is already done, please ignore this message.",
    "example_values": ["Awa", "annual", "10,000 F", "November 30"],
    "buttons": [
      {
        "kind": "url",
        "text": "Pay my fee",
        "url": "https://association-exemple.test/cotisation/{{1}}",
        "url_example": "https://association-exemple.test/cotisation/ab12cd"
      }
    ]
  }),
});
console.log(res.status, await res.json());
```

```php
// PHP
$ch = curl_init("https://wa-api.geskap.com/v1/templates");
curl_setopt_array($ch, [
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer " . getenv("GESKAP_API_KEY"),
    "Content-Type: application/json",
  ],
  CURLOPT_POSTFIELDS => json_encode([
    "name" => "cotisation_due",
    "language" => "en",
    "category" => "UTILITY",
    "body_text" => "Hello {{1}}, your {{2}} membership fee of {{3}} is due before {{4}}. You can pay it online with the button below. If it is already done, please ignore this message.",
    "example_values" => ["Awa", "annual", "10,000 F", "November 30"],
    "buttons" => [
      [
        "kind" => "url",
        "text" => "Pay my fee",
        "url" => "https://association-exemple.test/cotisation/{{1}}",
        "url_example" => "https://association-exemple.test/cotisation/ab12cd",
      ],
    ],
  ]),
]);
$res = curl_exec($ch);
echo curl_getinfo($ch, CURLINFO_HTTP_CODE), " ", $res;
```

```python
# Python
import os, requests

res = requests.request(
    "POST",
    "https://wa-api.geskap.com/v1/templates",
    headers={"Authorization": f"Bearer {os.environ['GESKAP_API_KEY']}"},
    json={
        "name": "cotisation_due",
        "language": "en",
        "category": "UTILITY",
        "body_text": "Hello {{1}}, your {{2}} membership fee of {{3}} is due before {{4}}. You can pay it online with the button below. If it is already done, please ignore this message.",
        "example_values": ["Awa", "annual", "10,000 F", "November 30"],
        "buttons": [
            {
                "kind": "url",
                "text": "Pay my fee",
                "url": "https://association-exemple.test/cotisation/{{1}}",
                "url_example": "https://association-exemple.test/cotisation/ab12cd",
            },
        ],
    },
    timeout=15,
)
print(res.status_code, res.json())
```

Send it to each member behind on fees, from your member register.

```bash
# curl
curl -X POST "https://wa-api.geskap.com/v1/messages" \
  -H "Authorization: Bearer $GESKAP_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "to": "+237690000020",
  "template": {
    "name": "cotisation_due",
    "language": "en",
    "variables": ["Awa", "annual", "10,000 F", "November 30"],
    "button_url_param": "ab12cd"
  }
}'
```

```js
// Node.js
const res = await fetch("https://wa-api.geskap.com/v1/messages", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.GESKAP_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "to": "+237690000020",
    "template": {
      "name": "cotisation_due",
      "language": "en",
      "variables": ["Awa", "annual", "10,000 F", "November 30"],
      "button_url_param": "ab12cd"
    }
  }),
});
console.log(res.status, await res.json());
```

```php
// PHP
$ch = curl_init("https://wa-api.geskap.com/v1/messages");
curl_setopt_array($ch, [
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer " . getenv("GESKAP_API_KEY"),
    "Content-Type: application/json",
  ],
  CURLOPT_POSTFIELDS => json_encode([
    "to" => "+237690000020",
    "template" => [
      "name" => "cotisation_due",
      "language" => "en",
      "variables" => ["Awa", "annual", "10,000 F", "November 30"],
      "button_url_param" => "ab12cd",
    ],
  ]),
]);
$res = curl_exec($ch);
echo curl_getinfo($ch, CURLINFO_HTTP_CODE), " ", $res;
```

```python
# Python
import os, requests

res = requests.request(
    "POST",
    "https://wa-api.geskap.com/v1/messages",
    headers={"Authorization": f"Bearer {os.environ['GESKAP_API_KEY']}"},
    json={
        "to": "+237690000020",
        "template": {
            "name": "cotisation_due",
            "language": "en",
            "variables": ["Awa", "annual", "10,000 F", "November 30"],
            "button_url_param": "ab12cd",
        },
    },
    timeout=15,
)
print(res.status_code, res.json())
```

## Conversation

```text
Association: Hello Awa, you are invited to the general assembly on November 22 at 10 am.
             [ I will attend ]  [ I am excused ]
Member      : (taps "I will attend")
Webhook     : message.inbound  type=text  text="I will attend"  button_id="I will attend"
Association : Thank you Awa, your attendance is recorded. Would you like to register for the meal?
             [ Yes ]  [ No ]  [ Later ]
```

Short answers follow [Yes, no, later](https://console.geskap.com/docs/oui-non-plus-tard?lang=en); the tap on a template button is read as in [Template buttons](https://console.geskap.com/docs/boutons-template-reponse-rapide?lang=en).

> **Pitfall:** A template carries at most two buttons: "Yes / No / Later" (three) can only be sent within 24 h, as an interactive message. Outside 24 h, stay with two buttons.

> **Pitfall:** A fundraising appeal or an announcement to all members is MARKETING, blocked by default until the account administrator enables it. A fee due or a summons to registered members stays UTILITY.

_Proof — verified in the API source: api_schemas.py._

---

# Je suis une association

_Oui : cotisation due avec lien de paiement, convocation à l'assemblée avec réponse en un clic, reçu de cotisation en PDF et rappel d'événement, avec l'API._

Mots-clés: association, cotisation, assemblée générale, convocation, reçu, événement, adhérent, membre, tontine, ONG, église

## Ce que vous pouvez automatiser

| Besoin | Comment | Recette |
|---|---|---|
| Cotisation due | Template `cotisation_due` avec un bouton à lien variable vers la page de paiement du membre. | [Lien variable dans un bouton](https://console.geskap.com/docs/lien-variable-bouton) · [Relance d'impayé](https://console.geskap.com/docs/relance-impaye) |
| Convocation à l'assemblée | Template `convocation_assemblee` avec deux boutons : présent ou excusé. | [Boutons de template](https://console.geskap.com/docs/boutons-template-reponse-rapide) · [Récupérer le clic](https://console.geskap.com/docs/recuperer-le-clic) |
| Reçu de cotisation en PDF | Template `recu_cotisation` avec le reçu en PDF en en-tête. | [PDF en en-tête](https://console.geskap.com/docs/document-pdf-en-tete) |
| Rappel d'événement | Template `rappel_evenement` pour les inscrits. Une annonce à tous les membres est de la promotion : MARKETING. | [Rappel de rendez-vous la veille](https://console.geskap.com/docs/rappel-rendez-vous-veille) · [Panier abandonné et promo](https://console.geskap.com/docs/marketing-panier-promo) |
| Inscription à un événement | Dans les 24 h : liste des événements, puis confirmation par boutons. | [Menu en liste](https://console.geskap.com/docs/menu-liste) · [Oui, non, plus tard](https://console.geskap.com/docs/oui-non-plus-tard) |

Hors des 24 h qui suivent le dernier message du client, seul un template approuvé par Meta peut partir. Dans les 24 h, vous composez librement : boutons (3 de 20 caractères au plus), liste (10 lignes de 24 caractères au plus) ou texte libre.

## Les templates à créer

| Nom | Catégorie | Texte | Boutons |
|---|---|---|---|
| `cotisation_due` | UTILITY | Bonjour {{1}}, votre cotisation {{2}} de {{3}} est à régler avant le {{4}}. Vous pouvez la payer en ligne avec le bouton ci-dessous. Si c'est déjà fait, merci d'ignorer ce message. | lien variable : « Payer ma cotisation » |
| `convocation_assemblee` | UTILITY | Bonjour {{1}}, vous êtes convoqué(e) à l'assemblée générale de l'Association Exemple le {{2}} à {{3}}, à {{4}}. Merci de nous indiquer si vous serez présent(e). | réponse rapide : « Je serai présent(e) », « Je suis excusé(e) » |
| `recu_cotisation` | UTILITY | Bonjour {{1}}, nous avons bien reçu votre cotisation {{2}} de {{3}} le {{4}}. Votre reçu est joint à ce message en PDF. Merci pour votre soutien. | en-tête PDF |
| `rappel_evenement` | UTILITY | Bonjour {{1}}, rappel : l'événement {{2}} auquel vous êtes inscrit(e) a lieu le {{3}} à {{4}}, à {{5}}. Nous comptons sur votre présence. | — |

## Exemple complet

Cotisation due, avec un bouton de paiement dont la fin du lien est propre à chaque membre. Création, une seule fois.

```bash
# curl
curl -X POST "https://wa-api.geskap.com/v1/templates" \
  -H "Authorization: Bearer $GESKAP_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "cotisation_due",
  "language": "fr",
  "category": "UTILITY",
  "body_text": "Bonjour {{1}}, votre cotisation {{2}} de {{3}} est à régler avant le {{4}}. Vous pouvez la payer en ligne avec le bouton ci-dessous. Si c'\''est déjà fait, merci d'\''ignorer ce message.",
  "example_values": ["Awa", "annuelle", "10 000 F", "30 novembre"],
  "buttons": [
    {
      "kind": "url",
      "text": "Payer ma cotisation",
      "url": "https://association-exemple.test/cotisation/{{1}}",
      "url_example": "https://association-exemple.test/cotisation/ab12cd"
    }
  ]
}'
```

```js
// Node.js
const res = await fetch("https://wa-api.geskap.com/v1/templates", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.GESKAP_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "name": "cotisation_due",
    "language": "fr",
    "category": "UTILITY",
    "body_text": "Bonjour {{1}}, votre cotisation {{2}} de {{3}} est à régler avant le {{4}}. Vous pouvez la payer en ligne avec le bouton ci-dessous. Si c'est déjà fait, merci d'ignorer ce message.",
    "example_values": ["Awa", "annuelle", "10 000 F", "30 novembre"],
    "buttons": [
      {
        "kind": "url",
        "text": "Payer ma cotisation",
        "url": "https://association-exemple.test/cotisation/{{1}}",
        "url_example": "https://association-exemple.test/cotisation/ab12cd"
      }
    ]
  }),
});
console.log(res.status, await res.json());
```

```php
// PHP
$ch = curl_init("https://wa-api.geskap.com/v1/templates");
curl_setopt_array($ch, [
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer " . getenv("GESKAP_API_KEY"),
    "Content-Type: application/json",
  ],
  CURLOPT_POSTFIELDS => json_encode([
    "name" => "cotisation_due",
    "language" => "fr",
    "category" => "UTILITY",
    "body_text" => "Bonjour {{1}}, votre cotisation {{2}} de {{3}} est à régler avant le {{4}}. Vous pouvez la payer en ligne avec le bouton ci-dessous. Si c'est déjà fait, merci d'ignorer ce message.",
    "example_values" => ["Awa", "annuelle", "10 000 F", "30 novembre"],
    "buttons" => [
      [
        "kind" => "url",
        "text" => "Payer ma cotisation",
        "url" => "https://association-exemple.test/cotisation/{{1}}",
        "url_example" => "https://association-exemple.test/cotisation/ab12cd",
      ],
    ],
  ]),
]);
$res = curl_exec($ch);
echo curl_getinfo($ch, CURLINFO_HTTP_CODE), " ", $res;
```

```python
# Python
import os, requests

res = requests.request(
    "POST",
    "https://wa-api.geskap.com/v1/templates",
    headers={"Authorization": f"Bearer {os.environ['GESKAP_API_KEY']}"},
    json={
        "name": "cotisation_due",
        "language": "fr",
        "category": "UTILITY",
        "body_text": "Bonjour {{1}}, votre cotisation {{2}} de {{3}} est à régler avant le {{4}}. Vous pouvez la payer en ligne avec le bouton ci-dessous. Si c'est déjà fait, merci d'ignorer ce message.",
        "example_values": ["Awa", "annuelle", "10 000 F", "30 novembre"],
        "buttons": [
            {
                "kind": "url",
                "text": "Payer ma cotisation",
                "url": "https://association-exemple.test/cotisation/{{1}}",
                "url_example": "https://association-exemple.test/cotisation/ab12cd",
            },
        ],
    },
    timeout=15,
)
print(res.status_code, res.json())
```

Envoi à chaque membre en retard de cotisation, depuis votre registre des adhérents.

```bash
# curl
curl -X POST "https://wa-api.geskap.com/v1/messages" \
  -H "Authorization: Bearer $GESKAP_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "to": "+237690000020",
  "template": {
    "name": "cotisation_due",
    "language": "fr",
    "variables": ["Awa", "annuelle", "10 000 F", "30 novembre"],
    "button_url_param": "ab12cd"
  }
}'
```

```js
// Node.js
const res = await fetch("https://wa-api.geskap.com/v1/messages", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.GESKAP_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "to": "+237690000020",
    "template": {
      "name": "cotisation_due",
      "language": "fr",
      "variables": ["Awa", "annuelle", "10 000 F", "30 novembre"],
      "button_url_param": "ab12cd"
    }
  }),
});
console.log(res.status, await res.json());
```

```php
// PHP
$ch = curl_init("https://wa-api.geskap.com/v1/messages");
curl_setopt_array($ch, [
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer " . getenv("GESKAP_API_KEY"),
    "Content-Type: application/json",
  ],
  CURLOPT_POSTFIELDS => json_encode([
    "to" => "+237690000020",
    "template" => [
      "name" => "cotisation_due",
      "language" => "fr",
      "variables" => ["Awa", "annuelle", "10 000 F", "30 novembre"],
      "button_url_param" => "ab12cd",
    ],
  ]),
]);
$res = curl_exec($ch);
echo curl_getinfo($ch, CURLINFO_HTTP_CODE), " ", $res;
```

```python
# Python
import os, requests

res = requests.request(
    "POST",
    "https://wa-api.geskap.com/v1/messages",
    headers={"Authorization": f"Bearer {os.environ['GESKAP_API_KEY']}"},
    json={
        "to": "+237690000020",
        "template": {
            "name": "cotisation_due",
            "language": "fr",
            "variables": ["Awa", "annuelle", "10 000 F", "30 novembre"],
            "button_url_param": "ab12cd",
        },
    },
    timeout=15,
)
print(res.status_code, res.json())
```

## Conversation

```text
Association : Bonjour Awa, vous êtes convoquée à l'assemblée générale le 22 novembre à 10h00.
              [ Je serai présent(e) ]  [ Je suis excusé(e) ]
Membre      : (touche « Je serai présent(e) »)
Webhook     : message.inbound  type=text  text="Je serai présent(e)"  button_id="Je serai présent(e)"
Association : Merci Awa, votre présence est enregistrée. Souhaitez-vous vous inscrire au repas ?
              [ Oui ]  [ Non ]  [ Plus tard ]
```

Les réponses courtes suivent [Oui, non, plus tard](https://console.geskap.com/docs/oui-non-plus-tard) ; le clic d'un bouton de template se lit comme dans [Boutons de template](https://console.geskap.com/docs/boutons-template-reponse-rapide).

> **Piège :** Un template porte au plus deux boutons : « Oui / Non / Plus tard » (trois choix) ne s'envoie que dans les 24 h, comme message interactif. Hors 24 h, restez à deux boutons.

> **Piège :** Un appel aux dons ou une annonce à l'ensemble des membres relève du MARKETING, bloqué par défaut tant que l'administrateur du compte ne l'a pas activé. Une cotisation due ou une convocation de membres inscrits reste UTILITY.

_Preuve — vérifié dans le code de l'API : api_schemas.py._

Support: WhatsApp +237 6 56 09 88 31 · All recipes: https://wa-api.geskap.com/llms.txt
