> ## Documentation Index
> Fetch the complete documentation index at: https://developers.ligdicash.com/llms.txt
> Use this file to discover all available pages before exploring further.

# YAS — Togo

> Intégrer YAS Togo (ex-Togocom Mixx by Yas) avec l'API LigdiCash. Mode de validation : USSD Push.

## Identité

| Champ              | Valeur                                           |
| ------------------ | ------------------------------------------------ |
| Pays               | Togo                                             |
| Opérateur          | YAS Togo (Mixx by Yas, ex-Togocom)               |
| `operator_id`      | `3`                                              |
| `operator_name`    | `YAS TOGO`                                       |
| Indicatif          | +228                                             |
| Format du numéro   | `228XXXXXXXX` (sans `+` ni espaces)              |
| Endpoint           | `POST /pay/v01/straight/checkout-invoice/create` |
| Mode de validation | USSD Push                                        |

## Mode de validation : USSD Push

Après votre requête, l'opérateur envoie un push USSD directement sur le téléphone du client. Le client valide avec son code PIN Mixx by Yas. Aucune saisie supplémentaire côté marchand — le callback reste la source de vérité.

<Note>
  Affichez un message d'attente clair après soumission. Le push USSD arrive sur le téléphone du client en quelques secondes, mais le callback peut prendre de quelques secondes à plusieurs minutes selon l'opérateur.
</Note>

## UX recommandée

<Steps>
  <Step title="Collecter le numéro du client">
    Votre formulaire recueille uniquement le numéro de téléphone YAS. Aucun OTP à collecter.
  </Step>

  <Step title="Soumettre la requête">
    Requête avec le numéro dans `customer` et `otp: ""`.
  </Step>

  <Step title="Afficher un message d'attente">
    Après soumission, affichez :

    > *« Validez le paiement sur votre téléphone. Vous allez recevoir une demande USSD à approuver avec votre code PIN Mixx by Yas. »*

    Maintenez l'état d'attente jusqu'à la réception du callback.
  </Step>
</Steps>

## Exemple de requête

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://app.ligdicash.com/pay/v01/straight/checkout-invoice/create \
    -H "Apikey: {API_KEY}" \
    -H "Authorization: Bearer {API_TOKEN}" \
    -H "Accept: application/json" \
    -H "Content-Type: application/json" \
    -d '{
      "commande": {
        "invoice": {
          "items": [],
          "total_amount": 5000,
          "devise": "XOF",
          "description": "Abonnement Pro — Janvier 2025",
          "customer": "22890000000",
          "customer_firstname": "Kossi",
          "customer_lastname": "Amah",
          "customer_email": "kossi@exemple.com",
          "external_id": "",
          "otp": ""
        },
        "store": {
          "name": "MonApp",
          "website_url": "https://monapp.com"
        },
        "actions": {
          "cancel_url": "",
          "return_url": "",
          "callback_url": "https://monapp.com/api/callback/ligdicash"
        },
        "custom_data": {
          "transaction_id": "ORD-2025-00053"
        }
      }
    }'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch(
    "https://app.ligdicash.com/pay/v01/straight/checkout-invoice/create",
    {
      method: "POST",
      headers: {
        Apikey: process.env.LIGDICASH_API_KEY,
        Authorization: `Bearer ${process.env.LIGDICASH_API_TOKEN}`,
        Accept: "application/json",
        "Content-Type": "application/json",
      },
      body: JSON.stringify({
        commande: {
          invoice: {
            items: [],
            total_amount: 5000,
            devise: "XOF",
            description: "Abonnement Pro — Janvier 2025",
            customer: "22890000000",
            customer_firstname: "Kossi",
            customer_lastname: "Amah",
            customer_email: "kossi@exemple.com",
            external_id: "",
            otp: "",
          },
          store: { name: "MonApp", website_url: "https://monapp.com" },
          actions: {
            cancel_url: "",
            return_url: "",
            callback_url: "https://monapp.com/api/callback/ligdicash",
          },
          custom_data: { transaction_id: "ORD-2025-00053" },
        },
      }),
    }
  );

  const data = await response.json();
  ```

  ```php PHP theme={null}
  $payload = [
    "commande" => [
      "invoice" => [
        "items" => [],
        "total_amount" => 5000,
        "devise" => "XOF",
        "description" => "Abonnement Pro — Janvier 2025",
        "customer" => "22890000000",
        "customer_firstname" => "Kossi",
        "customer_lastname" => "Amah",
        "customer_email" => "kossi@exemple.com",
        "external_id" => "",
        "otp" => "",
      ],
      "store" => ["name" => "MonApp", "website_url" => "https://monapp.com"],
      "actions" => [
        "cancel_url" => "",
        "return_url" => "",
        "callback_url" => "https://monapp.com/api/callback/ligdicash",
      ],
      "custom_data" => ["transaction_id" => "ORD-2025-00053"],
    ],
  ];

  $ch = curl_init("https://app.ligdicash.com/pay/v01/straight/checkout-invoice/create");
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  curl_setopt($ch, CURLOPT_POST, true);
  curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
  curl_setopt($ch, CURLOPT_HTTPHEADER, [
    "Apikey: " . $_ENV["LIGDICASH_API_KEY"],
    "Authorization: Bearer " . $_ENV["LIGDICASH_API_TOKEN"],
    "Accept: application/json",
    "Content-Type: application/json",
  ]);

  $data = json_decode(curl_exec($ch), true);
  curl_close($ch);
  ```
</CodeGroup>

## Réponse attendue

<CodeGroup>
  ```json Succès (create) theme={null}
  {
    "response_code": "00",
    "token": "eyJ0eXAiOiJKV1Qi...",
    "response_text": "Votre requête est en cours de traitement",
    "wiki": "https://client.ligdicash.com/wiki/createInvoice"
  }
  ```

  ```json Échec (create) theme={null}
  {
    "response_code": "01",
    "token": "",
    "response_text": "Echec (Code00)",
    "wiki": "https://client.ligdicash.com/wiki/createInvoice"
  }
  ```
</CodeGroup>

<Warning>
  Stockez le `token` immédiatement après la création. Utilisez-le pour appeler `confirm` à la réception du callback — ne vous fiez pas au token présent dans le payload du callback.
</Warning>

## Limites

| Paramètre          | Valeur  |
| ------------------ | ------- |
| Montant minimum    | 100 XOF |
| Montant maximum    | --      |
| Limite quotidienne | --      |

## Pages associées

* [Modes de validation — USSD Push](/api-paiement/payin-sans-redirect/modes-validation) — détail du flux
* [Créer une transaction](/api-paiement/payin-sans-redirect/creer-transaction) — référence complète de l'endpoint
* [Vérifier le statut](/api-paiement/payin-sans-redirect/verifier-statut) — appeler `confirm` après le callback
