origin: "*"). Request bodies use the data envelope.
stripe_create_payment_intent
Math.round(amount * 100)).
Request body
Charge amount in major currency units (e.g.
50.00 for $50.00 USD). Must be greater than 0.ISO 4217 currency code. Defaults to
"usd". Lowercased before sending to Stripe.Human-readable description. Defaults to
"Compra de tickets" if omitted.Arbitrary key/value pairs to attach to the PaymentIntent. The platform automatically appends
platform: "TMT" and timestamp (ISO 8601) to whatever you provide.Response
"Procesado" on success.200 on success, 400 on validation error, 500 on Stripe error.true when the PaymentIntent was created.The Stripe client secret to use with
stripe.confirmPayment() on the frontend.The Stripe PaymentIntent ID (prefix
pi_).Example
Errors
| Condition | status | error |
|---|---|---|
amount missing or <= 0 | 400 | "El monto es requerido y debe ser mayor a 0" |
| Stripe API error | 500 | Stripe error message |
stripe_confirm_payment
succeeded. Use this to verify server-side that a client-confirmed payment actually completed.
Request body
The Stripe PaymentIntent ID (prefix
pi_) to verify.Response
true only when paymentIntent.status === 'succeeded'.PaymentIntent ID.
Stripe status string (e.g.
"succeeded", "requires_payment_method").Charged amount in major currency units (cents divided by 100).
Currency code.
Unix timestamp of PaymentIntent creation.
The payment method ID used.
Array of Stripe Charge objects.
Example
Errors
| Condition | status | error |
|---|---|---|
payment_intent_id missing | 400 | "ID de Payment Intent es requerido" |
| Payment not succeeded | 400 | "El pago no fue completado. Estado: {status}" |
| Stripe API error | 500 | Stripe error message |
stripe_get_payment_intent
Request body
The Stripe PaymentIntent ID to retrieve.
Response
PaymentIntent ID.
Current Stripe status (e.g.
"succeeded", "canceled", "processing").Charged amount in major currency units.
Currency code.
Metadata object attached to the PaymentIntent, including
platform and timestamp.Example
Errors
| Condition | status | error |
|---|---|---|
payment_intent_id missing | 400 | "ID de Payment Intent es requerido" |
| Stripe API error | 500 | Stripe error message |
stripe_webhook
STRIPE_WEBHOOK_SECRET environment variable and processes the following event types.
This endpoint is called by Stripe, not by your application. Configure it in your Stripe Dashboard under Developers → Webhooks.
Headers
| Header | Required | Description |
|---|---|---|
Stripe-Signature | Yes | HMAC signature provided by Stripe for verification |
Handled event types
| Event type | Behavior |
|---|---|
payment_intent.succeeded | Logs the PaymentIntent ID. |
payment_intent.payment_failed | Logs the failed PaymentIntent ID. |
| All others | Logged as unhandled. |
Response
400 with an error message if signature verification fails.