curl https://api.onepay.la/v1/request-to-pay/nequi \
-X POST \
-H "Authorization: Bearer sk_test_xxx" \
-H "Content-Type: application/json" \
-H "x-idempotency: nequi-001" \
-d '{
"customer_id": "9dd4158b-0e45-42bc-b56f-a4c1f856814d",
"amount": 10000,
"phone": "+573167591030",
"title": "Cobro de servicio",
"external_id": "order-12345"
}'
const response = await fetch('https://api.onepay.la/v1/request-to-pay/nequi', {
method: 'POST',
headers: {
'Authorization': 'Bearer sk_test_xxx',
'Content-Type': 'application/json',
'x-idempotency': 'nequi-001'
},
body: JSON.stringify({
customer_id: '9dd4158b-0e45-42bc-b56f-a4c1f856814d',
amount: 10000,
phone: '+573167591030',
title: 'Cobro de servicio',
external_id: 'order-12345'
})
});
const requestToPay = await response.json();
console.log(requestToPay.id);
console.log(requestToPay.status); // pending - usuario tiene 45 min para confirmar
import requests
url = "https://api.onepay.la/v1/request-to-pay/nequi"
headers = {
"Authorization": "Bearer sk_test_xxx",
"Content-Type": "application/json",
"x-idempotency": "nequi-001"
}
data = {
"customer_id": "9dd4158b-0e45-42bc-b56f-a4c1f856814d",
"amount": 10000,
"phone": "+573167591030",
"title": "Cobro de servicio",
"external_id": "order-12345"
}
response = requests.post(url, headers=headers, json=data)
request_to_pay = response.json()
print(request_to_pay["id"])
print(request_to_pay["status"]) # pending - usuario tiene 45 min para confirmar
<?php
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => "https://api.onepay.la/v1/request-to-pay/nequi",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer sk_test_xxx",
"Content-Type: application/json",
"x-idempotency: nequi-001"
],
CURLOPT_POSTFIELDS => json_encode([
"customer_id" => "9dd4158b-0e45-42bc-b56f-a4c1f856814d",
"amount" => 10000,
"phone" => "+573167591030",
"title" => "Cobro de servicio",
"external_id" => "order-12345"
])
]);
$response = curl_exec($ch);
$requestToPay = json_decode($response, true);
echo $requestToPay["id"];
echo $requestToPay["status"]; // pending - usuario tiene 45 min para confirmar
curl_close($ch);
?>
{
"id": "4ba8a568-b5c9-4446-a858-b6d00dab341e",
"description": "Charge description",
"amount": 10000,
"amount_label": "Charge amount",
"source": "nequi",
"status": "pending",
"currency": "COP",
"payment_method_type": "nequi",
"payment_method_id": "4ba8a568-b5c9-4446-a858-b6d00dab341e",
"created_at": "2022-01-01T00:00:00.000Z",
"paid_at": null,
"remarks": null,
"is_test": false,
"network_id": "4ba8a568-b5c9-4446-a858-b6d00dab341e",
"external_id": "4ba8a568-b5c9-4446-a858-b6d00dab341e"
}
Crea un Request to Pay para Nequi.
POST
/
request-to-pay
/
nequi
curl https://api.onepay.la/v1/request-to-pay/nequi \
-X POST \
-H "Authorization: Bearer sk_test_xxx" \
-H "Content-Type: application/json" \
-H "x-idempotency: nequi-001" \
-d '{
"customer_id": "9dd4158b-0e45-42bc-b56f-a4c1f856814d",
"amount": 10000,
"phone": "+573167591030",
"title": "Cobro de servicio",
"external_id": "order-12345"
}'
const response = await fetch('https://api.onepay.la/v1/request-to-pay/nequi', {
method: 'POST',
headers: {
'Authorization': 'Bearer sk_test_xxx',
'Content-Type': 'application/json',
'x-idempotency': 'nequi-001'
},
body: JSON.stringify({
customer_id: '9dd4158b-0e45-42bc-b56f-a4c1f856814d',
amount: 10000,
phone: '+573167591030',
title: 'Cobro de servicio',
external_id: 'order-12345'
})
});
const requestToPay = await response.json();
console.log(requestToPay.id);
console.log(requestToPay.status); // pending - usuario tiene 45 min para confirmar
import requests
url = "https://api.onepay.la/v1/request-to-pay/nequi"
headers = {
"Authorization": "Bearer sk_test_xxx",
"Content-Type": "application/json",
"x-idempotency": "nequi-001"
}
data = {
"customer_id": "9dd4158b-0e45-42bc-b56f-a4c1f856814d",
"amount": 10000,
"phone": "+573167591030",
"title": "Cobro de servicio",
"external_id": "order-12345"
}
response = requests.post(url, headers=headers, json=data)
request_to_pay = response.json()
print(request_to_pay["id"])
print(request_to_pay["status"]) # pending - usuario tiene 45 min para confirmar
<?php
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => "https://api.onepay.la/v1/request-to-pay/nequi",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer sk_test_xxx",
"Content-Type: application/json",
"x-idempotency: nequi-001"
],
CURLOPT_POSTFIELDS => json_encode([
"customer_id" => "9dd4158b-0e45-42bc-b56f-a4c1f856814d",
"amount" => 10000,
"phone" => "+573167591030",
"title" => "Cobro de servicio",
"external_id" => "order-12345"
])
]);
$response = curl_exec($ch);
$requestToPay = json_decode($response, true);
echo $requestToPay["id"];
echo $requestToPay["status"]; // pending - usuario tiene 45 min para confirmar
curl_close($ch);
?>
{
"id": "4ba8a568-b5c9-4446-a858-b6d00dab341e",
"description": "Charge description",
"amount": 10000,
"amount_label": "Charge amount",
"source": "nequi",
"status": "pending",
"currency": "COP",
"payment_method_type": "nequi",
"payment_method_id": "4ba8a568-b5c9-4446-a858-b6d00dab341e",
"created_at": "2022-01-01T00:00:00.000Z",
"paid_at": null,
"remarks": null,
"is_test": false,
"network_id": "4ba8a568-b5c9-4446-a858-b6d00dab341e",
"external_id": "4ba8a568-b5c9-4446-a858-b6d00dab341e"
}
Tiempo de confirmación: Para transacciones con NEQUI, el usuario tiene hasta 45 minutos para confirmar el pago. Es importante que tu aplicación maneje este tiempo de espera o implemente un flujo que permita al usuario completar la confirmación dentro de este período.Lastimosamente, la API de NEQUI no ofrece la posibilidad de cancelar este proceso.
Headers
string
required
Token único para garantizar la idempotencia de la petición
Body
string
Identificador que asocias a tu proveedor externo.
string
required
ID del cliente sobre el cual se hará la solicitud. Crear cliente.
number
required
Monto a cobrar al usuario, en unidades mayores de la moneda (no en centavos). Enviar
10000
cobra $10.000 COP.string
required
Título de la solicitud.
curl https://api.onepay.la/v1/request-to-pay/nequi \
-X POST \
-H "Authorization: Bearer sk_test_xxx" \
-H "Content-Type: application/json" \
-H "x-idempotency: nequi-001" \
-d '{
"customer_id": "9dd4158b-0e45-42bc-b56f-a4c1f856814d",
"amount": 10000,
"phone": "+573167591030",
"title": "Cobro de servicio",
"external_id": "order-12345"
}'
const response = await fetch('https://api.onepay.la/v1/request-to-pay/nequi', {
method: 'POST',
headers: {
'Authorization': 'Bearer sk_test_xxx',
'Content-Type': 'application/json',
'x-idempotency': 'nequi-001'
},
body: JSON.stringify({
customer_id: '9dd4158b-0e45-42bc-b56f-a4c1f856814d',
amount: 10000,
phone: '+573167591030',
title: 'Cobro de servicio',
external_id: 'order-12345'
})
});
const requestToPay = await response.json();
console.log(requestToPay.id);
console.log(requestToPay.status); // pending - usuario tiene 45 min para confirmar
import requests
url = "https://api.onepay.la/v1/request-to-pay/nequi"
headers = {
"Authorization": "Bearer sk_test_xxx",
"Content-Type": "application/json",
"x-idempotency": "nequi-001"
}
data = {
"customer_id": "9dd4158b-0e45-42bc-b56f-a4c1f856814d",
"amount": 10000,
"phone": "+573167591030",
"title": "Cobro de servicio",
"external_id": "order-12345"
}
response = requests.post(url, headers=headers, json=data)
request_to_pay = response.json()
print(request_to_pay["id"])
print(request_to_pay["status"]) # pending - usuario tiene 45 min para confirmar
<?php
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => "https://api.onepay.la/v1/request-to-pay/nequi",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer sk_test_xxx",
"Content-Type: application/json",
"x-idempotency: nequi-001"
],
CURLOPT_POSTFIELDS => json_encode([
"customer_id" => "9dd4158b-0e45-42bc-b56f-a4c1f856814d",
"amount" => 10000,
"phone" => "+573167591030",
"title" => "Cobro de servicio",
"external_id" => "order-12345"
])
]);
$response = curl_exec($ch);
$requestToPay = json_decode($response, true);
echo $requestToPay["id"];
echo $requestToPay["status"]; // pending - usuario tiene 45 min para confirmar
curl_close($ch);
?>
{
"id": "4ba8a568-b5c9-4446-a858-b6d00dab341e",
"description": "Charge description",
"amount": 10000,
"amount_label": "Charge amount",
"source": "nequi",
"status": "pending",
"currency": "COP",
"payment_method_type": "nequi",
"payment_method_id": "4ba8a568-b5c9-4446-a858-b6d00dab341e",
"created_at": "2022-01-01T00:00:00.000Z",
"paid_at": null,
"remarks": null,
"is_test": false,
"network_id": "4ba8a568-b5c9-4446-a858-b6d00dab341e",
"external_id": "4ba8a568-b5c9-4446-a858-b6d00dab341e"
}
Was this page helpful?
⌘I