curl --request POST \
--url https://tapipay-facade.homo.tapila.cloud/v2/debts \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--header 'x-authorization-token: <api-key>' \
--data '
{
"amount": 1.01,
"dueDate": "2023-12-25",
"externalClientId": "<string>",
"currency": "MXN",
"description": "<string>",
"allowOverduePayment": true,
"allowPartialPayments": true,
"additionalData": {
"source": "crm",
"folio": "F-2026-0042"
},
"productId": "<string>",
"externalProductId": "<string>"
}
'import requests
url = "https://tapipay-facade.homo.tapila.cloud/v2/debts"
payload = {
"amount": 1.01,
"dueDate": "2023-12-25",
"externalClientId": "<string>",
"currency": "MXN",
"description": "<string>",
"allowOverduePayment": True,
"allowPartialPayments": True,
"additionalData": {
"source": "crm",
"folio": "F-2026-0042"
},
"productId": "<string>",
"externalProductId": "<string>"
}
headers = {
"x-api-key": "<api-key>",
"x-authorization-token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-api-key': '<api-key>',
'x-authorization-token': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
amount: 1.01,
dueDate: '2023-12-25',
externalClientId: '<string>',
currency: 'MXN',
description: '<string>',
allowOverduePayment: true,
allowPartialPayments: true,
additionalData: {source: 'crm', folio: 'F-2026-0042'},
productId: '<string>',
externalProductId: '<string>'
})
};
fetch('https://tapipay-facade.homo.tapila.cloud/v2/debts', 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://tapipay-facade.homo.tapila.cloud/v2/debts",
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([
'amount' => 1.01,
'dueDate' => '2023-12-25',
'externalClientId' => '<string>',
'currency' => 'MXN',
'description' => '<string>',
'allowOverduePayment' => true,
'allowPartialPayments' => true,
'additionalData' => [
'source' => 'crm',
'folio' => 'F-2026-0042'
],
'productId' => '<string>',
'externalProductId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>",
"x-authorization-token: <api-key>"
],
]);
$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://tapipay-facade.homo.tapila.cloud/v2/debts"
payload := strings.NewReader("{\n \"amount\": 1.01,\n \"dueDate\": \"2023-12-25\",\n \"externalClientId\": \"<string>\",\n \"currency\": \"MXN\",\n \"description\": \"<string>\",\n \"allowOverduePayment\": true,\n \"allowPartialPayments\": true,\n \"additionalData\": {\n \"source\": \"crm\",\n \"folio\": \"F-2026-0042\"\n },\n \"productId\": \"<string>\",\n \"externalProductId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("x-authorization-token", "<api-key>")
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://tapipay-facade.homo.tapila.cloud/v2/debts")
.header("x-api-key", "<api-key>")
.header("x-authorization-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 1.01,\n \"dueDate\": \"2023-12-25\",\n \"externalClientId\": \"<string>\",\n \"currency\": \"MXN\",\n \"description\": \"<string>\",\n \"allowOverduePayment\": true,\n \"allowPartialPayments\": true,\n \"additionalData\": {\n \"source\": \"crm\",\n \"folio\": \"F-2026-0042\"\n },\n \"productId\": \"<string>\",\n \"externalProductId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://tapipay-facade.homo.tapila.cloud/v2/debts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["x-authorization-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": 1.01,\n \"dueDate\": \"2023-12-25\",\n \"externalClientId\": \"<string>\",\n \"currency\": \"MXN\",\n \"description\": \"<string>\",\n \"allowOverduePayment\": true,\n \"allowPartialPayments\": true,\n \"additionalData\": {\n \"source\": \"crm\",\n \"folio\": \"F-2026-0042\"\n },\n \"productId\": \"<string>\",\n \"externalProductId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"debtId": "debt_COLE-OCT-00042",
"externalRequestId": "<string>",
"status": "PENDING",
"amount": 123,
"amountPaid": 123,
"currency": "MXN",
"dueDate": "2023-12-25",
"allowOverduePayment": true,
"allowPartialPayments": true,
"autopay": true,
"createdAt": "2023-11-07T05:31:56Z",
"description": "<string>",
"paymentMethods": [
"CASH"
],
"paymentUrl": "<string>",
"contact": {
"contactId": "<string>",
"externalClientId": "<string>",
"createdInline": true
},
"product": {
"productId": "<string>",
"name": "<string>",
"active": true,
"createdInline": true
},
"autopayReason": "DEFAULT_PAYMENT_METHODS_DISABLED_FOR_COMPANY",
"autopayInstrument": {
"paymentMethodId": "8b2e2a1e-1111-4222-8333-444455556666",
"paymentMethodType": "BANK_ACCOUNT",
"isDefault": true,
"status": "ACTIVE",
"createdAt": "2023-11-07T05:31:56Z"
}
},
"requestId": "<string>"
}Crear deuda con debito automatico
Crea una deuda cuya cobranza automatica la gobierna el medio de pago default del usuario. La identidad del producto viaja por productId o externalProductId (uno solo). productName y paymentMethod no se aceptan. La deuda siempre se crea; autopay/autopayReason indican si el cobro automatico quedo activo y por que.
curl --request POST \
--url https://tapipay-facade.homo.tapila.cloud/v2/debts \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--header 'x-authorization-token: <api-key>' \
--data '
{
"amount": 1.01,
"dueDate": "2023-12-25",
"externalClientId": "<string>",
"currency": "MXN",
"description": "<string>",
"allowOverduePayment": true,
"allowPartialPayments": true,
"additionalData": {
"source": "crm",
"folio": "F-2026-0042"
},
"productId": "<string>",
"externalProductId": "<string>"
}
'import requests
url = "https://tapipay-facade.homo.tapila.cloud/v2/debts"
payload = {
"amount": 1.01,
"dueDate": "2023-12-25",
"externalClientId": "<string>",
"currency": "MXN",
"description": "<string>",
"allowOverduePayment": True,
"allowPartialPayments": True,
"additionalData": {
"source": "crm",
"folio": "F-2026-0042"
},
"productId": "<string>",
"externalProductId": "<string>"
}
headers = {
"x-api-key": "<api-key>",
"x-authorization-token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-api-key': '<api-key>',
'x-authorization-token': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
amount: 1.01,
dueDate: '2023-12-25',
externalClientId: '<string>',
currency: 'MXN',
description: '<string>',
allowOverduePayment: true,
allowPartialPayments: true,
additionalData: {source: 'crm', folio: 'F-2026-0042'},
productId: '<string>',
externalProductId: '<string>'
})
};
fetch('https://tapipay-facade.homo.tapila.cloud/v2/debts', 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://tapipay-facade.homo.tapila.cloud/v2/debts",
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([
'amount' => 1.01,
'dueDate' => '2023-12-25',
'externalClientId' => '<string>',
'currency' => 'MXN',
'description' => '<string>',
'allowOverduePayment' => true,
'allowPartialPayments' => true,
'additionalData' => [
'source' => 'crm',
'folio' => 'F-2026-0042'
],
'productId' => '<string>',
'externalProductId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>",
"x-authorization-token: <api-key>"
],
]);
$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://tapipay-facade.homo.tapila.cloud/v2/debts"
payload := strings.NewReader("{\n \"amount\": 1.01,\n \"dueDate\": \"2023-12-25\",\n \"externalClientId\": \"<string>\",\n \"currency\": \"MXN\",\n \"description\": \"<string>\",\n \"allowOverduePayment\": true,\n \"allowPartialPayments\": true,\n \"additionalData\": {\n \"source\": \"crm\",\n \"folio\": \"F-2026-0042\"\n },\n \"productId\": \"<string>\",\n \"externalProductId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("x-authorization-token", "<api-key>")
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://tapipay-facade.homo.tapila.cloud/v2/debts")
.header("x-api-key", "<api-key>")
.header("x-authorization-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 1.01,\n \"dueDate\": \"2023-12-25\",\n \"externalClientId\": \"<string>\",\n \"currency\": \"MXN\",\n \"description\": \"<string>\",\n \"allowOverduePayment\": true,\n \"allowPartialPayments\": true,\n \"additionalData\": {\n \"source\": \"crm\",\n \"folio\": \"F-2026-0042\"\n },\n \"productId\": \"<string>\",\n \"externalProductId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://tapipay-facade.homo.tapila.cloud/v2/debts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["x-authorization-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": 1.01,\n \"dueDate\": \"2023-12-25\",\n \"externalClientId\": \"<string>\",\n \"currency\": \"MXN\",\n \"description\": \"<string>\",\n \"allowOverduePayment\": true,\n \"allowPartialPayments\": true,\n \"additionalData\": {\n \"source\": \"crm\",\n \"folio\": \"F-2026-0042\"\n },\n \"productId\": \"<string>\",\n \"externalProductId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"debtId": "debt_COLE-OCT-00042",
"externalRequestId": "<string>",
"status": "PENDING",
"amount": 123,
"amountPaid": 123,
"currency": "MXN",
"dueDate": "2023-12-25",
"allowOverduePayment": true,
"allowPartialPayments": true,
"autopay": true,
"createdAt": "2023-11-07T05:31:56Z",
"description": "<string>",
"paymentMethods": [
"CASH"
],
"paymentUrl": "<string>",
"contact": {
"contactId": "<string>",
"externalClientId": "<string>",
"createdInline": true
},
"product": {
"productId": "<string>",
"name": "<string>",
"active": true,
"createdInline": true
},
"autopayReason": "DEFAULT_PAYMENT_METHODS_DISABLED_FOR_COMPANY",
"autopayInstrument": {
"paymentMethodId": "8b2e2a1e-1111-4222-8333-444455556666",
"paymentMethodType": "BANK_ACCOUNT",
"isDefault": true,
"status": "ACTIVE",
"createdAt": "2023-11-07T05:31:56Z"
}
},
"requestId": "<string>"
}Autorizaciones
API key del API Gateway de Tapi. Requerida en todas las operaciones. Distinta por ambiente (desarrollo, homologación, producción).
Token TAPI JWT. Requerido en todas las operaciones. Se envía sin prefijo "Bearer". Ej: x-authorization-token: eyJhbGci...
Encabezados
Solo en la deuda suelta. Se usa como externalRequestId de la deuda, y el debtId resultante es debt_<key>.
Cuerpo
- Option 1
- Option 2
Contrato de creación de deuda con la identidad de producto por referencia (productId o externalProductId), nunca por nombre. No incluye paymentMethods: en v2 la deuda no declara medio de pago, el cobro automático lo gobierna el default del usuario. productName tampoco se acepta (400 INVALID_REQUEST): los productos nunca se crean desde este endpoint. productId y externalProductId son mutuamente excluyentes. Campos aceptados: externalClientId, contactData, amount, currency, dueDate, description, allowOverduePayment, allowPartialPayments, additionalData, productId, externalProductId. Cualquier otro campo (incluidos autopay, paymentMethods, productName y paymentMethod) devuelve 400 con el campo en details[].field.
Monto en pesos (hasta 2 decimales, mínimo 0.01)
x >= 0.01Debe ser un múltiplo de 0.01Fecha de vencimiento (YYYY-MM-DD), fecha de calendario válida. No se valida que sea futura.
Identificador del deudor (externalClientId o contactData, no ambos). Si contactData no se envía, este campo es obligatorio.
Datos completos del deudor inline. Si se envía, externalClientId no se permite. Alternativa a externalClientId.
Show child attributes
Show child attributes
Código de moneda ISO 4217 (MXN, ARS, PEN, COP, CLP, USD). Default MXN.
MXN, ARS, PEN, COP, CLP, USD Descripción visible al deudor (opcional). Debe ser string (si no, 400).
Si false, no se puede pagar después del dueDate. Solo acepta true/false literal: "true", 1, etc. devuelven 400 con details[].
Habilita pagos parciales. Solo acepta true/false literal: "true", 1, etc. devuelven 400 con details[].
Datos adicionales propios del cliente. Debe ser un objeto plano; un escalar (string, número o booleano) devuelve 400 INVALID_REQUEST. No puede usar claves reservadas, que TapiPay escribe internamente: description, paymentMethods, productName, externalProductId, debtExpirationDate, overduePayment, allowPartialPayments, recurringDebt, debtReference. Si aparece alguna, la API responde 400 INVALID_REQUEST con details[].field = additionalData. Se persiste en la deuda (en ligas de pago, en la deuda asociada al link; en suscripciones, en las deudas generadas).
{ "source": "crm", "folio": "F-2026-0042" }
ID del producto en Tapi, formato prd_<número>. Otro formato devuelve 400 INVALID_REQUEST. Excluyente con externalProductId.
^prd_\d+$Tu identificador del producto. Excluyente con productId. No admite los caracteres ', ", \, ; (400).

