To process a Credix payment via API, follow these steps:
- Create a payment intent for the exact amount.
- Create a payment method of type
credix with card details. - Confirm the intent using the
paymentMethodId and the required credixInstallmentMonths. - The intent moves to
succeeded if approved or failed if rejected. - Wait for the
payment-intent.succeeded webhook before marking the payment as complete in your system.
# 1. Create Payment Intent
curl https://api.onvopay.com/v1/payment-intents \
-X POST \
-H "Authorization: Bearer $ONVO_SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{
"amount": 500000,
"currency": "CRC",
"description": "Pago Credix #1001"
}'
# 2. Create Payment Method
curl https://api.onvopay.com/v1/payment-methods \
-X POST \
-H "Authorization: Bearer $ONVO_SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{
"type": "credix",
"credix": {
"number": "4111111111111111",
"expMonth": 12,
"expYear": 2026,
"cvv": "123",
"holderName": "María Rodríguez"
},
"billing": {
"name": "María Rodríguez",
"email": "maria@example.com"
}
}'
# 3. Confirm Intent
curl https://api.onvopay.com/v1/payment-intents/$PAYMENT_INTENT_ID/confirm \
-X POST \
-H "Authorization: Bearer $ONVO_SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{
"paymentMethodId": "cl502zv0d0127ebdp3zt27651",
"credixInstallmentMonths": 3
}'