Crear link de captura
curl --request POST \
--url https://api.onepay.la/v1/connect-links \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-idempotency: <x-idempotency>' \
--data '
{
"customer_id": "<string>",
"single_use": true,
"notify": true,
"external_id": "<string>",
"redirect_url": "<string>",
"metadata": {}
}
'import requests
url = "https://api.onepay.la/v1/connect-links"
payload = {
"customer_id": "<string>",
"single_use": True,
"notify": True,
"external_id": "<string>",
"redirect_url": "<string>",
"metadata": {}
}
headers = {
"x-idempotency": "<x-idempotency>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-idempotency': '<x-idempotency>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
customer_id: '<string>',
single_use: true,
notify: true,
external_id: '<string>',
redirect_url: '<string>',
metadata: {}
})
};
fetch('https://api.onepay.la/v1/connect-links', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.onepay.la/v1/connect-links",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'customer_id' => '<string>',
'single_use' => true,
'notify' => true,
'external_id' => '<string>',
'redirect_url' => '<string>',
'metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-idempotency: <x-idempotency>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.onepay.la/v1/connect-links"
payload := strings.NewReader("{\n \"customer_id\": \"<string>\",\n \"single_use\": true,\n \"notify\": true,\n \"external_id\": \"<string>\",\n \"redirect_url\": \"<string>\",\n \"metadata\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-idempotency", "<x-idempotency>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.onepay.la/v1/connect-links")
.header("x-idempotency", "<x-idempotency>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"customer_id\": \"<string>\",\n \"single_use\": true,\n \"notify\": true,\n \"external_id\": \"<string>\",\n \"redirect_url\": \"<string>\",\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.onepay.la/v1/connect-links")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-idempotency"] = '<x-idempotency>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"customer_id\": \"<string>\",\n \"single_use\": true,\n \"notify\": true,\n \"external_id\": \"<string>\",\n \"redirect_url\": \"<string>\",\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "9e92f61e-e90f-4fbb-a551-080fd4fb4f6f",
"customer_id": "9957858a-c2f1-4f18-a5c2-216b4127e278",
"single_use": false,
"visits": 0,
"completed": 0,
"external_id": "31231231231",
"allows": {
"cards": true,
"accounts": true,
"card_extra": false,
"realtime": false,
"pse": true,
"transfiya": true
},
"created_at": "2025-04-01T20:45:16.000000Z",
"updated_at": "2025-04-01T20:45:16.000000Z",
"url": "https://pagos.onepay.la/connect-link/9e92f61e-e90f-4fbb-a551-080fd4fb4f6f"
}
{
"message": "El campo customer id es obligatorio. (y 1 error más)",
"code": 10001,
"code_name": "validation_error",
"errors": {
"customer_id": [
"El campo customer id es obligatorio."
],
"single_use": [
"El campo single use es obligatorio."
]
}
}
{
"message": "No se puede generar la operación, genera un token de idempotencia y envíelo en los headers como x-idempotency",
"code": 10003,
"code_name": "idempotency_error"
}
Crear link de captura
Crea un nuevo link de captura, para que el cliente pueda registrar su información de pago.
POST
/
connect-links
Crear link de captura
curl --request POST \
--url https://api.onepay.la/v1/connect-links \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-idempotency: <x-idempotency>' \
--data '
{
"customer_id": "<string>",
"single_use": true,
"notify": true,
"external_id": "<string>",
"redirect_url": "<string>",
"metadata": {}
}
'import requests
url = "https://api.onepay.la/v1/connect-links"
payload = {
"customer_id": "<string>",
"single_use": True,
"notify": True,
"external_id": "<string>",
"redirect_url": "<string>",
"metadata": {}
}
headers = {
"x-idempotency": "<x-idempotency>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-idempotency': '<x-idempotency>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
customer_id: '<string>',
single_use: true,
notify: true,
external_id: '<string>',
redirect_url: '<string>',
metadata: {}
})
};
fetch('https://api.onepay.la/v1/connect-links', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.onepay.la/v1/connect-links",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'customer_id' => '<string>',
'single_use' => true,
'notify' => true,
'external_id' => '<string>',
'redirect_url' => '<string>',
'metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-idempotency: <x-idempotency>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.onepay.la/v1/connect-links"
payload := strings.NewReader("{\n \"customer_id\": \"<string>\",\n \"single_use\": true,\n \"notify\": true,\n \"external_id\": \"<string>\",\n \"redirect_url\": \"<string>\",\n \"metadata\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-idempotency", "<x-idempotency>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.onepay.la/v1/connect-links")
.header("x-idempotency", "<x-idempotency>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"customer_id\": \"<string>\",\n \"single_use\": true,\n \"notify\": true,\n \"external_id\": \"<string>\",\n \"redirect_url\": \"<string>\",\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.onepay.la/v1/connect-links")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-idempotency"] = '<x-idempotency>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"customer_id\": \"<string>\",\n \"single_use\": true,\n \"notify\": true,\n \"external_id\": \"<string>\",\n \"redirect_url\": \"<string>\",\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "9e92f61e-e90f-4fbb-a551-080fd4fb4f6f",
"customer_id": "9957858a-c2f1-4f18-a5c2-216b4127e278",
"single_use": false,
"visits": 0,
"completed": 0,
"external_id": "31231231231",
"allows": {
"cards": true,
"accounts": true,
"card_extra": false,
"realtime": false,
"pse": true,
"transfiya": true
},
"created_at": "2025-04-01T20:45:16.000000Z",
"updated_at": "2025-04-01T20:45:16.000000Z",
"url": "https://pagos.onepay.la/connect-link/9e92f61e-e90f-4fbb-a551-080fd4fb4f6f"
}
{
"message": "El campo customer id es obligatorio. (y 1 error más)",
"code": 10001,
"code_name": "validation_error",
"errors": {
"customer_id": [
"El campo customer id es obligatorio."
],
"single_use": [
"El campo single use es obligatorio."
]
}
}
{
"message": "No se puede generar la operación, genera un token de idempotencia y envíelo en los headers como x-idempotency",
"code": 10003,
"code_name": "idempotency_error"
}
Headers
string
required
Token único para garantizar la idempotencia de la petición
Body
string
required
ID del cliente que completará el formulario. Ver cómo crear un cliente.
boolean
Define si el enlace de conexión (Connect Link) será de un solo uso o de múltiples usos. Si se establece en true, el enlace será de un solo uso; si es false, permitirá múltiples conexiones.
boolean
Indica si se debe notificar al cliente cuando se complete el pago
Métodos de pago permitidosEl método de pago disponible depende de la configuración de tu cuenta. Comunícate con el equipo de soporte para habilitar métodos adicionales.
Solo uno de los dos (
| 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.string
ID único del cliente en tu sistema
string
URL a la que se redirigirá al cliente después de completar el pago
object
Metadatos adicionales que deseas asociar con el link
string
URL de redirección
Response
{
"id": "9e92f61e-e90f-4fbb-a551-080fd4fb4f6f",
"customer_id": "9957858a-c2f1-4f18-a5c2-216b4127e278",
"single_use": false,
"visits": 0,
"completed": 0,
"external_id": "31231231231",
"allows": {
"cards": true,
"accounts": true,
"card_extra": false,
"realtime": false,
"pse": true,
"transfiya": true
},
"created_at": "2025-04-01T20:45:16.000000Z",
"updated_at": "2025-04-01T20:45:16.000000Z",
"url": "https://pagos.onepay.la/connect-link/9e92f61e-e90f-4fbb-a551-080fd4fb4f6f"
}
{
"message": "El campo customer id es obligatorio. (y 1 error más)",
"code": 10001,
"code_name": "validation_error",
"errors": {
"customer_id": [
"El campo customer id es obligatorio."
],
"single_use": [
"El campo single use es obligatorio."
]
}
}
{
"message": "No se puede generar la operación, genera un token de idempotencia y envíelo en los headers como x-idempotency",
"code": 10003,
"code_name": "idempotency_error"
}
Was this page helpful?
⌘I