Listar plantillas
curl --request GET \
--url https://api.onepay.la/v1/templates \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.onepay.la/v1/templates"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.onepay.la/v1/templates', 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/templates",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.onepay.la/v1/templates"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.onepay.la/v1/templates")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.onepay.la/v1/templates")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": [
{
"id": 1421,
"name": "Payment Customer File Flow Pro V5",
"key": "payment_customer_file_flow_pro_v5",
"status": "APPROVED",
"type": "PAYMENT",
"stage": null,
"language": "es",
"provider": "META",
"is_predefined": true,
"selectable": true,
"header_type": "DOCUMENT",
"body": "¡Hola {{1}}! 👋🏻 *{{2}}* ha solicitado {{3}} para el pago de tu *{{4}}*.\n\nRealiza tu pago de forma fácil y segura.",
"footer": "Pagos seguros con OnePay",
"variables": ["customer_name", "company_name", "amount_label", "minified_title"],
"buttons": [
{ "type": "REPLY", "text": "Pagar con Bre-B" },
{ "type": "FLOW", "text": "Iniciar pago" },
{ "type": "URL", "text": "Pagar en la web" }
],
"created_at": "2026-03-11T14:02:51+00:00",
"updated_at": "2026-07-02T09:18:04+00:00"
},
{
"id": 1508,
"name": "Onepay Payment Overdue Es V2",
"key": "onepay_payment_overdue_es_v2",
"status": "PENDING",
"type": "PAYMENT",
"stage": "overdue",
"language": "es",
"provider": "META",
"is_predefined": true,
"selectable": false,
"header_type": "None",
"body": "Hola {{1}}, tu pago con {{2}} está vencido.\n\n📋 Concepto: {{3}}\n💰 Monto: {{4}}",
"footer": "Pagos seguros con OnePay",
"variables": ["customer_name", "company_name", "title", "amount"],
"buttons": [
{ "type": "REPLY", "text": "Pagar con Bre-B" },
{ "type": "FLOW", "text": "Iniciar pago" },
{ "type": "URL", "text": "Pagar en la web" }
],
"created_at": "2026-05-20T11:41:09+00:00",
"updated_at": "2026-06-28T16:30:22+00:00"
}
],
"current_page": 1,
"from": 1,
"last_page": 2,
"per_page": 20,
"to": 20,
"total": 27
}
Listar plantillas
Endpoint para obtener las plantillas de WhatsApp disponibles para tu empresa.
GET
/
templates
Listar plantillas
curl --request GET \
--url https://api.onepay.la/v1/templates \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.onepay.la/v1/templates"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.onepay.la/v1/templates', 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/templates",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.onepay.la/v1/templates"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.onepay.la/v1/templates")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.onepay.la/v1/templates")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": [
{
"id": 1421,
"name": "Payment Customer File Flow Pro V5",
"key": "payment_customer_file_flow_pro_v5",
"status": "APPROVED",
"type": "PAYMENT",
"stage": null,
"language": "es",
"provider": "META",
"is_predefined": true,
"selectable": true,
"header_type": "DOCUMENT",
"body": "¡Hola {{1}}! 👋🏻 *{{2}}* ha solicitado {{3}} para el pago de tu *{{4}}*.\n\nRealiza tu pago de forma fácil y segura.",
"footer": "Pagos seguros con OnePay",
"variables": ["customer_name", "company_name", "amount_label", "minified_title"],
"buttons": [
{ "type": "REPLY", "text": "Pagar con Bre-B" },
{ "type": "FLOW", "text": "Iniciar pago" },
{ "type": "URL", "text": "Pagar en la web" }
],
"created_at": "2026-03-11T14:02:51+00:00",
"updated_at": "2026-07-02T09:18:04+00:00"
},
{
"id": 1508,
"name": "Onepay Payment Overdue Es V2",
"key": "onepay_payment_overdue_es_v2",
"status": "PENDING",
"type": "PAYMENT",
"stage": "overdue",
"language": "es",
"provider": "META",
"is_predefined": true,
"selectable": false,
"header_type": "None",
"body": "Hola {{1}}, tu pago con {{2}} está vencido.\n\n📋 Concepto: {{3}}\n💰 Monto: {{4}}",
"footer": "Pagos seguros con OnePay",
"variables": ["customer_name", "company_name", "title", "amount"],
"buttons": [
{ "type": "REPLY", "text": "Pagar con Bre-B" },
{ "type": "FLOW", "text": "Iniciar pago" },
{ "type": "URL", "text": "Pagar en la web" }
],
"created_at": "2026-05-20T11:41:09+00:00",
"updated_at": "2026-06-28T16:30:22+00:00"
}
],
"current_page": 1,
"from": 1,
"last_page": 2,
"per_page": 20,
"to": 20,
"total": 27
}
Devuelve las plantillas visibles para tu empresa, incluidas las genéricas compartidas. Usa el campo
Solo las que puedes fijar en un cobro:
selectable para saber cuáles puedes fijar en el template_id de un cobro.
Query Parameters
boolean
1 devuelve únicamente las plantillas que puedes usar como template_id al crear un cobro; 0 devuelve las que no.string
Filtra por estado. Valores válidos:
DRAFT- Creada, sin enviar a MetaPENDING- En revisión por MetaAPPROVED- AprobadaREJECTED- Rechazada por Meta
string
Filtra por etapa de cobranza. Valores válidos:
reminder- Recordatoriodue_soon- Próximo a vencerdue_today- Vence hoyoverdue- Vencidopre_cut- Antes del cortecut- Cortewinback- Recuperacióncustom- Personalizada
string
Filtra por proveedor de WhatsApp, por ejemplo
META, DIALOG_360 o INFOBIP.boolean
1 para las plantillas predefinidas de OnePay, 0 para las que creaste tú.string
default:"-updated_at"
Ordenamiento. Valores permitidos:
name, created_at y updated_at. Antepón - para orden descendente.integer
default:"20"
Cantidad de resultados por página. Mínimo 1, máximo 100.
integer
default:"1"
Número de página para paginación.
Ejemplos de uso
- curl
- JavaScript
- Python
- PHP
curl https://api.onepay.la/v1/templates \
-X GET \
-H "Authorization: Bearer sk_test_xxx"
curl "https://api.onepay.la/v1/templates?filter[selectable]=1" \
-X GET \
-H "Authorization: Bearer sk_test_xxx"
const response = await fetch('https://api.onepay.la/v1/templates?filter[selectable]=1', {
method: 'GET',
headers: {
'Authorization': 'Bearer sk_test_xxx',
},
});
const data = await response.json();
import requests
response = requests.get(
'https://api.onepay.la/v1/templates',
params={'filter[selectable]': 1},
headers={'Authorization': 'Bearer sk_test_xxx'},
)
data = response.json()
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.onepay.la/v1/templates?filter[selectable]=1",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer sk_test_xxx"]
]);
$data = json_decode(curl_exec($curl), true);
?>
Response
array
Lista de plantillas.
Show Propiedades de cada plantilla
Show Propiedades de cada plantilla
integer
Identificador de la plantilla. Es el valor que envías en
template_id al crear un cobro.string
Nombre legible de la plantilla.
string
Nombre técnico registrado ante el proveedor, en snake_case.
string
Estado de aprobación:
DRAFT, PENDING, APPROVED o REJECTED.string
Categoría:
PAYMENT, PAYMENT_APPROVED, UTILITY, MARKETING o AUTHENTICATION.string
Etapa de cobranza, o
null en las plantillas de cobro directo.string
Idioma de la plantilla, por ejemplo
es.string
Proveedor de WhatsApp donde está registrada.
boolean
true si es una plantilla predefinida de OnePay.boolean
true si puedes usar este id como template_id al crear un cobro.string
Tipo de encabezado:
DOCUMENT, IMAGE, TEXT o None.string
Texto del mensaje. Los
{{1}}, {{2}}… se reemplazan con los datos del cobro.string
Texto del pie del mensaje.
array
Variables que reemplazan los marcadores del cuerpo, en orden.
array
Botones del mensaje, cada uno con
type y text.string
Fecha de creación en formato ISO 8601.
string
Fecha de última actualización en formato ISO 8601.
integer
Página actual.
integer
Índice del primer registro en la página actual.
integer
Última página disponible.
integer
Cantidad de registros por página.
integer
Índice del último registro en la página actual.
integer
Total de plantillas.
Ejemplo de respuesta
{
"data": [
{
"id": 1421,
"name": "Payment Customer File Flow Pro V5",
"key": "payment_customer_file_flow_pro_v5",
"status": "APPROVED",
"type": "PAYMENT",
"stage": null,
"language": "es",
"provider": "META",
"is_predefined": true,
"selectable": true,
"header_type": "DOCUMENT",
"body": "¡Hola {{1}}! 👋🏻 *{{2}}* ha solicitado {{3}} para el pago de tu *{{4}}*.\n\nRealiza tu pago de forma fácil y segura.",
"footer": "Pagos seguros con OnePay",
"variables": ["customer_name", "company_name", "amount_label", "minified_title"],
"buttons": [
{ "type": "REPLY", "text": "Pagar con Bre-B" },
{ "type": "FLOW", "text": "Iniciar pago" },
{ "type": "URL", "text": "Pagar en la web" }
],
"created_at": "2026-03-11T14:02:51+00:00",
"updated_at": "2026-07-02T09:18:04+00:00"
},
{
"id": 1508,
"name": "Onepay Payment Overdue Es V2",
"key": "onepay_payment_overdue_es_v2",
"status": "PENDING",
"type": "PAYMENT",
"stage": "overdue",
"language": "es",
"provider": "META",
"is_predefined": true,
"selectable": false,
"header_type": "None",
"body": "Hola {{1}}, tu pago con {{2}} está vencido.\n\n📋 Concepto: {{3}}\n💰 Monto: {{4}}",
"footer": "Pagos seguros con OnePay",
"variables": ["customer_name", "company_name", "title", "amount"],
"buttons": [
{ "type": "REPLY", "text": "Pagar con Bre-B" },
{ "type": "FLOW", "text": "Iniciar pago" },
{ "type": "URL", "text": "Pagar en la web" }
],
"created_at": "2026-05-20T11:41:09+00:00",
"updated_at": "2026-06-28T16:30:22+00:00"
}
],
"current_page": 1,
"from": 1,
"last_page": 2,
"per_page": 20,
"to": 20,
"total": 27
}
Was this page helpful?
⌘I