Realizar pago
curl --request POST \
--url https://api.onepay.la/v1/utilities \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-idempotency: <x-idempotency>' \
--data '
{
"provider_id": "<string>",
"reference": "<string>",
"external_id": "<string>"
}
'import requests
url = "https://api.onepay.la/v1/utilities"
payload = {
"provider_id": "<string>",
"reference": "<string>",
"external_id": "<string>"
}
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({provider_id: '<string>', reference: '<string>', external_id: '<string>'})
};
fetch('https://api.onepay.la/v1/utilities', 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/utilities",
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([
'provider_id' => '<string>',
'reference' => '<string>',
'external_id' => '<string>'
]),
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/utilities"
payload := strings.NewReader("{\n \"provider_id\": \"<string>\",\n \"reference\": \"<string>\",\n \"external_id\": \"<string>\"\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/utilities")
.header("x-idempotency", "<x-idempotency>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"provider_id\": \"<string>\",\n \"reference\": \"<string>\",\n \"external_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.onepay.la/v1/utilities")
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 \"provider_id\": \"<string>\",\n \"reference\": \"<string>\",\n \"external_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "9d1cd37a-a6bc-472d-b4e6-c913769d005a",
"group_id": "Kirlin Group, 2381762387",
"provider_id": "9d1cd37a-94e5-4cf1-aa7c-daac8ebf4ed9",
"provider_name": "Kirlin Group",
"amount": 250000,
"reference": "2381762387",
"external_id": "FACT-2026-00123",
"status": "pending",
"remarks": null
}
Realizar pago
Realiza un pago a un convenio.
POST
utilities
Realizar pago
curl --request POST \
--url https://api.onepay.la/v1/utilities \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-idempotency: <x-idempotency>' \
--data '
{
"provider_id": "<string>",
"reference": "<string>",
"external_id": "<string>"
}
'import requests
url = "https://api.onepay.la/v1/utilities"
payload = {
"provider_id": "<string>",
"reference": "<string>",
"external_id": "<string>"
}
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({provider_id: '<string>', reference: '<string>', external_id: '<string>'})
};
fetch('https://api.onepay.la/v1/utilities', 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/utilities",
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([
'provider_id' => '<string>',
'reference' => '<string>',
'external_id' => '<string>'
]),
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/utilities"
payload := strings.NewReader("{\n \"provider_id\": \"<string>\",\n \"reference\": \"<string>\",\n \"external_id\": \"<string>\"\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/utilities")
.header("x-idempotency", "<x-idempotency>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"provider_id\": \"<string>\",\n \"reference\": \"<string>\",\n \"external_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.onepay.la/v1/utilities")
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 \"provider_id\": \"<string>\",\n \"reference\": \"<string>\",\n \"external_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "9d1cd37a-a6bc-472d-b4e6-c913769d005a",
"group_id": "Kirlin Group, 2381762387",
"provider_id": "9d1cd37a-94e5-4cf1-aa7c-daac8ebf4ed9",
"provider_name": "Kirlin Group",
"amount": 250000,
"reference": "2381762387",
"external_id": "FACT-2026-00123",
"status": "pending",
"remarks": null
}
El pago se procesa después de responder: la respuesta llega con
status: "pending". Cuando el
convenio lo confirme, tus webhooks de producción reciben utility.paid, o utility.rejected
si no se logra. Los webhooks de modo prueba no reciben estos eventos. Ver Webhooks de servicios
públicos.Headers
string
required
Token único para garantizar la idempotencia de la petición
Body
string
required
UUID del convenio listado previamente que se desea pagar.
string
required
Referencia de pago para el convenio. de ejemplo puedes usar 111100005555
string
Tu propio identificador para el pago (máximo 255 caracteres). Se devuelve en la respuesta y al
consultar el pago, para que puedas conciliarlo con tu sistema.
{
"id": "9d1cd37a-a6bc-472d-b4e6-c913769d005a",
"group_id": "Kirlin Group, 2381762387",
"provider_id": "9d1cd37a-94e5-4cf1-aa7c-daac8ebf4ed9",
"provider_name": "Kirlin Group",
"amount": 250000,
"reference": "2381762387",
"external_id": "FACT-2026-00123",
"status": "pending",
"remarks": null
}
Was this page helpful?
⌘I