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

# Étape 2 - Initier une transaction

> Comment initier une transaction Cashin ou Cashout via l'API

## Endpoint

```
POST {{base_url}}/airtime
```

## Authentification

<Info>
  L'authentification se fait via la clé API transmise dans le corps de la
  requête. Il n'y a pas de header Authorization.
</Info>

## Paramètres de la requête

| Champ         | Type   | Obligatoire  | Description                                                                                                                                          |
| ------------- | ------ | ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| `amount`      | int    | Oui          | Montant de la transaction en FCFA. **Doit être un multiple de 100** (ex: 500, 1000, 1500).                                                           |
| `api_key`     | string | Oui          | Clé API KAYBIC AFRICA pour authentification                                                                                                          |
| `destination` | string | Oui          | Numéro mobile du bénéficiaire **sans indicatif international** (ex: 0103444777, pas +2250103444777)                                                  |
| `service_id`  | int    | Oui          | [Identifiant du service](/documentation/annexes/glossaire-variables-testeur-api) (Cashin ou Cashout selon l'opérateur)                               |
| `ipn_url`     | string | **Oui**      | URL de callback pour recevoir les notifications IPN                                                                                                  |
| `custom_data` | string | Non          | Référence interne qui sera retournée dans l'IPN                                                                                                      |
| `om_otp`      | string | Conditionnel | **Uniquement pour Orange Money Cashout** (service\_id 23, 27, 29). Code d'autorisation obtenu par le client via `#144*82#` (CI) ou `#144#391#` (SN). |

## Exemple – MTN Cashout

```json theme={null}
{
  "amount": 5000,
  "api_key": "xxxxxxxxxxxxxxx",
  "destination": "0503444777",
  "service_id": 25,
  "ipn_url": "https://votre_webhook.url",
  "custom_data": "order_789"
}
```

Pour les cas qui demandent des confirmations avec des codes OTP, veuillez consulter le tableau ci-dessous pour connaître les syntaxes à composer par pays et par opérateur

| Pays          | Opérateur     | Syntaxe                               | Note                                                     |
| ------------- | ------------- | ------------------------------------- | -------------------------------------------------------- |
| Côte d'Ivoire | Orange        | #144\*82#                             | Payment by otp code                                      |
|               | Moov          | NO                                    | A composer apres réception du sms de debit               |
|               | Mtn CI        | \*133#                                | Confirmation by secret code after receiving the push sms |
|               | Wave          | NO                                    | Confirmation par QR Code                                 |
| Senegal       | Orange        | #144#391#                             | Payment by otp code                                      |
|               | Expresso      | *\*444*\*3\*3#                        | A composer apres réception du sms de debit               |
|               | Free          | NO                                    | Confirmation by secret code after receiving the push sms |
|               | Wave          | NO                                    | Confirmation par QR Code                                 |
| Mali          | Orange        | #144#77#                              | Payment by otp code                                      |
|               | Moov          | NO                                    | Confirmation by secret code after receiving the push sms |
| Togo          | Tmoney        | NO                                    | Confirmation by secret code after receiving the push sms |
|               | Flooz         | NO                                    | Confirmation by secret code after receiving the push sms |
| Benin         | Moov          | *\*855*\*7\*8#                        | Confirmation by secret code after receiving the push sms |
|               | Mtn           | NO                                    | Confirmation by secret code after receiving the push sms |
| Burkina Faso  | Orange        | *\*144*\*4\*\*6\*\*100#               | Payment by otp code                                      |
|               | Moov          | *\*555*\*6#                           | Confirmation by secret code after receiving the push sms |
| Cameroun      | Orange        | #150\*50#                             | Confirmation by secret code after receiving the push sms |
|               | Mtn           | \*126#                                | Confirmation by secret code after receiving the push sms |
|               | Express Union | NO                                    | Confirmation from the app                                |
| RD Congo      | Orange CD     | NO                                    | Confirmation by secret code after receiving the push sms |
|               | MPesa CD      | NO                                    | Confirmation by secret code after receiving the push sms |
|               | Airtel CD     | NO                                    | Confirmation by secret code after receiving the push sms |
|               | Orange CDUSD  | NO                                    | Confirmation by secret code after receiving the push sms |
|               | Mpesa CDUSD   | NO                                    | Confirmation by secret code after receiving the push sms |
| Guinée        | Orange        | #144#, Choice option 4 and l'option 2 | Payment by otp code                                      |
|               | Mtn           | NO                                    | Confirmation by secret code after receiving the push sms |

## Exemple – Orange CI Cashout avec OTP

Pour les transactions où le paramètre `om_otp` est requis :

```json theme={null}
{
  "amount": 5000,
  "api_key": "xxxxxxxxxxxxxxx",
  "destination": "0701234567",
  "service_id": 27,
  "ipn_url": "https://votre_webhook.url",
  "custom_data": "order_789",
  "om_otp": "1234"
}
```

## Réponse immédiate

<Warning>
  La réponse reçue ne confirme **pas** le succès final, elle indique seulement
  que la requête est valide.
</Warning>

**Exemple de réponse :**

```json theme={null}
{
  "data": {
    "transaction_id": "EFB.001158",
	"amount": 12250,
  	"state": "PENDING1",
	....
  }
}
```

La réponse complète peut être consultée dans [la section API Reference](/api-reference/endpoint/transaction)
