curl --request DELETE \
--url https://tapipay-facade.homo.tapila.cloud/payment-methods/{externalPaymentMethodId} \
--header 'x-api-key: <api-key>' \
--header 'x-authorization-token: <api-key>'import requests
url = "https://tapipay-facade.homo.tapila.cloud/payment-methods/{externalPaymentMethodId}"
headers = {
"x-api-key": "<api-key>",
"x-authorization-token": "<api-key>"
}
response = requests.delete(url, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {'x-api-key': '<api-key>', 'x-authorization-token': '<api-key>'}
};
fetch('https://tapipay-facade.homo.tapila.cloud/payment-methods/{externalPaymentMethodId}', 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/payment-methods/{externalPaymentMethodId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://tapipay-facade.homo.tapila.cloud/payment-methods/{externalPaymentMethodId}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("x-authorization-token", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://tapipay-facade.homo.tapila.cloud/payment-methods/{externalPaymentMethodId}")
.header("x-api-key", "<api-key>")
.header("x-authorization-token", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://tapipay-facade.homo.tapila.cloud/payment-methods/{externalPaymentMethodId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["x-api-key"] = '<api-key>'
request["x-authorization-token"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": {
"externalPaymentMethodId": "3f9c1a7e-8d2b-4c55-9e1a-2b7d6f0c4a11",
"wasDefault": true,
"newDefaultExternalPaymentMethodId": "b7e4a0c2-9f13-4e6d-8a25-71c3d9e0b4f8",
"deactivatedAdhesions": [
{
"productId": "prd_7"
}
],
"deactivatedAdhesionsCount": 123
},
"requestId": "<string>"
}Eliminar un medio de pago del usuario
Elimina un medio de pago del usuario. Antes da de baja las adhesiones que lo usaban. Si era el predeterminado, el más reciente de los medios que le quedan al usuario pasa a serlo; si no le queda ninguno, el usuario queda sin medio predeterminado. Las órdenes de pago que ya se crearon con este medio siguen su curso. Reintentar es seguro: si el medio ya se había eliminado, la respuesta es 404.
curl --request DELETE \
--url https://tapipay-facade.homo.tapila.cloud/payment-methods/{externalPaymentMethodId} \
--header 'x-api-key: <api-key>' \
--header 'x-authorization-token: <api-key>'import requests
url = "https://tapipay-facade.homo.tapila.cloud/payment-methods/{externalPaymentMethodId}"
headers = {
"x-api-key": "<api-key>",
"x-authorization-token": "<api-key>"
}
response = requests.delete(url, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {'x-api-key': '<api-key>', 'x-authorization-token': '<api-key>'}
};
fetch('https://tapipay-facade.homo.tapila.cloud/payment-methods/{externalPaymentMethodId}', 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/payment-methods/{externalPaymentMethodId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://tapipay-facade.homo.tapila.cloud/payment-methods/{externalPaymentMethodId}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("x-authorization-token", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://tapipay-facade.homo.tapila.cloud/payment-methods/{externalPaymentMethodId}")
.header("x-api-key", "<api-key>")
.header("x-authorization-token", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://tapipay-facade.homo.tapila.cloud/payment-methods/{externalPaymentMethodId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["x-api-key"] = '<api-key>'
request["x-authorization-token"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": {
"externalPaymentMethodId": "3f9c1a7e-8d2b-4c55-9e1a-2b7d6f0c4a11",
"wasDefault": true,
"newDefaultExternalPaymentMethodId": "b7e4a0c2-9f13-4e6d-8a25-71c3d9e0b4f8",
"deactivatedAdhesions": [
{
"productId": "prd_7"
}
],
"deactivatedAdhesionsCount": 123
},
"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...
Parámetros de ruta
El medio a eliminar, tal como lo devuelve GET /payment-methods.
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-04937"
Tu identificador del usuario final: exactamente el mismo del enrolamiento. No admite los caracteres ', ", \, ;.

