curl --request POST \
--url https://api.onepay.la/v1/payments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-idempotency: <x-idempotency>' \
--data '
{
"amount": 123,
"title": "<string>",
"currency": "<string>",
"phone": "<string>",
"email": "<string>",
"reference": "<string>",
"tax": 123,
"external_id": "<string>",
"description": "<string>",
"document_url": "<string>",
"expiration_date": "<string>",
"schedule_at": "<string>",
"metadata": {},
"redirect_url": "<string>",
"splits": [
{
"splits[].customer_id": "<string>",
"splits[].split_type": "<string>",
"splits[].split_value": 123,
"splits[].description": "<string>",
"splits[].account_id": "<string>",
"splits[].scheduled_at": "<string>"
}
],
"partial_payment_config": {
"min_amount_in_cents": 123,
"max_amount_in_cents": 123,
"max_payment_methods": 123,
"timeout_hours": 123
}
}
'{
"id": "9e5ccd4a-d2f0-49dd-87fc-a0da752bd166",
"source": "Suscripción Premium",
"currency": "COP",
"amount": 1400000,
"amount_label": "$ 1.400.000",
"title": "Suscripción Premium",
"description": null,
"phone": "+573201112233",
"expiration_at": "2025-03-20T22:36:24.000000Z",
"due_date": null,
"document_link": null,
"external_id": null,
"allows": {
"cards": true,
"accounts": true,
"card_extra": false,
"realtime": false,
"pse": true,
"transfiya": true
},
"status": "pending",
"is_test": false,
"created_at": "2025-03-05T22:36:24.000000Z",
"paid_at": null,
"payment_link": "https://pagos.onepay.la/payment/9e5ccd4a-d2f0-49dd-87fc-a0da752bd166",
"redirect_url": "https://app.onepay.la/thanks",
"provider_id": null,
"metadata": { "salesforce_id": "OP-554" },
"customer": null,
"method": null,
"splits": [],
"company": null,
"commission": null
}
curl --request POST \
--url https://api.onepay.la/v1/payments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-idempotency: <x-idempotency>' \
--data '
{
"amount": 123,
"title": "<string>",
"currency": "<string>",
"phone": "<string>",
"email": "<string>",
"reference": "<string>",
"tax": 123,
"external_id": "<string>",
"description": "<string>",
"document_url": "<string>",
"expiration_date": "<string>",
"schedule_at": "<string>",
"metadata": {},
"redirect_url": "<string>",
"splits": [
{
"splits[].customer_id": "<string>",
"splits[].split_type": "<string>",
"splits[].split_value": 123,
"splits[].description": "<string>",
"splits[].account_id": "<string>",
"splits[].scheduled_at": "<string>"
}
],
"partial_payment_config": {
"min_amount_in_cents": 123,
"max_amount_in_cents": 123,
"max_payment_methods": 123,
"timeout_hours": 123
}
}
'{
"id": "9e5ccd4a-d2f0-49dd-87fc-a0da752bd166",
"source": "Suscripción Premium",
"currency": "COP",
"amount": 1400000,
"amount_label": "$ 1.400.000",
"title": "Suscripción Premium",
"description": null,
"phone": "+573201112233",
"expiration_at": "2025-03-20T22:36:24.000000Z",
"due_date": null,
"document_link": null,
"external_id": null,
"allows": {
"cards": true,
"accounts": true,
"card_extra": false,
"realtime": false,
"pse": true,
"transfiya": true
},
"status": "pending",
"is_test": false,
"created_at": "2025-03-05T22:36:24.000000Z",
"paid_at": null,
"payment_link": "https://pagos.onepay.la/payment/9e5ccd4a-d2f0-49dd-87fc-a0da752bd166",
"redirect_url": "https://app.onepay.la/thanks",
"provider_id": null,
"metadata": { "salesforce_id": "OP-554" },
"customer": null,
"method": null,
"splits": [],
"company": null,
"commission": null
}
Show Campos de splits[]
percentage — Porcentaje del monto total (en centésimas: 1000 = 10%)fixed — Monto fijo en centavossplit_type es percentage: valor en centésimas (500 = 5%, 10000 = 100%)split_type es fixed: monto en centavosYYYY-MM-DD HH:mm:ss). Si es null, se ejecuta de inmediato.Show Propiedades
| Método | Campo requerido | Descripción |
|---|---|---|
| Cuenta bancaria (ACH) | account_id | Débito directo desde cuenta bancaria registrada |
| Tarjeta de crédito/débito | card_id | Cargo a tarjeta tokenizada |
account_id o card_id) debe estar presente en la petición.curl https://api.onepay.la/v1/payments \
-X POST \
-H "Authorization: Bearer sk_test_xxx" \
-H "Content-Type: application/json" \
-H "x-idempotency: payment-123" \
-d '{
"amount": 1400000,
"currency": "COP",
"title": "Suscripción Premium",
"reference": "INV-2045",
"phone": "+573201112233",
"email": "customer@example.com",
"redirect_url": "https://app.onepay.la/thanks",
"allows": {
"cards": true,
"accounts": true,
"pse": true
},
"metadata": {
"salesforce_id": "OP-554"
}
}'
import fetch from 'node-fetch';
const body = {
amount: 1400000,
currency: 'COP',
title: 'Suscripción Premium',
reference: 'INV-2045',
phone: '+573201112233',
email: 'customer@example.com',
redirect_url: 'https://app.onepay.la/thanks',
allows: {
cards: true,
accounts: true,
pse: true
},
metadata: {
salesforce_id: 'OP-554'
}
};
await fetch('https://api.onepay.la/v1/payments', {
method: 'POST',
headers: {
Authorization: 'Bearer sk_test_xxx',
'Content-Type': 'application/json',
'x-idempotency': 'payment-123'
},
body: JSON.stringify(body)
});
import requests
payload = {
"amount": 1400000,
"currency": "COP",
"title": "Suscripción Premium",
"reference": "INV-2045",
"phone": "+573201112233",
"email": "customer@example.com",
"redirect_url": "https://app.onepay.la/thanks",
"allows": {
"cards": True,
"accounts": True,
"pse": True
},
"metadata": {
"salesforce_id": "OP-554"
}
}
response = requests.post(
"https://api.onepay.la/v1/payments",
headers={
"Authorization": "Bearer sk_test_xxx",
"x-idempotency": "payment-123"
},
json=payload,
timeout=15
)
response.raise_for_status()
print(response.json())
pending - Pendienteprocessing - Procesandoapproved - Aprobadodeclined - Rechazadocancelled - Canceladoexpired - Expiradopartially_paid - Parcialmente pagadopartial_expired - Pago parcial expiradopartial_payment_config está configurado.Show Propiedades
Show Propiedades del cargo
{
"id": "9e5ccd4a-d2f0-49dd-87fc-a0da752bd166",
"source": "Suscripción Premium",
"currency": "COP",
"amount": 1400000,
"amount_label": "$ 1.400.000",
"title": "Suscripción Premium",
"description": null,
"phone": "+573201112233",
"expiration_at": "2025-03-20T22:36:24.000000Z",
"due_date": null,
"document_link": null,
"external_id": null,
"allows": {
"cards": true,
"accounts": true,
"card_extra": false,
"realtime": false,
"pse": true,
"transfiya": true
},
"status": "pending",
"is_test": false,
"created_at": "2025-03-05T22:36:24.000000Z",
"paid_at": null,
"payment_link": "https://pagos.onepay.la/payment/9e5ccd4a-d2f0-49dd-87fc-a0da752bd166",
"redirect_url": "https://app.onepay.la/thanks",
"provider_id": null,
"metadata": { "salesforce_id": "OP-554" },
"customer": null,
"method": null,
"splits": [],
"company": null,
"commission": null
}
Was this page helpful?