Before the user can enter card details, your frontend must request a StripeDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/ALEJ4NDRO2025/urban-store/llms.txt
Use this file to discover all available pages before exploring further.
PaymentIntent from this endpoint. The server validates that the order exists, belongs to the authenticated user, and is still in the pending state, then creates a PaymentIntent via Stripe’s API, stores the resulting payment_intent_id on the order, and returns the client_secret. Pass client_secret directly to Stripe Elements’ confirmPayment() to render the payment form.
Endpoint
Authentication
Bearer token required. Returns401 if the token is missing or invalid.
Request Body
The MongoDB ObjectId of the order for which to create the payment intent. The order must belong to the authenticated user and have
status: "pending".Stripe PaymentIntent Parameters
| Parameter | Value |
|---|---|
amount | order.total * 100 (integer, centavos) |
currency | "cop" |
metadata.order_id | String representation of the order’s MongoDB ObjectId |
payment_intent_id (e.g. pi_3PQ...) is saved back to the order document for reconciliation.
How to Use client_secret
Pass the returned client_secret to Stripe.js when confirming payment on the frontend:
return_url, call POST /api/payments/confirm-payment/ with the order_id and the payment_intent parameter from the URL.
Request Example
Response — 200 OK
Stripe PaymentIntent client secret in the form
pi_<id>_secret_<key>. Pass this to Stripe Elements to render and confirm the payment form.Error Responses
| Status | Condition |
|---|---|
401 Unauthorized | Token missing, malformed, or expired |
400 Bad Request | order_id not provided in the request body |
400 Bad Request | Order status is not "pending" (already processed) |
400 Bad Request | Stripe API returned an error (StripeError) |
404 Not Found | No order found with the given order_id for this user |