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": [
{
"customer_id": "<string>",
"account_id": "<string>",
"split_type": "<string>",
"split_value": "<string>",
"description": "<string>",
"schedule_at": "<string>",
"process": "<string>",
"to_company_wallet": true
}
],
"allows": {
"cards": true,
"accounts": true,
"wallets": true,
"card_extra": true,
"realtime": true,
"pse": true,
"full_extra": true,
"pse_debit": true,
"breb": true
}
}
'{
"id": "9e5ccd4a-d2f0-49dd-87fc-a0da752bd166",
"amount": 1400000,
"amount_label": "$1.400.000",
"currency": "COP",
"title": "Suscripción Premium",
"description": null,
"reference": "INV-2045",
"status": "pending",
"source": "outbound",
"source_id": null,
"customer": null,
"phone": "+573201112233",
"email": "customer@example.com",
"expiration_at": "2025-03-20T22:36:24.000000Z",
"redirect_url": "https://app.onepay.la/thanks",
"payment_link": "https://pagos.onepay.la/payment/9e5ccd4a-d2f0-49dd-87fc-a0da752bd166",
"allows": {
"cards": true,
"accounts": true,
"card_extra": false,
"realtime": false,
"pse": true,
"transfiya": true
},
"metadata": {
"salesforce_id": "OP-554"
},
"splits": [],
"coupon": null,
"created_at": "2025-03-05T22:36:24.000000Z",
"is_expired": false
}
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": [
{
"customer_id": "<string>",
"account_id": "<string>",
"split_type": "<string>",
"split_value": "<string>",
"description": "<string>",
"schedule_at": "<string>",
"process": "<string>",
"to_company_wallet": true
}
],
"allows": {
"cards": true,
"accounts": true,
"wallets": true,
"card_extra": true,
"realtime": true,
"pse": true,
"full_extra": true,
"pse_debit": true,
"breb": true
}
}
'{
"id": "9e5ccd4a-d2f0-49dd-87fc-a0da752bd166",
"amount": 1400000,
"amount_label": "$1.400.000",
"currency": "COP",
"title": "Suscripción Premium",
"description": null,
"reference": "INV-2045",
"status": "pending",
"source": "outbound",
"source_id": null,
"customer": null,
"phone": "+573201112233",
"email": "customer@example.com",
"expiration_at": "2025-03-20T22:36:24.000000Z",
"redirect_url": "https://app.onepay.la/thanks",
"payment_link": "https://pagos.onepay.la/payment/9e5ccd4a-d2f0-49dd-87fc-a0da752bd166",
"allows": {
"cards": true,
"accounts": true,
"card_extra": false,
"realtime": false,
"pse": true,
"transfiya": true
},
"metadata": {
"salesforce_id": "OP-554"
},
"splits": [],
"coupon": null,
"created_at": "2025-03-05T22:36:24.000000Z",
"is_expired": false
}
percentage o fixedShow properties
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 - Procesandosucceeded - Exitosofailed - Fallido{
"id": "9e5ccd4a-d2f0-49dd-87fc-a0da752bd166",
"amount": 1400000,
"amount_label": "$1.400.000",
"currency": "COP",
"title": "Suscripción Premium",
"description": null,
"reference": "INV-2045",
"status": "pending",
"source": "outbound",
"source_id": null,
"customer": null,
"phone": "+573201112233",
"email": "customer@example.com",
"expiration_at": "2025-03-20T22:36:24.000000Z",
"redirect_url": "https://app.onepay.la/thanks",
"payment_link": "https://pagos.onepay.la/payment/9e5ccd4a-d2f0-49dd-87fc-a0da752bd166",
"allows": {
"cards": true,
"accounts": true,
"card_extra": false,
"realtime": false,
"pse": true,
"transfiya": true
},
"metadata": {
"salesforce_id": "OP-554"
},
"splits": [],
"coupon": null,
"created_at": "2025-03-05T22:36:24.000000Z",
"is_expired": false
}
Was this page helpful?