Desarrolladores
Cómo usar la API
Endpoint para crear un cargo en el sistema de OnePay.
cURL
curl --request POST \ --url https://api.onepay.la/v1/charges \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --header 'x-idempotency: <x-idempotency>' \ --data '{ "title": "<string>", "customer_id": "<string>", "amount": 123, "account_id": "<string>", "card_id": "<string>", "currency": "<string>", "splits": [ { "customer_id": "<string>", "account_id": "<string>", "split_type": "<string>", "split_value": "<string>", "description": "<string>", "schedule_at": "<string>", "process": "<string>" } ], "test_scenario": "<string>", "allows": { "cards": true, "accounts": true, "card_extra": true, "realtime": true, "pse": true, "transfiya": true } }'
{ "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" } ] }
percentage
fixed
Show properties
Was this page helpful?