Aller au contenu principal

Méthode OAuth — créer un paiement

Méthode OAuth · étape 2 sur 2. Vous devez d'abord avoir obtenu un jeton — voir Authentification.

POST /partners/payments

Crée un paiement et renvoie la page de paiement hébergée (paymentUrl). Requiert le scope payments:create.

En-têteRequisValeur
AuthorizationOuiBearer <access_token>
Content-TypeOuiapplication/json

Corps de la requête​

ChampTypeRequisRègles
amountDoubleOuiNon nul, positif
currencyStringOuiLongueur 3, doit valoir EUR (forcé à EUR par le service)
externalReferenceStringOuiNon vide, max 150
descriptionStringOuiMax 140, caractères de libellé SEPA autorisés
callbackUriStringOuiURL absolue HTTPS, max 1000 ; ni localhost ni IP privée
webhookUriStringOuiURL absolue HTTPS, max 1000 ; ni localhost ni IP privée
payee.ibanStringOuiIBAN valide (normalisé, MOD97), max 34
payee.fullNameStringOuiNon vide, max 150
customer.nameStringNonMax 150
customer.emailStringNonE-mail valide, max 150
customer.phoneStringNonMax 30
metadataMap<String,Object>NonSérialisé en JSON ; metadata.stateId peut alimenter stateId
stateIdStringNonMax 150 ; prioritaire sur metadata.stateId
paymentTypeStringNonMax 30

Exemple de requête​

POST /partners/payments
Authorization: Bearer <access_token>
Content-Type: application/json

{
"amount": 150.00,
"currency": "EUR",
"externalReference": "ORDER-123",
"description": "Paiement de la commande ORDER-123",
"callbackUri": "https://partner.example.com/callback",
"webhookUri": "https://partner.example.com/api/payment/webhook",
"customer": {
"name": "Nom Client",
"email": "[email protected]",
"phone": "+212600000000"
},
"payee": {
"iban": "FR7630003011300040000000000",
"fullName": "Atelier Marquet SAS"
},
"metadata": {
"stateId": "STATE-001"
},
"paymentType": "INST"
}

Réponse​

201 Created :

{
"paymentRequestId": "6f1a2b3c4d5e67890123456789abcdef",
"externalReference": "ORDER-123",
"status": "CREATED",
"paymentUrl": "https://gateway.lodinpay.com/pay?id=ORDER-ID-123&type=PARTNER&canal=WEB",
"expiresAt": "2026-06-10T12:30:00Z"
}
ChampDescription
paymentRequestIdIdentifiant du paiement (32 caractères hexadécimaux).
externalReferenceVotre référence, telle que transmise.
statusCREATED à la création. Voir le cycle de vie.
paymentUrlPage de paiement hébergée à présenter au client.
expiresAtExpiration du lien (par défaut 30 minutes après la création).

Après la création​

Présentez la paymentUrl au client. Une fois le parcours bancaire terminé, son navigateur est redirigé vers votre callbackUri avec paymentRequestId (et stateId s'il a été fourni). Le statut réel se lit côté serveur — voir Statut & redirection.

Le navigateur ne fait pas autorité

Ne considérez jamais le retour navigateur comme la confirmation d'un paiement. Lisez le statut via l'API.

Validation​

Les principales causes de rejet (400) : devise différente de EUR, IBAN invalide, callbackUri/webhookUri non HTTPS ou absolue, description trop longue ou caractères non SEPA. Voir Erreurs.