Desarrolladores
Cómo usar la API
Endpoint para registrar una dispersión en el sistema de OnePay.
cURL
curl --request POST \ --url https://api.onepay.la/v1/cashouts \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --header 'x-idempotency: <x-idempotency>' \ --data ' { "amount": 123, "account_id": "<string>", "customer_id": "<string>", "description": "<string>", "external_id": "<string>", "currency": "<string>", "method": "<string>" } '
{ "id":"9d44ce43-a227-4566-b107-5a6bc01cbcdf", "customer_id":"9b7c5f38-b2b5-4b0d-8e4c-458192e88eae", "account_id":"9d0ac58c-2226-4f1c-b305-15e6dc3b47f6", "is_test":false, "amount":1000, "status":"processed", "scheduled_at":null, "created_at":"2024-10-17T18:07:18.000000Z", "external_id":null, "method":"ACH" }
curl https://api.onepay.la/v1/cashouts \ -X POST \ -H "Authorization: Bearer sk_test_xxx" \ -H "Content-Type: application/json" \ -H "x-idempotency: cashout-001" \ -d '{ "amount": 1000000, "currency": "COP", "customer_id": "9b7c5f38-b2b5-4b0d-8e4c-458192e88eae", "account_id": "9d0ac58c-2226-4f1c-b305-15e6dc3b47f6", "description": "Pago de nómina", "method": "ACH", "external_id": "PAYROLL-2391" }'
const payload = { amount: 1000000, currency: 'COP', customer_id: '9b7c5f38-b2b5-4b0d-8e4c-458192e88eae', account_id: '9d0ac58c-2226-4f1c-b305-15e6dc3b47f6', description: 'Pago de nómina', method: 'ACH', external_id: 'PAYROLL-2391' }; await fetch('https://api.onepay.la/v1/cashouts', { method: 'POST', headers: { Authorization: 'Bearer sk_test_xxx', 'Content-Type': 'application/json', 'x-idempotency': 'cashout-001' }, body: JSON.stringify(payload) });
import requests payload = { "amount": 1000000, "currency": "COP", "customer_id": "9b7c5f38-b2b5-4b0d-8e4c-458192e88eae", "account_id": "9d0ac58c-2226-4f1c-b305-15e6dc3b47f6", "description": "Pago de nómina", "method": "ACH", "external_id": "PAYROLL-2391" } response = requests.post( "https://api.onepay.la/v1/cashouts", headers={ "Authorization": "Bearer sk_test_xxx", "x-idempotency": "cashout-001" }, json=payload, timeout=15 ) response.raise_for_status() print(response.json())
pending
processing
processed
failed
ACH
TURBO
Was this page helpful?