curl https://api.onepay.la/v1/request-to-pay/daviplata \
-X POST \
-H "Authorization: Bearer sk_test_xxx" \
-H "Content-Type: application/json" \
-H "x-idempotency: daviplata-001" \
-d '{
"customer_id": "9dd4158b-0e45-42bc-b56f-a4c1f856814d",
"amount": 10000,
"document": "12345678",
"document_type": "CC",
"phone": "+573167591030",
"title": "Cobro de servicio",
"external_id": "order-12345"
}'
const response = await fetch('https://api.onepay.la/v1/request-to-pay/daviplata', {
method: 'POST',
headers: {
'Authorization': 'Bearer sk_test_xxx',
'Content-Type': 'application/json',
'x-idempotency': 'daviplata-001'
},
body: JSON.stringify({
customer_id: '9dd4158b-0e45-42bc-b56f-a4c1f856814d',
amount: 10000,
document: '12345678',
document_type: 'CC',
phone: '+573167591030',
title: 'Cobro de servicio',
external_id: 'order-12345'
})
});
const requestToPay = await response.json();
console.log(requestToPay.id);
console.log(requestToPay.status); // pending
import requests
url = "https://api.onepay.la/v1/request-to-pay/daviplata"
headers = {
"Authorization": "Bearer sk_test_xxx",
"Content-Type": "application/json",
"x-idempotency": "daviplata-001"
}
data = {
"customer_id": "9dd4158b-0e45-42bc-b56f-a4c1f856814d",
"amount": 10000,
"document": "12345678",
"document_type": "CC",
"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
<?php
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => "https://api.onepay.la/v1/request-to-pay/daviplata",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer sk_test_xxx",
"Content-Type: application/json",
"x-idempotency: daviplata-001"
],
CURLOPT_POSTFIELDS => json_encode([
"customer_id" => "9dd4158b-0e45-42bc-b56f-a4c1f856814d",
"amount" => 10000,
"document" => "12345678",
"document_type" => "CC",
"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
curl_close($ch);
?>
{
"id": "4ba8a568-b5c9-4446-a858-b6d00dab341e",
"description": "Charge description",
"amount": 10000,
"amount_label": "Charge amount",
"source": "daviplata",
"status": "pending",
"currency": "COP",
"payment_method_type": "daviplata",
"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 Daviplata.
POST
/
request-to-pay
/
daviplata
curl https://api.onepay.la/v1/request-to-pay/daviplata \
-X POST \
-H "Authorization: Bearer sk_test_xxx" \
-H "Content-Type: application/json" \
-H "x-idempotency: daviplata-001" \
-d '{
"customer_id": "9dd4158b-0e45-42bc-b56f-a4c1f856814d",
"amount": 10000,
"document": "12345678",
"document_type": "CC",
"phone": "+573167591030",
"title": "Cobro de servicio",
"external_id": "order-12345"
}'
const response = await fetch('https://api.onepay.la/v1/request-to-pay/daviplata', {
method: 'POST',
headers: {
'Authorization': 'Bearer sk_test_xxx',
'Content-Type': 'application/json',
'x-idempotency': 'daviplata-001'
},
body: JSON.stringify({
customer_id: '9dd4158b-0e45-42bc-b56f-a4c1f856814d',
amount: 10000,
document: '12345678',
document_type: 'CC',
phone: '+573167591030',
title: 'Cobro de servicio',
external_id: 'order-12345'
})
});
const requestToPay = await response.json();
console.log(requestToPay.id);
console.log(requestToPay.status); // pending
import requests
url = "https://api.onepay.la/v1/request-to-pay/daviplata"
headers = {
"Authorization": "Bearer sk_test_xxx",
"Content-Type": "application/json",
"x-idempotency": "daviplata-001"
}
data = {
"customer_id": "9dd4158b-0e45-42bc-b56f-a4c1f856814d",
"amount": 10000,
"document": "12345678",
"document_type": "CC",
"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
<?php
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => "https://api.onepay.la/v1/request-to-pay/daviplata",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer sk_test_xxx",
"Content-Type: application/json",
"x-idempotency: daviplata-001"
],
CURLOPT_POSTFIELDS => json_encode([
"customer_id" => "9dd4158b-0e45-42bc-b56f-a4c1f856814d",
"amount" => 10000,
"document" => "12345678",
"document_type" => "CC",
"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
curl_close($ch);
?>
{
"id": "4ba8a568-b5c9-4446-a858-b6d00dab341e",
"description": "Charge description",
"amount": 10000,
"amount_label": "Charge amount",
"source": "daviplata",
"status": "pending",
"currency": "COP",
"payment_method_type": "daviplata",
"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"
}
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 que recibirá 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
Documento del usuario al que se le envia la solicitud.
string
required
Tipo de documento del usuario al que se le envia la solicitud.
Campos soportados:
Campos soportados:
CC, CE, TI.string
required
Título de la solicitud.
curl https://api.onepay.la/v1/request-to-pay/daviplata \
-X POST \
-H "Authorization: Bearer sk_test_xxx" \
-H "Content-Type: application/json" \
-H "x-idempotency: daviplata-001" \
-d '{
"customer_id": "9dd4158b-0e45-42bc-b56f-a4c1f856814d",
"amount": 10000,
"document": "12345678",
"document_type": "CC",
"phone": "+573167591030",
"title": "Cobro de servicio",
"external_id": "order-12345"
}'
const response = await fetch('https://api.onepay.la/v1/request-to-pay/daviplata', {
method: 'POST',
headers: {
'Authorization': 'Bearer sk_test_xxx',
'Content-Type': 'application/json',
'x-idempotency': 'daviplata-001'
},
body: JSON.stringify({
customer_id: '9dd4158b-0e45-42bc-b56f-a4c1f856814d',
amount: 10000,
document: '12345678',
document_type: 'CC',
phone: '+573167591030',
title: 'Cobro de servicio',
external_id: 'order-12345'
})
});
const requestToPay = await response.json();
console.log(requestToPay.id);
console.log(requestToPay.status); // pending
import requests
url = "https://api.onepay.la/v1/request-to-pay/daviplata"
headers = {
"Authorization": "Bearer sk_test_xxx",
"Content-Type": "application/json",
"x-idempotency": "daviplata-001"
}
data = {
"customer_id": "9dd4158b-0e45-42bc-b56f-a4c1f856814d",
"amount": 10000,
"document": "12345678",
"document_type": "CC",
"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
<?php
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => "https://api.onepay.la/v1/request-to-pay/daviplata",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer sk_test_xxx",
"Content-Type: application/json",
"x-idempotency: daviplata-001"
],
CURLOPT_POSTFIELDS => json_encode([
"customer_id" => "9dd4158b-0e45-42bc-b56f-a4c1f856814d",
"amount" => 10000,
"document" => "12345678",
"document_type" => "CC",
"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
curl_close($ch);
?>
{
"id": "4ba8a568-b5c9-4446-a858-b6d00dab341e",
"description": "Charge description",
"amount": 10000,
"amount_label": "Charge amount",
"source": "daviplata",
"status": "pending",
"currency": "COP",
"payment_method_type": "daviplata",
"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