Create Payment
POST /paiement/:provider
Creates a payment invoice for purchasing items or adding balance using the specified payment provider.
connected
Path Parameters
The payment provider to use (e.g.,
"stripe", "paypal", etc.).Payment type:
"balance" for adding funds, or "items" for purchasing specific items.Amount in cents (required when
type is "balance").Array of item details (required when
type is "items").Specific payment method identifier (provider-dependent).
Payment Flow
- The server validates the user and request parameters
- Generates a unique transaction UUID
- For
"balance"type: prepares a balance top-up payment - For
"items"type: validates items availability and prepares item purchase - Records the transaction in the database
- Creates an invoice with the payment provider
Redirect URL to the payment provider’s checkout page.
| Status | Message |
|---|---|
error | Provider is required |
error | Invalid user |
error | Invalid provider |
error | Invalid request parameters |
error | No items found |
error | Failed to save transaction |
error | Failed to process payment |