Skip to main content
All Stripe functions use the Stripe Node.js SDK and apply CORS (origin: "*"). Request bodies use the data envelope.

stripe_create_payment_intent

POST https://{region}-{project}.cloudfunctions.net/stripe_create_payment_intent
Creates a new Stripe PaymentIntent. Amounts are provided in major currency units and are converted to cents internally (Math.round(amount * 100)).

Request body

data.amount
number
required
Charge amount in major currency units (e.g. 50.00 for $50.00 USD). Must be greater than 0.
data.currency
string
ISO 4217 currency code. Defaults to "usd". Lowercased before sending to Stripe.
data.description
string
Human-readable description. Defaults to "Compra de tickets" if omitted.
data.metadata
object
Arbitrary key/value pairs to attach to the PaymentIntent. The platform automatically appends platform: "TMT" and timestamp (ISO 8601) to whatever you provide.

Response

message
string
"Procesado" on success.
status
number
200 on success, 400 on validation error, 500 on Stripe error.
data.success
boolean
true when the PaymentIntent was created.
data.client_secret
string
The Stripe client secret to use with stripe.confirmPayment() on the frontend.
data.payment_intent_id
string
The Stripe PaymentIntent ID (prefix pi_).

Example

curl -X POST \
  https://{region}-{project}.cloudfunctions.net/stripe_create_payment_intent \
  -H 'Content-Type: application/json' \
  -d '{
    "data": {
      "amount": 50.00,
      "currency": "usd",
      "description": "Entrada General - Gran Concierto 2026",
      "metadata": { "order_id": "Kx9mP2qRtLwNvY4jBc" }
    }
  }'

Errors

Conditionstatuserror
amount missing or <= 0400"El monto es requerido y debe ser mayor a 0"
Stripe API error500Stripe error message

stripe_confirm_payment

POST https://{region}-{project}.cloudfunctions.net/stripe_confirm_payment
Retrieves a PaymentIntent from Stripe and returns success only if its status is succeeded. Use this to verify server-side that a client-confirmed payment actually completed.

Request body

data.payment_intent_id
string
required
The Stripe PaymentIntent ID (prefix pi_) to verify.

Response

data.success
boolean
true only when paymentIntent.status === 'succeeded'.
data.payment_intent.id
string
PaymentIntent ID.
data.payment_intent.status
string
Stripe status string (e.g. "succeeded", "requires_payment_method").
data.payment_intent.amount
number
Charged amount in major currency units (cents divided by 100).
data.payment_intent.currency
string
Currency code.
data.payment_intent.created
number
Unix timestamp of PaymentIntent creation.
data.payment_intent.payment_method
string
The payment method ID used.
data.payment_intent.charges
array
Array of Stripe Charge objects.

Example

curl -X POST \
  https://{region}-{project}.cloudfunctions.net/stripe_confirm_payment \
  -H 'Content-Type: application/json' \
  -d '{ "data": { "payment_intent_id": "pi_3ABC" } }'

Errors

Conditionstatuserror
payment_intent_id missing400"ID de Payment Intent es requerido"
Payment not succeeded400"El pago no fue completado. Estado: {status}"
Stripe API error500Stripe error message

stripe_get_payment_intent

POST https://{region}-{project}.cloudfunctions.net/stripe_get_payment_intent
Retrieves a PaymentIntent from Stripe without any status assertion. Use this to inspect the current state of a PaymentIntent at any time.

Request body

data.payment_intent_id
string
required
The Stripe PaymentIntent ID to retrieve.

Response

data.payment_intent.id
string
PaymentIntent ID.
data.payment_intent.status
string
Current Stripe status (e.g. "succeeded", "canceled", "processing").
data.payment_intent.amount
number
Charged amount in major currency units.
data.payment_intent.currency
string
Currency code.
data.payment_intent.metadata
object
Metadata object attached to the PaymentIntent, including platform and timestamp.

Example

curl -X POST \
  https://{region}-{project}.cloudfunctions.net/stripe_get_payment_intent \
  -H 'Content-Type: application/json' \
  -d '{ "data": { "payment_intent_id": "pi_3ABC" } }'

Errors

Conditionstatuserror
payment_intent_id missing400"ID de Payment Intent es requerido"
Stripe API error500Stripe error message

stripe_webhook

POST https://{region}-{project}.cloudfunctions.net/stripe_webhook
Stripe webhook endpoint. Verifies the event signature using the 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

HeaderRequiredDescription
Stripe-SignatureYesHMAC signature provided by Stripe for verification

Handled event types

Event typeBehavior
payment_intent.succeededLogs the PaymentIntent ID.
payment_intent.payment_failedLogs the failed PaymentIntent ID.
All othersLogged as unhandled.

Response

{ "received": true }
Returns HTTP 400 with an error message if signature verification fails.

Build docs developers (and LLMs) love