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

# Créer un panier

> Créez un panier Maketou et redirigez votre client vers le paiement.

Cet endpoint crée un panier et initie le processus de paiement.

La réponse fournit une `redirectUrl`. Redirigez votre client vers cette URL pour qu'il procède au paiement.

<Note>
  Cet endpoint est soumis aux [limites de fréquence](/resources/rate-limits). Si vous dépassez une limite, l'API retourne le code HTTP `429` et le header `Retry-After`.
</Note>

## Endpoint

```http theme={null}
POST https://api.maketou.net/api/v1/stores/cart/checkout
```

## Body

| Paramètre           | Type     | Requis | Description                                             |
| ------------------- | -------- | ------ | ------------------------------------------------------- |
| `productDocumentId` | `string` | Oui    | Identifiant public du produit                           |
| `email`             | `string` | Oui    | Adresse email du client                                 |
| `firstName`         | `string` | Oui    | Prénom du client                                        |
| `lastName`          | `string` | Oui    | Nom du client                                           |
| `phone`             | `string` | Non    | Numéro de téléphone du client                           |
| `redirectURL`       | `string` | Non    | URL de retour après paiement                            |
| `meta`              | `object` | Non    | Métadonnées personnalisées                              |
| `customerPrice`     | `number` | Non    | Prix choisi par le client pour un produit en prix libre |

## Exemple de payload

```json theme={null}
{
  "productDocumentId": "550e8400-e29b-41d4-a716-446655440000",
  "email": "client@example.com",
  "firstName": "Jean",
  "lastName": "Dupont",
  "phone": "+33612345678",
  "redirectURL": "https://monsite.com/confirmation",
  "meta": {
    "userId": "12345",
    "source": "website"
  }
}
```

## Réponse

```json theme={null}
{
  "cart": {
    "id": "fd2d91d7-20d2-4b86-b067-d474fb0d1e60",
    "createdAt": "2025-11-28T14:27:00.805Z",
    "updatedAt": "2025-11-28T14:27:00.805Z",
    "status": "waiting_payment",
    "customerInfo": {
      "firstName": "John",
      "lastName": "Doe",
      "email": "customer@example.com",
      "phone": "+33612345678",
      "lang": "fr-FR"
    }
  },
  "redirectUrl": "https://checkout.moneroo.io/py_mj2m7m6gfro8"
}
```

## Erreurs

| Code HTTP | Description                                                                                               |
| --------- | --------------------------------------------------------------------------------------------------------- |
| `400`     | Produit invalide ou indisponible — Code : `INVALID_PRODUCT`                                               |
| `401`     | Clé API invalide ou manquante — Code : `INVALID_API_KEY`                                                  |
| `422`     | Le format attendu pour la payload n'est pas respecté — Code : `VALIDATION_ERROR`                          |
| `429`     | Limite de fréquence dépassée — Code : `RATE_LIMITED`. Voir [Limites de fréquence](/resources/rate-limits) |

## Tester l'endpoint

Ouvrez [Créer un panier dans l'API Reference](/api-reference/overview), ajoutez votre clé API, puis envoyez une requête depuis le playground.

Consultez les headers `X-RateLimit-Limit`, `X-RateLimit-Remaining` et `X-RateLimit-Reset` dans la réponse pour suivre votre consommation.
