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,
"amountType": "CLOSED",
"recurring": false,
"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,
"amountType": "CLOSED",
"recurring": False,
"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,
amountType: 'CLOSED',
recurring: false,
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,
'amountType' => 'CLOSED',
'recurring' => false,
'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 \"amountType\": \"CLOSED\",\n \"recurring\": false,\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 \"amountType\": \"CLOSED\",\n \"recurring\": false,\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 \"amountType\": \"CLOSED\",\n \"recurring\": false,\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_bodyCrear deuda con debito automatico
Crea una deuda asociada a un producto. La identidad del producto viaja por productId o externalProductId (uno solo). productName y paymentMethod no se aceptan. Crear la deuda NO solicita ni evalua el debito automatico: si el usuario ya esta adherido a ese producto, la deuda se cobra sola; si no, se paga por su paymentUrl. La respuesta ya no incluye autopay, autopayReason ni autopayInstrument.
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,
"amountType": "CLOSED",
"recurring": false,
"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,
"amountType": "CLOSED",
"recurring": False,
"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,
amountType: 'CLOSED',
recurring: false,
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,
'amountType' => 'CLOSED',
'recurring' => false,
'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 \"amountType\": \"CLOSED\",\n \"recurring\": false,\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 \"amountType\": \"CLOSED\",\n \"recurring\": false,\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 \"amountType\": \"CLOSED\",\n \"recurring\": false,\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_bodyAutorizaciones
Encabezados
Parámetros de consulta
Solo si tu cliente tiene varias companies: indica en cuál operas. En POST y PATCH también se puede enviar en el cuerpo (el cuerpo tiene prioridad). Si tu cliente tiene varias companies y no lo envías, 400 BAD_REQUEST; si no es una company de tu cliente, 422 RESOLUTION_ERROR (403 en /v2/debts/orders).
"MX-S-67890"
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 la adhesión del usuario al producto (POST /adhesions). 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, amountType, recurring, additionalData, productId, externalProductId. Cualquier otro campo (incluidos autopay, paymentMethods, productName y paymentMethod) devuelve 400 con el campo en details[].field.
Cómo se cobra el monto. CLOSED registra el monto exacto en el proveedor de pago: cualquier otro importe se rechaza al pagar. OPEN registra un rango (definido por la configuración de la modalidad de tu compañía) y el deudor elige cuánto paga. Tiene prioridad sobre allowPartialPayments, que solo decide cómo se contabilizan los pagos: OPEN con allowPartialPayments true es válido y la respuesta sigue informando OPEN. Acepta mayúsculas o minúsculas; cualquier otro valor, incluido PARTIAL, devuelve 400 con details[]. En una deuda OPEN, amountPaid es la suma de los pagos recibidos.
CLOSED, OPEN Si es true, la deuda se sigue ofreciendo al deudor después de un pago: cada pago se suma a la misma deuda y su status queda en PAID desde que se salda. amountPaid es el mayor entre el monto saldado según el estado y la suma de los pagos recibidos. Una deuda recurrente en PAID se puede cancelar. Solo acepta true/false literal (otro valor devuelve 400 con details[]); null se toma como el default. No es el autopay de las suscripciones.
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. 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" }

