Paiements
Créer un paiement
POST/v1/payment-intentspayments:write
Requires payments:write. Cookie mutations require CSRF; connection mutations also require recent MFA. No client_secret is returned.
En-têtes
AuthorizationBearer pos_test_…obligatoire- Clé de serveur. Jamais dans un navigateur.
X-Merchant-IDstringobligatoire- L’espace marchand concerné (mrc_…).
X-Environment"test"obligatoire- Seule valeur acceptée tant que la production n’est pas ouverte.
Idempotency-Keystringobligatoire
Corps
merchant_referencestring, 1 à 128obligatoireamountstringobligatoire- EUR decimal string, local initial profile 0.50..999999.99; exact integer conversion.
currency"EUR"obligatoirecapture_mode"automatic" | "manual"obligatoire- Manual requires the connected account capability. One final capture, including partial capture when supported.
connection_idstring- The account to use. Omit it (or send an empty string) to let PayHaze route the payment: admissible accounts only (capture mode, currency, health, daily cap), then the active rules or PayHaze's lowest estimated cost. The decision is stored and readable at /v1/payment-intents/{id}/route; the payment never changes account afterwards.
payment_method_idstring- A saved method of the register. It is never presented to another account than its own (409 payment_method_not_portable). Paying with a saved method without the buyer arrives with subscriptions: until then 409 capability_unsupported. Nothing is created by a refused request.
Réponses
- 202Demande enregistrée
- 400Requête invalide
- 401Clé absente ou invalide
- 402Service restreint
- 403Autorisation ou espace refusé
- 404Ressource introuvable
- 409Conflit avec une demande existante
- 422Impossible à traiter
- 429Trop de demandes, réessayez plus tard
- 503Service momentanément indisponible
Une erreur ne vaut jamais paiement. Le corps donne code, message, request_id et retry_action ; renvoyez la même Idempotency-Key si retry_action le propose.