curl https://api.onepay.la/v1/customers/session/charges \
-X POST \
-H "Authorization: Bearer sk_test_xxx" \
-H "X-Customer-Token: 12|a1b2c3d4e5f6..." \
-H "Content-Type: application/json" \
-d '{
"payment_method_id": "bb02b2fd-154c-4c90-9fdf-cec3a0b25cf5",
"amount": 50000,
"currency": "COP",
"description": "Pago mensualidad marzo",
"approve": true
}'
{
"charge_id": "9e02966f-2ddf-4ee7-a391-5b5b7653e232",
"status": "in_progress",
"message": "Cargo aprobado en modo prueba."
}
Crea un cargo a una tarjeta del cliente autenticado. En modo live, requiere aprobación vía WhatsApp.
curl https://api.onepay.la/v1/customers/session/charges \
-X POST \
-H "Authorization: Bearer sk_test_xxx" \
-H "X-Customer-Token: 12|a1b2c3d4e5f6..." \
-H "Content-Type: application/json" \
-d '{
"payment_method_id": "bb02b2fd-154c-4c90-9fdf-cec3a0b25cf5",
"amount": 50000,
"currency": "COP",
"description": "Pago mensualidad marzo",
"approve": true
}'
{
"charge_id": "9e02966f-2ddf-4ee7-a391-5b5b7653e232",
"status": "in_progress",
"message": "Cargo aprobado en modo prueba."
}
approve (true para aprobar, false para rechazar).created, el endpoint retornará error 422.100 (equivale a $1 COP).COP, USD.true) o se rechaza (false).curl https://api.onepay.la/v1/customers/session/charges \
-X POST \
-H "Authorization: Bearer sk_test_xxx" \
-H "X-Customer-Token: 12|a1b2c3d4e5f6..." \
-H "Content-Type: application/json" \
-d '{
"payment_method_id": "bb02b2fd-154c-4c90-9fdf-cec3a0b25cf5",
"amount": 50000,
"currency": "COP",
"description": "Pago mensualidad marzo",
"approve": true
}'
{
"charge_id": "9e02966f-2ddf-4ee7-a391-5b5b7653e232",
"status": "in_progress",
"message": "Cargo aprobado en modo prueba."
}
Was this page helpful?