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

# Créer un lien de paiement

> Créer un lien de paiement réutilisable

# Créer un lien de paiement

Crée un lien de paiement qui peut être partagé avec vos clients.

## Endpoint

```
POST /v1/payment-links
```

## Body

| Paramètre      | Type    | Requis | Description                  |
| -------------- | ------- | ------ | ---------------------------- |
| `title`        | string  | ✅      | Titre affiché au client      |
| `price`        | integer | ✅      | Montant en FCFA              |
| `currency`     | string  |        | Devise (défaut: `XOF`)       |
| `description`  | string  |        | Description du produit       |
| `redirect_url` | string  |        | URL de retour après paiement |

## Exemple

```bash theme={null}
curl -X POST https://api.sahelpay.ml/v1/payment-links \
  -H "Authorization: Bearer sk_test_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Abonnement Premium",
    "price": 10000,
    "description": "Accès illimité pendant 1 mois",
    "redirect_url": "https://votre-site.com/merci"
  }'
```

## Réponse

```json theme={null}
{
  "success": true,
  "data": {
    "id": "pl_xyz789",
    "title": "Abonnement Premium",
    "price": 10000,
    "currency": "XOF",
    "slug": "abonnement-premium-xyz789",
    "url": "https://pay.sahelpay.ml/abonnement-premium-xyz789",
    "is_active": true,
    "created_at": "2025-12-18T16:45:00.000Z"
  }
}
```

## Utilisation

Partagez l'URL avec vos clients :

```
https://pay.sahelpay.ml/abonnement-premium-xyz789
```

Le client sera redirigé vers une page de checkout hébergée par SahelPay.
