curl https://api.onepay.la/v1/charges \
-X POST \
-H "Authorization: Bearer sk_test_xxx" \
-H "Content-Type: application/json" \
-H "x-idempotency: charge-card-001" \
-d '{
"title": "Mensualidad Enero 2025",
"customer_id": "9dd4158b-0e45-42bc-b56f-a4c1f856814d",
"amount": 85000,
"card_id": "9e01eeae-2868-4564-9d04-84d1d1d027d2",
"currency": "COP"
}'
{
"id": "9e02966f-2ddf-4ee7-a391-5b5b7653e232",
"title": "Test Charge",
"amount": 1000,
"amount_label": "$1.000",
"source": "charge",
"status": "declined",
"currency": "COP",
"payment_method_type": "Account",
"payment_method_id": "4dc959d0-d96a-377a-823e-5e05cfde896f",
"created_at": "2025-01-20T02:18:29.000000Z",
"paid_at": null,
"remarks": {
"code": "INTERNAL_ERROR",
"description": "Error interno. Comunícate con soporte para resolver el problema."
},
"is_test": true,
"method": {
"id": "4dc959d0-d96a-377a-823e-5e05cfde896f",
"title": "Dr.",
"subtype": "SAVINGS",
"status": "PENDING",
"authorization": true,
"customer_id": "9e02966e-8beb-4e02-ba0c-bea875a07b22",
"re_enroll": false,
"external_id": null,
"bank_id": "9e02966e-8d60-49b0-ad66-372bf73c4a54",
"bank": {
"id": "9e02966e-8d60-49b0-ad66-372bf73c4a54",
"name": "Hoeger PLC",
"logo": null
}
},
"customer": {
"id": "9e02966e-8beb-4e02-ba0c-bea875a07b22",
"first_name": "Florencio",
"last_name": "Conroy",
"email": "",
"phone": "+12518057105",
"document_type": "CC",
"document_number": "930232",
"created_at": "2025-01-20T02:18:29.000000Z",
"is_test": true
},
"splits": [
{
"id": "9e02966f-3204-4e50-9fb7-b8bc0214a93b",
"customer_id": "9e02966e-8beb-4e02-ba0c-bea875a07b22",
"split_type": "percentage",
"split_value": 300,
"description": "Test Split",
"created_at": "2025-01-20T02:18:29.000000Z",
"scheduled_at": null,
"account_id": "4dc959d0-d96a-377a-823e-5e05cfde896f"
}
]
}
Endpoint para crear un cargo en el sistema de OnePay.
curl https://api.onepay.la/v1/charges \
-X POST \
-H "Authorization: Bearer sk_test_xxx" \
-H "Content-Type: application/json" \
-H "x-idempotency: charge-card-001" \
-d '{
"title": "Mensualidad Enero 2025",
"customer_id": "9dd4158b-0e45-42bc-b56f-a4c1f856814d",
"amount": 85000,
"card_id": "9e01eeae-2868-4564-9d04-84d1d1d027d2",
"currency": "COP"
}'
{
"id": "9e02966f-2ddf-4ee7-a391-5b5b7653e232",
"title": "Test Charge",
"amount": 1000,
"amount_label": "$1.000",
"source": "charge",
"status": "declined",
"currency": "COP",
"payment_method_type": "Account",
"payment_method_id": "4dc959d0-d96a-377a-823e-5e05cfde896f",
"created_at": "2025-01-20T02:18:29.000000Z",
"paid_at": null,
"remarks": {
"code": "INTERNAL_ERROR",
"description": "Error interno. Comunícate con soporte para resolver el problema."
},
"is_test": true,
"method": {
"id": "4dc959d0-d96a-377a-823e-5e05cfde896f",
"title": "Dr.",
"subtype": "SAVINGS",
"status": "PENDING",
"authorization": true,
"customer_id": "9e02966e-8beb-4e02-ba0c-bea875a07b22",
"re_enroll": false,
"external_id": null,
"bank_id": "9e02966e-8d60-49b0-ad66-372bf73c4a54",
"bank": {
"id": "9e02966e-8d60-49b0-ad66-372bf73c4a54",
"name": "Hoeger PLC",
"logo": null
}
},
"customer": {
"id": "9e02966e-8beb-4e02-ba0c-bea875a07b22",
"first_name": "Florencio",
"last_name": "Conroy",
"email": "",
"phone": "+12518057105",
"document_type": "CC",
"document_number": "930232",
"created_at": "2025-01-20T02:18:29.000000Z",
"is_test": true
},
"splits": [
{
"id": "9e02966f-3204-4e50-9fb7-b8bc0214a93b",
"customer_id": "9e02966e-8beb-4e02-ba0c-bea875a07b22",
"split_type": "percentage",
"split_value": 300,
"description": "Test Split",
"created_at": "2025-01-20T02:18:29.000000Z",
"scheduled_at": null,
"account_id": "4dc959d0-d96a-377a-823e-5e05cfde896f"
}
]
}
card_id está vacío.account_id está vacío.percentage o fixedShow properties
curl https://api.onepay.la/v1/charges \
-X POST \
-H "Authorization: Bearer sk_test_xxx" \
-H "Content-Type: application/json" \
-H "x-idempotency: charge-card-001" \
-d '{
"title": "Mensualidad Enero 2025",
"customer_id": "9dd4158b-0e45-42bc-b56f-a4c1f856814d",
"amount": 85000,
"card_id": "9e01eeae-2868-4564-9d04-84d1d1d027d2",
"currency": "COP"
}'
{
"id": "9e02966f-2ddf-4ee7-a391-5b5b7653e232",
"title": "Test Charge",
"amount": 1000,
"amount_label": "$1.000",
"source": "charge",
"status": "declined",
"currency": "COP",
"payment_method_type": "Account",
"payment_method_id": "4dc959d0-d96a-377a-823e-5e05cfde896f",
"created_at": "2025-01-20T02:18:29.000000Z",
"paid_at": null,
"remarks": {
"code": "INTERNAL_ERROR",
"description": "Error interno. Comunícate con soporte para resolver el problema."
},
"is_test": true,
"method": {
"id": "4dc959d0-d96a-377a-823e-5e05cfde896f",
"title": "Dr.",
"subtype": "SAVINGS",
"status": "PENDING",
"authorization": true,
"customer_id": "9e02966e-8beb-4e02-ba0c-bea875a07b22",
"re_enroll": false,
"external_id": null,
"bank_id": "9e02966e-8d60-49b0-ad66-372bf73c4a54",
"bank": {
"id": "9e02966e-8d60-49b0-ad66-372bf73c4a54",
"name": "Hoeger PLC",
"logo": null
}
},
"customer": {
"id": "9e02966e-8beb-4e02-ba0c-bea875a07b22",
"first_name": "Florencio",
"last_name": "Conroy",
"email": "",
"phone": "+12518057105",
"document_type": "CC",
"document_number": "930232",
"created_at": "2025-01-20T02:18:29.000000Z",
"is_test": true
},
"splits": [
{
"id": "9e02966f-3204-4e50-9fb7-b8bc0214a93b",
"customer_id": "9e02966e-8beb-4e02-ba0c-bea875a07b22",
"split_type": "percentage",
"split_value": 300,
"description": "Test Split",
"created_at": "2025-01-20T02:18:29.000000Z",
"scheduled_at": null,
"account_id": "4dc959d0-d96a-377a-823e-5e05cfde896f"
}
]
}
Was this page helpful?